6

I have a relatively straight forward snippet which throws an error:

import shutil
abspath_to_source_file = '/media/moose/VFF1147/MAP_DATA/BACK/B0000040.DFT'
target_dir = '/media/moose/9C33-6BBD/PRIVATE/PANA_GRP/PAVC/LUMIX/MAP_DATA/BACK'
shutil.copy2(abspath_to_source_file, target_dir)

which gives

Traceback (most recent call last):
  File "/usr/local/bin/lumixmaptool", line 4, in <module>
    __import__('pkg_resources').run_script('lumixmaptool==1.0.15', 'lumixmaptool')
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 735, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1652, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/lumixmaptool-1.0.15-py2.7.egg/EGG-INFO/scripts/lumixmaptool", line 56, in <module>
    main(args)
  File "/usr/local/lib/python2.7/dist-packages/lumixmaptool-1.0.15-py2.7.egg/EGG-INFO/scripts/lumixmaptool", line 49, in main
    copy.main(args.mapdata, args.path_to_sdcard, args.regions)
  File "/usr/local/lib/python2.7/dist-packages/lumixmaptool-1.0.15-py2.7.egg/lumixmaptool/copy.py", line 177, in main
    copy_maps(mapdata, path_to_sdcard, regions)
  File "/usr/local/lib/python2.7/dist-packages/lumixmaptool-1.0.15-py2.7.egg/lumixmaptool/copy.py", line 148, in copy_maps
    shutil.copy2(abspath_to_source_file, target_dir)
  File "/usr/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 100, in copystat
    os.chmod(dst, mode)
OSError: [Errno 38] Function not implemented: '/media/moose/9C33-6BBD/PRIVATE/PANA_GRP/PAVC/LUMIX/MAP_DATA/BACK/B0000040.DFT'

Is the reason eventually be the file system? (If I remember it correctly, I formatted it as exFAT, but I only get 'fuseblk' when I try df -T or mount. sudo file -Ls /dev/sdb1 gives DOS/MBR boot sector)

1st question: What is the problem?

2nd question: How can I fix it?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
  • Is `/dev/shm` mounted? That seems to be the prevailing issue in other cases where that error is thrown. – Martijn Pieters Aug 16 '15 at 17:14
  • @MartijnPieters `/dev/shm`? If you mean `/dev/sdb1` (the sd card), then yes, it is mounted. Otherwise I have no idea what you're talking about and what I should do. – Martin Thoma Aug 16 '15 at 17:30
  • No, I meant `/dev/shm`, the shared memory device used for temporary directories. All references to the error are due to that mount having issues. I'm far from sure why it would apply to your case here. – Martijn Pieters Aug 16 '15 at 17:36
  • @MartijnPieters `df -h` gives `none 1,8G 49M 1,8G 3% /run/shm` - does that mean it is mounted correctly? – Martin Thoma Aug 16 '15 at 17:40
  • 1
    `os.system('cp %s %s' % (abspath_to_source_file, target_dir))` works... – Martin Thoma Aug 16 '15 at 17:49
  • 1
    It's not the file copy that fails, it is copying the attributes. `os.chmod()` sets the file access control flags on the target to be the same as the source. – Martijn Pieters Aug 16 '15 at 17:51
  • Thanks @MartinThoma I have the same issue and `os.system` solved it. – Hasan Salim Kanmaz Sep 08 '20 at 10:09

0 Answers0