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 terry.reedy
Recipients alex, amaury.forgeotdarc, hynek, loewis, pitrou, r.david.murray, terry.reedy, vstinner
Date 2012-05-16.19:53:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337198005.12.0.715206930106.issue13849@psf.upfronthosting.co.za>
In-reply-to
Content
There are two issues. 1) what is the requested changed and is it technically correct; 2) if correct, should it be made from a policy viewpoint.

1) Alex, do I understand correctly that you see the behavior of disallowing nulls in paths as correct, and that you want an AssertRaises(..., TypeError) test added?

This rule seems like an OS rule, not a Python language rule. Is it uniform across all OSes?

The following is near the top of the 3.3 os module doc:

"Note: All functions in this module raise OSError in the case of invalid or inaccessible file names and paths, or other arguments that have the correct type, but are not accepted by the operating system."

On that basis, I would expect OSError. But perhaps the doc needs revision to accord with the reworking of OSErrors. On 3.3, Win7, I actually get

>>> os.stat("/tmp\x00abcds")
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    os.stat("/tmp\x00abcds")
FileNotFoundError: [Error 2] The system cannot find the file specified: '/tmp\x00abcds'

It appears that os.stat did not check for embedded nulls but just passed the string to Windows.


2. I am not sure if I understand the opposition to adding tests. As I remember, the 2011 PyCon sprint partly focused on adding tests. Were they not added to 3.2?

If the test is correct, it cannot break anything, and can catch future reversions (which do happen occasionally), besides helping other implementations. 3.2 will soon be a moot point, but I hope other implementations seriously work on 3.3 versions, and that we are willing to improve its test suite after the initial release.

If we are split here, discussion could move to pydev. It is not unusual that a specific issue raises a generic issue that needs broader discussion, but with the specific issue as a focal point.

Anyway, until there is a patch that we agree is technically correct, no decision need be made about commitment and the underlying generic policy.
History
Date User Action Args
2012-05-16 19:53:25terry.reedysetrecipients: + terry.reedy, loewis, amaury.forgeotdarc, pitrou, vstinner, alex, r.david.murray, hynek
2012-05-16 19:53:25terry.reedysetmessageid: <1337198005.12.0.715206930106.issue13849@psf.upfronthosting.co.za>
2012-05-16 19:53:24terry.reedylinkissue13849 messages
2012-05-16 19:53:24terry.reedycreate