472,961 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

rdff-backup / python linux fat32

rdiff-backup is aperently written in Python and when I run it in a
special way I get some funy Python errors. Does anyone know if linux
python have some issues with working with fat32 or usb drives? To
tracebacks are provided below for more information.

This is the version information I get when I start Python ojn my Fedora
Core 2 computer.

-bash-2.05b$ python
Python 2.3.3 (#1, May 7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2

The question, I think is is it worth the effort to try an upgrade of
Python to 2.3.4 or a nightly build or something to get around the
problem or is it some more general related to rdiff.

When I run the program normally I get this traceback,

-bash-2.05b$ rdiff-backup MyPhotos /mnt/usbdrive/test8
Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 23, in ?
rdiff_backup.Main.Main(sys.argv[1:])
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
250, in Main
take_action(rps)
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
222, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
260, in Backup
backup_init_dirs(rpin, rpout)
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
318, in backup_init_dirs
ErrorLog.open(Time.curtimestr, compress = Globals.compression)
File "/usr/lib/python2.3/site-packages/rdiff_backup/log.py", line
219, in open
cls._log_fileobj = cls._log_inc_rp.open("wb", compress = compress)
File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line
801, in open
if compress: return gzip.GzipFile(self.path, mode)
File "/usr/lib/python2.3/gzip.py", line 94, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: invalid mode: wb
Without knowing the rdiff to well I could guess this is somehow related
to the compressing of files on the fat drive or so so I try to invoke
the program the no-compress option:Traceback (most recent call last):
File "/usr/bin/rdiff-backup", line 23, in ?
rdiff_backup.Main.Main(sys.argv[1:])
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
250, in Main
take_action(rps)
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
222, in take_action
elif action == "backup": Backup(rps[0], rps[1])
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
260, in Backup
backup_init_dirs(rpin, rpout)
File "/usr/lib/python2.3/site-packages/rdiff_backup/Main.py", line
318, in backup_init_dirs
ErrorLog.open(Time.curtimestr, compress = Globals.compression)
File "/usr/lib/python2.3/site-packages/rdiff_backup/log.py", line
219, in open
cls._log_fileobj = cls._log_inc_rp.open("wb", compress = compress)
File "/usr/lib/python2.3/site-packages/rdiff_backup/rpath.py", line
801, in open
if compress: return gzip.GzipFile(self.path, mode)
File "/usr/lib/python2.3/gzip.py", line 94, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: invalid mode: wb
This traceback is a little bit different but the error is still the same
so maybe I was way of in my last guess. Anyone know if this is a known
bug or have a workaround? I need to use fat32 on the drive because I
need to be able to acces it from Windows also.

Tim
Jul 18 '05 #1
3 2905
Tim Gahnstrom wrote:
rdiff-backup is aperently written in Python and when I run it in a
special way I get some funy Python errors. Does anyone know if linux .... File "/usr/lib/python2.3/gzip.py", line 94, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: invalid mode: wb


That line "should" execute, AFAICS. Try this, after changing the
directory to the drive that is failing:

-bash-2.05b$ python
Python 2.3.3 (#1, May 7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
import gzip
gzip.GzipFile('test.file', 'w')


If it reports the same error, then the problem is just in Python
or your USB (or FAT32) drive.

If it doesn't report the same error, it seems likely that rdiff-backup
has substituted the builtin open() function with its own, for reasons
unknown... At least, that's the only thought that occurs to me.

-Peter
Jul 18 '05 #2
Peter Hansen wrote:
Tim Gahnstrom wrote:
rdiff-backup is aperently written in Python and when I run it in a
special way I get some funy Python errors. Does anyone know if linux
File "/usr/lib/python2.3/gzip.py", line 94, in __init__
fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
IOError: invalid mode: wb

That line "should" execute, AFAICS. Try this, after changing the
directory to the drive that is failing:

-bash-2.05b$ python
Python 2.3.3 (#1, May 7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 >>> import gzip
>>> gzip.GzipFile('test.file', 'w')
If it reports the same error, then the problem is just in Python
or your USB (or FAT32) drive.

If it doesn't report the same error, it seems likely that rdiff-backup
has substituted the builtin open() function with its own, for reasons
unknown... At least, that's the only thought that occurs to me.

import gzip
gzip.GzipFile('test.file', 'w') <gzip open file 'test.file', mode 'wb' at 0x5505b1e0 0x5506088c>


Hmm, that seemed to work like a charm so off to look for an other source
of the error.

thanks

Tim
Jul 18 '05 #3
Tim Gahnstrom wrote:
Does anyone know if linux
python have some issues with working with fat32 or usb drives?


Since I also use Fedora Core 2 and usb drives, id like to point out that
I didnt had any troubles with my USB drive, altho its on FAT16 (64 mb of
disk space :) )

As far as I know, mounting usb drives (in Fedora) is doable by root only
unless you hack your way out, so trying to open() it with write
attribute would fail if you're not root.

I would make sure the /mnt/usbdrive doesnt belong to root first (chown it).

--
Eric Belanger
(E-mail in the header is obviously fake (spam-proof),
but guessable.)
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: English Teacher | last post by:
Can someone suggest a good book for Python/Linux development? Thanks.
3
by: bruce | last post by:
hi... i'm running rh8.0 with gnome.. i'm not sure of the version (it's whatever rh shipped). i've recently updated (or tried to update) python to the latest version. when i try to run the...
6
by: Bill Mill | last post by:
On my laptop, I have an NTFS partition for NT, a FAT partition for data as a dmz which both linux and NT can access, and an ext3 partition for linux. However, I've experienced some weirdness on the...
12
by: jeremyvoros | last post by:
So, I've written my first GUI app in python. I've turned it into a binary .exe and .app that runs on Windows and Mac respectively, but on my Linux box, where I wrote the thing, I still have to...
10
by: azrael | last post by:
Hy guys last night i was lying in my bed and thinking about something. is there any linux distro that is primary oriented to python. you know what i mean. no need for php, java, or something...
3
by: cdd | last post by:
Hi, I have a perl script that is running in windows environment. This is calling python BodyTextExtractor. My problem is: I have to move the script to run on linux and I have to change the...
2
by: Anthony Perkins | last post by:
Hi everyone, What is the best GNU/Linux distribution (or the most preferred) for developing Python applications? Ideally I would like one with both Python *and* IDLE included on the install...
3
by: david | last post by:
You learn something new every day: On my ubuntu, update-manager is supposed to use the python2.5 installed on /usr/bin. Well, I had subsequently installed a whole bunch of stuff in /usr/local...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.