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 lazka
Recipients Dolda2000, lazka
Date 2016-12-22.08:54:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482396841.66.0.998983003518.issue29042@psf.upfronthosting.co.za>
In-reply-to
Content
Raising in case no valid path is passed seems fine to me. There are other cases where it fails:

python3 -c "import os; os.path.exists('\ud83d')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/genericpath.py", line 19, in exists
    os.stat(path)
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud83d' in position 0: surrogates not allowed


LANG=C python3 -c "import os; os.path.exists('\xff')"       ~
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.5/genericpath.py", line 19, in exists
    os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character '\xff' in position 0: ordinal not in range(128)
History
Date User Action Args
2016-12-22 08:54:01lazkasetrecipients: + lazka, Dolda2000
2016-12-22 08:54:01lazkasetmessageid: <1482396841.66.0.998983003518.issue29042@psf.upfronthosting.co.za>
2016-12-22 08:54:01lazkalinkissue29042 messages
2016-12-22 08:54:01lazkacreate