multicast / google-docs-fs

Automatically exported from code.google.com/p/google-docs-fs
GNU General Public License v2.0
0 stars 0 forks source link

cp -r not working under python 2.6.2 + fuse-python 0.2.1 #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Install google-docs-fs using the above mentioned python env.
2. Do cp -r paper1 ${HOME}/my_local_dir, for example, you get this
3. cp: cannot open `paper1/paper1test.doc' for reading: Invalid argument
4. Normal cp (without -r) is operational.
5. Same test with python 2.5.1 + fuse-python 0.2 works without any prob.

What is the expected output? What do you see instead?

cp -r, recursive copy of dirs from google docs to local dirs.

What version of the product are you using? On what operating system?

google-docs-fs pulled from the SVN repo, gdata is 2.0.9 (newest) for both
testing platforms. The problematic env is python 2.6.2 + fuse-python 0.2.1,
the normal env is python 2.5.1 + fuse-python 0.2.

Please provide any additional information below.

Should be an easy fix of some sort of path parsing problem.

Original issue reported on code.google.com by mr.xiaof...@gmail.com on 29 Apr 2010 at 11:15

GoogleCodeExporter commented 9 years ago
Oh and when the files failed to get copied recursively, all the dir structures 
are
correctly made into the target dir. It's just the actual files that are 
affected.

Original comment by mr.xiaof...@gmail.com on 29 Apr 2010 at 11:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
unique: 22, opcode: LOOKUP (1), nodeid: 1, insize: 46
LOOKUP /tests
getattr /tests
   NODEID: 2
   unique: 22, success, outsize: 144
unique: 23, opcode: OPENDIR (27), nodeid: 2, insize: 48
   unique: 23, success, outsize: 32
unique: 24, opcode: READDIR (28), nodeid: 2, insize: 80
readdir[0] from 0
HOME:  /farm/home/li14/.google-docs-fs
PATH:  /tests
TMP PATH:  /farm/home/li14/.google-docs-fs/tests
   unique: 24, success, outsize: 112
unique: 25, opcode: READDIR (28), nodeid: 2, insize: 80
   unique: 25, success, outsize: 16
unique: 26, opcode: RELEASEDIR (29), nodeid: 2, insize: 64
   unique: 26, success, outsize: 16
unique: 27, opcode: LOOKUP (1), nodeid: 2, insize: 47
LOOKUP /tests/paper1
getattr /tests/paper1
   NODEID: 3
   unique: 27, success, outsize: 144
unique: 28, opcode: OPENDIR (27), nodeid: 3, insize: 48
   unique: 28, success, outsize: 32
unique: 29, opcode: READDIR (28), nodeid: 3, insize: 80
readdir[0] from 0
HOME:  /farm/home/li14/.google-docs-fs
PATH:  /tests/paper1
TMP PATH:  /farm/home/li14/.google-docs-fs/tests/paper1
   unique: 29, success, outsize: 120
unique: 30, opcode: READDIR (28), nodeid: 3, insize: 80
   unique: 30, success, outsize: 16
unique: 31, opcode: RELEASEDIR (29), nodeid: 3, insize: 64
   unique: 31, success, outsize: 16
unique: 32, opcode: LOOKUP (1), nodeid: 1, insize: 46
LOOKUP /tests
getattr /tests
   NODEID: 2
   unique: 32, success, outsize: 144
unique: 33, opcode: LOOKUP (1), nodeid: 2, insize: 47
LOOKUP /tests/paper1
getattr /tests/paper1
   NODEID: 3
   unique: 33, success, outsize: 144
unique: 34, opcode: LOOKUP (1), nodeid: 3, insize: 55
LOOKUP /tests/paper1/paper1test.doc
getattr /tests/paper1/paper1test.doc
   NODEID: 4
   unique: 34, success, outsize: 144
unique: 35, opcode: OPEN (14), nodeid: 4, insize: 48
open flags: 0x28000 /tests/paper1/paper1test.doc
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/fuse.py", line 361, in __call__
    return apply(self.func, args, kw)
  File "/usr/lib64/python2.6/site-packages/fuse.py", line 775, in wrap
    res = fun(*a, **kw)
  File "/usr/lib/python2.6/site-packages/googledocsfs/gFile.py", line 281, in open
    file = open(tmp_path.encode(self.codec), f)
TypeError: file() argument 2 must be string, not int
   unique: 35, error: -22 (Invalid argument), outsize: 16

------
p.s. Actually this error occurs consistently regardless of python/fuse-python
versions on the server in question (running CentOS). But it is worth looking at,
whether there are ways to solve it, because it just seems a simple string/int
conversion error to me.

Original comment by mr.xiaof...@gmail.com on 29 Apr 2010 at 1:05

GoogleCodeExporter commented 9 years ago
It's me again -- it seems that it is a Python 2.6 issue. 

I somehow managed to worked out a workaround:

1. Open googledocsfs/gFile.py in the inst dir, find line 281
2. Comment out the f = flags line
3. Write f = 'a+' instead
4. Save and reinstall

Now cp -r looks normal under Python 2.6. However, I'm not sure whether the 
intended
file permissions are kept correct (AFAIK Google Docs don't have permission tags 
anyway).

If anyone meets with the same problem, please use the above workaround.

Original comment by mr.xiaof...@gmail.com on 29 Apr 2010 at 2:24

GoogleCodeExporter commented 9 years ago
Thanks. I've added your fix to gFile.py. I'll mark this as fixed.

Cheers,
Scott W

Original comment by d38dm8nw81k1ng@gmail.com on 26 May 2010 at 2:04