Author r.david.murray
Recipients georg.brandl, giampaolo.rodola, holdenweb, lregebro, pitrou, r.david.murray, rhettinger, sdaoden, vstinner
Date 2011-01-29.19:24:39
SpamBayes Score 7.04437e-13
Marked as misclassified No
Message-id <1296329080.85.0.272108662086.issue9124@psf.upfronthosting.co.za>
In-reply-to
Content
(I hope you meant I was working on a patch :)

Patch is done, but there is one remaining test failure that I'm not sure how to handle.  The test is test_add_text_file_warns.  The code checks to see if a file is a subclass of io.TextIOWrapper, and if so warns that this is deprecated, grabs the buffer attribute, and reads the file as binary.  This works fine, except that in testing it I used a temporary file.  On Linux that works great, but on Windows the temporary file is a tempfile._TemporaryFileWrapper, and that is *not* a subclass of io.TextIOWrapper.  So the code falls through to the "this must be a binary file" code and fails with a TypeError.

Any thoughts on how to handle this edge case?

I've got stuff to do this afternoon but I'll check back later to see if anybody has any ideas and, if all else fails, will disable that test on Windows.  It means the module doesn't handle temporary-text-file input on Windows correctly, but since we are deprecating text files anyway I think that is not a show stopper.
History
Date User Action Args
2011-01-29 19:24:41r.david.murraysetrecipients: + r.david.murray, georg.brandl, rhettinger, holdenweb, pitrou, vstinner, giampaolo.rodola, lregebro, sdaoden
2011-01-29 19:24:40r.david.murraysetmessageid: <1296329080.85.0.272108662086.issue9124@psf.upfronthosting.co.za>
2011-01-29 19:24:40r.david.murraylinkissue9124 messages
2011-01-29 19:24:40r.david.murraycreate