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

TypeError: 'write() argument 1 must be unicode, not str' #49

Open
joeribelis opened this issue Dec 30, 2020 · 1 comment
Open

TypeError: 'write() argument 1 must be unicode, not str' #49

joeribelis opened this issue Dec 30, 2020 · 1 comment

Comments

@joeribelis
Copy link

python 2.7

:~/parser$ parserator init test_123

Initializing directories for test_123 <open file '', mode 'w' at 0x7f98203211e0>

  • test_123 <open file '', mode 'w' at 0x7f98203211e0>
  • raw <open file '', mode 'w' at 0x7f98203211e0>
  • training <open file '', mode 'w' at 0x7f98203211e0>
  • tests <open file '', mode 'w' at 0x7f98203211e0>

Generating init.py <open file '', mode 'w' at 0x7f98203211e0>
Traceback (most recent call last):
File "/home/joerib/.local/bin/parserator", line 8, in
sys.exit(dispatch())
File "/home/joerib/.local/lib/python2.7/site-packages/parserator/main.py", line 70, in dispatch
args.func(args)
File "/home/joerib/.local/lib/python2.7/site-packages/parserator/main.py", line 118, in init
f.write(parser_template.init_template())
TypeError: write() argument 1 must be unicode, not str

@joeribelis
Copy link
Author

replacing "w" with "wb"
https://stackoverflow.com/questions/45520097/wb-vs-w-in-unix-for-python

seems to fix it

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

1 participant