main icon indicating copy to clipboard operation
main copied to clipboard

Cannot open files under 'U' and 't' modes under CPython 2.7

Open ironpythonbot opened this issue 10 years ago • 0 comments

Specifically the following file opening modes (second param of the 'file' function) are no longer allowed:
['Ut', 'U+t', 'rUt', 'rU+t', 'Urt', 'Ur+t']
and now end up throwing an exception.

D:\rft\vsl\dlr\Languages\IronPython\Tests\compat>26
Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

f = open("blah.txt", "w")
f.close()
f = open("blah.txt", "Ut")
f.close()
^Z

D:\rft\vsl\dlr\Languages\IronPython\Tests\compat>27
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
f = open("blah.txt", "w")
f.close()
f = open("blah.txt", "Ut")
Traceback (most recent call last):
File "", line 1, in
ValueError: Invalid mode ('rbt')
f.close()
^Z

Work Item Details

Original CodePlex Issue: Issue 28386 Status: Proposed Reason Closed: Unassigned Assigned to: Unassigned Reported on: Aug 3, 2010 at 12:04 AM Reported by: dfugate Updated on: Feb 22, 2013 at 2:10 AM Updated by: jdhardy Test: sbs_builtin.py (test_file_mode)

ironpythonbot avatar Dec 09 '14 17:12 ironpythonbot