Message169673
Passing a unicode filename to aifc.open() results in the argument being treated like a filepointer instead of opening the file.
The argument check,
http://hg.python.org/cpython/file/default/Lib/aifc.py#l332
only checks if the argument is a str. Should this be extended to accept all string-type objects?
Example usage:
>>> import aifc
>>> aifc.open(u"/some/path")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/aifc.py", line 924, in open
return Aifc_read(f)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/aifc.py", line 335, in __init__
self.initfp(f)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/aifc.py", line 286, in initfp
chunk = Chunk(file)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/chunk.py", line 61, in __init__
self.chunkname = file.read(4)
AttributeError: 'unicode' object has no attribute 'read' |
|
Date |
User |
Action |
Args |
2012-09-01 22:33:43 | alastairp | set | recipients:
+ alastairp |
2012-09-01 22:33:43 | alastairp | set | messageid: <1346538823.6.0.158703748918.issue15843@psf.upfronthosting.co.za> |
2012-09-01 22:33:43 | alastairp | link | issue15843 messages |
2012-09-01 22:33:42 | alastairp | create | |
|