IOError: [Errno 22] invalid mode ('wb') or filename: in windows xp while making tarfile

John Machin sjmachin at lexicon.net
Sun Aug 23 22:10:12 EDT 2009


Dave Angel <davea <at> ieee.org> writes:

 
> John Machin wrote:
> > Erik Max Francis <max <at> alcyone.com> writes:
  
> I also suspect the "pipe" symbol. I don't know if it's an invalid 
> character to Windows, but it's certainly a bad idea.  The '|' character 
> means something special to the shell.

The "pipe" character is not a valid character in a Windows file.
Despite the OP's message wrapping the filename in "pipes",
there are no pipes in the filename in the traceback to
which he posted a link.  Wrapping the filename in "pipes"
and the cryptic reference to "the '|\U' literal fault"
appear to be side-issue bogglements.

 >>> open('boggle|txt', 'wb')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 IOError: [Errno 22] invalid mode ('wb') or filename: 'boggle|txt'
 >>> open('|boggle.txt|', 'wb')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 IOError: [Errno 22] invalid mode ('wb') or filename: '|boggle.txt|'





More information about the Python-list mailing list