473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2934
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.