Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on linux systems where python defaults to python3 #10

Closed
despairblue opened this issue Aug 4, 2014 · 7 comments
Closed

Comments

@despairblue
Copy link

$ touch test
$ trash test
Command failed: Traceback (most recent call last):
  File "./trash-put", line 4, in <module>
    from trashcli.put import main
  File "/home/despairblue/node_modules/trash/vendor/trash-cli/trashcli/put.py", line 255
    except (IOError, OSError), error:
                             ^
SyntaxError: invalid syntax
@sindresorhus
Copy link
Owner

Does changing

#!/usr/bin/env python
to #!/usr/bin/env python2 fix it?

@danielchatfield
Copy link

Should probs change the exception handler to except (IOError, OSError) as error: since that works with python 2 and 3.

Edit: I can now see that it is in a third party lib.

@sindresorhus
Copy link
Owner

@danielchatfield Yeah, but please do open a ticket about Python 3 support on the third party lib ;)

@despairblue
Copy link
Author

@sindresorhus changing it does fix it. But I'm not sure whether this would break it on systems where there is no python2, but python and python3.

Yeah, it would be best to fix it in trash-cli directly. (andreafrancia/trash-cli#42)

@danielchatfield
Copy link

Currently python 2 is a requirement for that third party lib.

On Monday, 4 August 2014, Danny Arnold notifications@github.com wrote:

@sindresorhus https://github.com/sindresorhus changing it does fix it.
But I'm not sure whether this would break it on systems where there is no
python2, but python and python3.

Yeah, it would be best to fix it in trash-cli directly.

Reply to this email directly or view it on GitHub
#10 (comment).

For contact info visit: www.danielchatfield.com

@sindresorhus
Copy link
Owner

@despairblue According to some PEP python2 is a requirement. But I guess I could somehow check.

@despairblue
Copy link
Author

@sindresorhus just tested it on an ubuntu 14.04 server. /usr/bin/env python2 works there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants