[GH-ISSUE #20] getopt Python error on OS X 10.7.5 #17

Closed
opened 2026-02-25 20:32:17 +03:00 by kerem · 3 comments
Owner

Originally created by @schmunk42 on GitHub (Oct 10, 2012).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/20

When I try run run asciiio I get a Python error:

$ asciiio
/usr/local/bin/asciiio:395: Warning: 'as' will become a reserved keyword in Python 2.6
  File "/usr/local/bin/asciiio", line 395
    except getopt.error as msg:
                     ^
SyntaxError: invalid syntax

$ python -V
Python 2.5.6

Any ideas?

Originally created by @schmunk42 on GitHub (Oct 10, 2012). Original GitHub issue: https://github.com/asciinema/asciinema/issues/20 When I try run run asciiio I get a Python error: ``` $ asciiio /usr/local/bin/asciiio:395: Warning: 'as' will become a reserved keyword in Python 2.6 File "/usr/local/bin/asciiio", line 395 except getopt.error as msg: ^ SyntaxError: invalid syntax $ python -V Python 2.5.6 ``` Any ideas?
kerem closed this issue 2026-02-25 20:32:17 +03:00
Author
Owner

@ku1ik commented on GitHub (Oct 10, 2012):

Well, yes, that's because syntax for catching exceptions changed from python 2.5 to python 2.6. The recommended way for 2.6+ is to use this syntax with "as". For now just try changing this line to:

except getopt.error, msg:

I'll think how to make it work on all "popular" python versions.

<!-- gh-comment-id:9316353 --> @ku1ik commented on GitHub (Oct 10, 2012): Well, yes, that's because syntax for catching exceptions changed from python 2.5 to python 2.6. The recommended way for 2.6+ is to use this syntax with "as". For now just try changing this line to: ``` except getopt.error, msg: ``` I'll think how to make it work on all "popular" python versions.
Author
Owner

@schmunk42 commented on GitHub (Oct 11, 2012):

I switched my python interpreter to 2.6 (got the one from macports)

port select --set python python26

Would it be an option to choose from an interpreter with an option when running asciiio?
Sorry if it's a dumb question, but I don't know much about python - Issue is resolved for me.

btw: Where does ascii.io store files locally? Can I review them before uploading?

<!-- gh-comment-id:9331007 --> @schmunk42 commented on GitHub (Oct 11, 2012): I switched my python interpreter to 2.6 (got the one from macports) ``` port select --set python python26 ``` Would it be an option to choose from an interpreter with an option when running asciiio? Sorry if it's a dumb question, but I don't know much about python - Issue is resolved for me. btw: Where does ascii.io store files locally? Can I review them before uploading?
Author
Owner

@ku1ik commented on GitHub (Oct 11, 2012):

Check out #21 - I described my proposal for reviewing there.

<!-- gh-comment-id:9354715 --> @ku1ik commented on GitHub (Oct 11, 2012): Check out #21 - I described my proposal for reviewing there.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#17
No description provided.