30 Apr
2009
30 Apr
'09
3:55 p.m.
Not for me (I am using Python 2.6.2).
f = open(chr(255), 'w') Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 22] invalid mode ('w') or filename: '\xff'
You can get the same error on Linux: $ python Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.
f=open(chr(255),'w') Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 22] invalid mode ('w') or filename: '\xff'
(Some file system drivers do not enforce valid utf8 yet, but I suspect they will in the future.) Tom