Forum Archive

Posix Path Fails - Pythonista 3.0

Cethric

In the latest Pythonista 3.0 beta os.path -> posix path fails to expand user and get the absolute path

Traceback (most recent call last):
  File "/private/var/mobile/Containers/Shared/AppGroup/877D6E00-D22C-4407-9A69-C27FA4B9356A/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 491, in exec_py_file
    exec(compile(code, file_path, 'exec'), namespace, namespace)
  File "../site-packages/stash/bin/tar.py", line 133, in <module>
    extract_all(os.path.abspath(args.file),args.files)
  File "/var/containers/Bundle/Application/E004DC52-32AC-4AE8-8BFE-E908097CC26A/Pythonista3.app/Frameworks/PythonistaKit3.framework/pylib/posixpath.py", line 358, in abspath
    if not isabs(path):
  File "/var/containers/Bundle/Application/E004DC52-32AC-4AE8-8BFE-E908097CC26A/Pythonista3.app/Frameworks/PythonistaKit3.framework/pylib/posixpath.py", line 65, in isabs
    return s.startswith(sep)
AttributeError: 'NoneType' object has no attribute 'startswith'
omz

This seems more like a bug in StaSh to me. Somewhere in stash/bin/tar.py, os.path.abspath() is called with an argument of None. From briefly looking at the code, I'm guessing the -f/--file argument wasn't passed to the tar command as it expected.