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

username requires quotes #4

Open
agt24 opened this issue May 2, 2018 · 1 comment
Open

username requires quotes #4

agt24 opened this issue May 2, 2018 · 1 comment

Comments

@agt24
Copy link

agt24 commented May 2, 2018

I needed to put my username in single quotes in order to get get_token_example.py to work (see below). Not sure if there's something unique to my environment, but it might be worth including a note in the README.

`
(awscli) [adamt@felix python]$ python get_token_example.py
Enter your NIMH Data Archives username:adamt
Traceback (most recent call last):
File "get_token_example.py", line 6, in
username = input('Enter your NIMH Data Archives username:')
File "", line 1, in
NameError: name 'adamt' is not defined
(awscli) [adamt@felix python]$

(awscli) [adamt@felix python]$ python get_token_example.py
Enter your NIMH Data Archives username:'adamt'
Enter your NIMH Data Archives password:
aws_access_key_id=XXX
aws_secret_access_key=XXX
security_token=XXX
expiration=2018-05-03T04:04:48-04:00

(awscli) [adamt@felix python]$
`

@devjason
Copy link
Contributor

devjason commented May 4, 2018

Thanks for the feedback! Python is attempting to automatically eval what is read here which is causing the NameError, the current example script is mixing Python 3 and 2 concepts (raw_input from 2 was renamed to input in 3 in PEP 3111).

In Python 2 environments you can replace input with raw_input to prevent this problem and avoid having to quote your username.

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

2 participants