remarshal-project / remarshal

Convert between CBOR, JSON, MessagePack, TOML, and YAML

Home Page:https://pypi.org/project/remarshal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileNotFound error when using python 2.7

sitaktif opened this issue · comments

The README mentions that marshall is compatible with python 2.7 but running it with python 2.7.14 fails with:

$ python remarshal.py
usage: remarshal.py [-h] [-i INPUT] [-o OUTPUT] -if {json,toml,yaml} -of
                    {json,toml,yaml} [--indent-json] [--yaml-style {,',",|,>}]
                    [--wrap WRAP] [--unwrap UNWRAP] [-v]
                    [inputfile]
remarshal.py: error: argument -if/--input-format is required
Traceback (most recent call last):
  File "remarshal.py", line 209, in <module>
    main()
  File "remarshal.py", line 202, in main
    except (FileNotFoundError, NotADirectoryError, PermissionError,
NameError: global name 'FileNotFoundError' is not defined

Changing the references to these python 3 exceptions into IOError (using e.errno to check the type of IO error) seems to fix the issue.

Thanks for the report! Please try the latest commit and tell me if it works for you.

Works like a charm, thanks!

Would you consider making this new version a release on Github?

Works like a charm, thanks!

You're welcome!

Would you consider making this new version a release on Github?

Done.