[issue37515] `open("aux.txt", "w")` fails unexpectedly with FileNotFoundError on Windows

Carsten report at bugs.python.org
Sat Jul 6 15:09:55 EDT 2019


Carsten <carsten.knoll at posteo.de> added the comment:

This is a good explanation. Indeed Windows complains if I manually want to create a file "aux.txt" ("This device name is not allowed").

If I want to copy-paste such a file from within a zip-file (Windows Explorer can open zip files) I get an "Unexpected Error".


I think a descriptive error message would be very helpful here. The best mechanism would be if this was generated on system level and then just passed through by io.open to the generated Exception. But just throwing a "FileNotFoundError" without any hint is potentially frustrating.

Suggestion for a better Error message: "Could neither open nor create the desired file. Maybe the filename is not allowed by the underlying os".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37515>
_______________________________________


More information about the Python-bugs-list mailing list