Author vstinner
Recipients alex, benjamin.peterson, piotr.dobrogost, pitrou, python-dev, serhiy.storchaka, stutzbach, vstinner
Date 2015-04-10.16:14:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428682465.92.0.00997229125938.issue21859@psf.upfronthosting.co.za>
In-reply-to
Content
> 2. os.ftruncate doesn't exist on Windows.

Steve Dower wrote a patch and the latest version looks good to me:
https://bugs.python.org/issue23668#msg240385

+            if 0 in os.fsencode(file):
+                raise ValueError('embedded null character')

IMO the check must be implemented in os.open() (in path_converter). It doesn't look right to have a differen behaviour on UNIX and Windows. path_converter() calls PyUnicode_FSConverter() on UNIX and this function checks for embedded null bytes.

So I would prefer to see the issue #23668 fixed and path_converter() fixed, instead of pushing pyio_fileio_fix.patch.
History
Date User Action Args
2015-04-10 16:14:25vstinnersetrecipients: + vstinner, pitrou, benjamin.peterson, stutzbach, alex, python-dev, piotr.dobrogost, serhiy.storchaka
2015-04-10 16:14:25vstinnersetmessageid: <1428682465.92.0.00997229125938.issue21859@psf.upfronthosting.co.za>
2015-04-10 16:14:25vstinnerlinkissue21859 messages
2015-04-10 16:14:25vstinnercreate