ericmckean / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

python: shutil.copy does not work with /tmp #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Latest python, d7d27e9368a8a2cd6ba5f42fac4561ea8357b829:

>>> import shutil
>>> shutil.copy('/mnt/http/python.nmf', '/tmp/python.nmf')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/lib/python2.7/shutil.py", line 120, in copy
    copymode(src, dst)
  File "/lib/python2.7/shutil.py", line 91, in copymode
    os.chmod(dst, mode)
OSError: [Errno 22] Invalid argument: '/tmp/python.nmf'

This does not happen with the python in devenv that's available in Chrome Web 
Store.

Original issue reported on code.google.com by elijahta...@chromium.org on 22 Oct 2014 at 10:51

GoogleCodeExporter commented 9 years ago
shutil.copyfile is a workaround which doesn't copy mode and other metadata

Original comment by elijahta...@chromium.org on 22 Oct 2014 at 11:07

GoogleCodeExporter commented 9 years ago

Original comment by sbc@google.com on 23 Oct 2014 at 12:03

GoogleCodeExporter commented 9 years ago
This is because /tmp is an html5 filesystem and these do not support mode bits. 
 Perhaps we should just return success anyway.

Original comment by sbc@google.com on 23 Oct 2014 at 7:15

GoogleCodeExporter commented 9 years ago
Fix is here:
https://codereview.chromium.org/674953003/

Original comment by sbc@chromium.org on 24 Oct 2014 at 10:31

GoogleCodeExporter commented 9 years ago

Original comment by sbc@google.com on 28 Oct 2014 at 9:57