This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients berker.peksag, brett.cannon, docs@python, matrixise, mdk, ned.deily, serhiy.storchaka, vstinner
Date 2019-05-10.02:36:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557455767.38.0.398644983025.issue36345@roundup.psfhosted.org>
In-reply-to
Content
Berker Peksag:
> Please revert 360e1e4c519cfc139de707bcdd1e6c871eec79ee. It's not a good example to put into the documentation.

I looked at other examples: they are nice but far from a "real application". I like the last example which combines multiple wsgiref features and is written like a real application: parse command line arguments, handle CTRL+c, etc.


> It uses different naming convention. It would only confuse users relatively new to the wsgiref module and WSGI protocol.

Would you mind to elaborate? I don't understand what you mean by "naming convention" here, sorry.


> FileWrapper was supposed to support __getitem__ and __iter__ protocols for compatibility with older Python versions, but its __getiem__ implementation is buggy and is already deprecated. It has no use case in modern Python code.

Do you mean that app() must not return FileWrapper? How do you return file content in that case?

Maybe FileWrapper API should be clarified? It's surprising to read Python 3.8 mentioning compatibility with Python 2.1 :-)


> It has zero exception handling and will return a cryptic traceback if mimetype cannot detect type of the file.

Which kind of exceptions do you expect? The example checks if the file exists for example.
History
Date User Action Args
2019-05-10 02:36:07vstinnersetrecipients: + vstinner, brett.cannon, ned.deily, docs@python, berker.peksag, serhiy.storchaka, matrixise, mdk
2019-05-10 02:36:07vstinnersetmessageid: <1557455767.38.0.398644983025.issue36345@roundup.psfhosted.org>
2019-05-10 02:36:07vstinnerlinkissue36345 messages
2019-05-10 02:36:07vstinnercreate