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 pitrou
Recipients Max Staff, pitrou, r.david.murray
Date 2017-06-12.20:54:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497300874.72.0.735910612861.issue30641@psf.upfronthosting.co.za>
In-reply-to
Content
On Unix, you can simply check the errno value:

>>> fn = "x" * 9999999
>>> try: open(fn, "r")
... except OSError as e: exc = e
... 
>>> exc.errno
36
>>> exc.errno == errno.ENAMETOOLONG
True

I don't know about Windows.
History
Date User Action Args
2017-06-12 20:54:34pitrousetrecipients: + pitrou, r.david.murray, Max Staff
2017-06-12 20:54:34pitrousetmessageid: <1497300874.72.0.735910612861.issue30641@psf.upfronthosting.co.za>
2017-06-12 20:54:34pitroulinkissue30641 messages
2017-06-12 20:54:34pitroucreate