twitter/repo-scaffolding

NameError in add_license_headers script

Closed this issue · 4 comments

I'm hitting a NameError exception when trying to run the add_license_headers script (see below)

Expected behavior

Script adds license headers

Actual behavior

Script fails without adding headers

Steps to reproduce the behavior

[repo-scaffolding (master)]$ python setup.py install
[twemoji-parser (master)]$ add_license_headers ./src
('Path detected :', '\x1b[1m/Users/ndowns/workspace/twemoji-parser/src\x1b[0m')
('Branch detected -', u'\x1b[1mmaster', '\x1b[0m', '\n')
* Please make sure that the source directory is tracked by git.
* Create a new branch before proceeding ahead.
* Make sure you do not have any uncommitted changes in your repository.
It will later enable you to run 'git checkout -- .' and revert all the changes made by this script.
Proceed ahead? (Don't worry, this won't make changes yet) [y/N] y
Traceback (most recent call last):
  File "/usr/local/bin/add_license_headers", line 9, in <module>
    load_entry_point('add-license-headers==0.1', 'console_scripts', 'add_license_headers')()
  File "build/bdist.macosx-10.13-intel/egg/add_license_headers.py", line 518, in entry
  File "build/bdist.macosx-10.13-intel/egg/add_license_headers.py", line 325, in query_yes_no
  File "<string>", line 1, in <module>
NameError: name 'y' is not defined

Mayyyyybe the script prolly needs to be run as python3? I'll leave it to @OrkoHunter to reply.

Bump. Was there any solution for this? I'm seeing the same issue

Hi @n8downs @brayniac! The script requires to be run on Python 3. Can you please let me know if the error persists?

python3 setup.py install
add_license_headers <path>

@OrkoHunter works for me on python3