form and opened by filename in browsers when their links are clickedrelying again on browsers to do the right thing text attachments for sends are also subject to the cgi upload limitations described in the note just ahead beyond all thispython appears to have an issue printing some types of unicode text to the standard output stream in the cgi contextwhich necessitates workaround in the main utilities module here that opens stdout in binary mode and writes text as encoded bytes (see the code for more detailsthis unicode/ support is substantially less rich than that in pymailgui howevergiven that we can' prompt for encodings hereand given that this book is running short on time and space in generalimproving this for cases and browsers where it might matter is left as suggested exercise for more on specific fourth-edition changes madesee the comments marked with " in the program code files listed ahead in additionall the features added for the prior edition are still hereas described in the next section limitation on sending attachments in this edition if you haven' already done sosee "cgi file upload limitations in on page in briefin python the cgi moduleas well as the email package' parser which it usesfail with exceptions when requests submitted by web browsers include raw binary data or incompatibly encoded text added for uploaded files unfortunatelybecause this pymailcgi system relies on cgi uploads for attachmentsthis limitation means that this system does not currently support sending emails with binary email attachments such as images and audio files it did support this in the prior edition under python such sent attachments still work in ' pymailgui desktop applicationsimply because attachment file data can be read directly from local files (using binary mode if requiredand mime encoding if needed for inclusion in emailbecause the pymailcgi webmail system here relies on cgi uploads to transfer attachments to the server as an extra first stepthoughit' fully at the mercy of the currently broken cgi module' upload support coding cgi replacement is far too ambitious goal for this book fix is expected for this in the futureand may be present by the time you read these words being based on python thoughthis edition' pymailcgi simply cannot support sending such attachmentsthough they can still be freely viewed in mails fetched in factalthough this edition' pymailcgi inherits some new features from mailtools such as header decoding and encodingthis attachment send limitation is severe enough to preclude expanding this system' feature set to the same degree as this edition' pymailgui for exampleunicode policies are simple hereif not naive it' possible that some client-side scripting techniques such as ajax may be able to transfer attachment files independentlyand thus avoid cgi uploads altogether howeversuch techniques would also require deploying frameworks and technologies the pymailcgi server