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

R

Ryniek90

Hi
I've got my backup script which opens tarfile for add chosen file to it.
But while setting it up, i've got Traceback:
here's the url: -->http://paste.ubuntu.com/258081/<--

I have searched among google's result but didn't found anything useful.
Only found info that it may be the backslashes fault in path, but i have
written proper the path.

Here's link to my script paste: http://paste.ubuntu.com/258087/

Is its the '|\U' literal fault in path '|C:\\Users\\Ryniek's
WinSe7en\\MyNewGGBackup(2009-08-23 14:59:02).tar.bz2|' ?

Sorry if i'm annoying but i'm still learning.
|
 
J

John Machin

Erik Max Francis said:
Ryniek90 wrote:

What is "the '|\U' literal fault" ???
It's probably a misleading error from the OS; I would guess the problem
is that the filename contains colons, which I believe is a no-no on Windows.

The colons are the problem. The error message is not from the OS; it is
concocted by Python (see fileobject.c) as what appears to be the best possible
text given vague error reporting by Windows. I don't understand "probably a
misleading error [message]" -- invalid mode (actual value) or filename ->
invalid something-obviously-not-invalid or filename -> invalid filename
 
D

Dave Angel

John said:
Ryniek90 wrote:

What is "the '|\U' literal fault" ???

It's probably a misleading error from the OS; I would guess the problem
is that the filename contains colons, which I believe is a no-no on Windows.

The colons are the problem. The error message is not from the OS; it is
concocted by Python (see fileobject.c) as what appears to be the best possible
text given vague error reporting by Windows. I don't understand "probably a
misleading error [message]" -- invalid mode (actual value) or filename ->
invalid something-obviously-not-invalid or filename -> invalid filename
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.

DaveA
 
J

John Machin

Dave Angel <davea <at> ieee.org> 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.
Traceback (most recent call last):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 22] invalid mode ('wb') or filename: '|boggle.txt|'
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top