Temat:,Re: IOError: [Errno 22] invalid mode ('wb') or filename: inwindows xp while making tarfile

Discussion in 'Python' started by Ryniek90, Aug 24, 2009.

  1. Ryniek90

    Ryniek90 Guest


    >> 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|'
    >
    >
    >
    >


    Sorry, but i don't know where those pipes came from : P

    The proper path is "C:\\Users\\Ryniek's
    WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2"
    and that string literal is "\U", without any pipes :)

    The truth is that script works on linux (ubuntu) but not on windows
    (neither Win7 nor WinXP).
    Maybe it's good idea to use raw string for specifing those paths?

    As i mentioned later, some python users had the same problem with this
    IOError ( like here: http://www.daniweb.com/forums/thread174552.html or
    here:
    http://groups.google.com/group/sympy/browse_thread/thread/c42aca3eb532928c
    ).
    Ryniek90, Aug 24, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Donnell

    IOError: [Errno 32] Broken pipe

    Jay Donnell, Jun 28, 2004, in forum: Python
    Replies:
    2
    Views:
    8,389
    Donn Cave
    Jun 29, 2004
  2. Ryniek90
    Replies:
    3
    Views:
    4,099
    John Machin
    Aug 24, 2009
  3. Dave Angel
    Replies:
    0
    Views:
    570
    Dave Angel
    Aug 24, 2009
  4. Tim Golden
    Replies:
    6
    Views:
    2,767
    ryniek
    Aug 25, 2009
  5. MBALOVER
    Replies:
    9
    Views:
    2,289
    Richard Bos
    Mar 17, 2010
Loading...

Share This Page