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

Issue when running init a new parser #47

Open
mrkids opened this issue Aug 3, 2018 · 2 comments
Open

Issue when running init a new parser #47

mrkids opened this issue Aug 3, 2018 · 2 comments

Comments

@mrkids
Copy link

mrkids commented Aug 3, 2018

I follow the document and have the following error? Could you help?

I have ensure my windows terminal is running in UTF-8 already:
D:\playground\testParser>python
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import sys
sys.getdefaultencoding()
'utf-8'

D:\playground\testParser>parserator init testParser
Initializing directories for testParser <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>

  • testParser <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
  • raw <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
  • training <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
  • tests <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>

Generating init.py <_io.TextIOWrapper name='' mode='w' encoding='utf-8'>
Traceback (most recent call last):
File "d:\andre\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "d:\andre\python\python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\aNDrE\Python\Python36\Scripts\parserator.exe_main
.py", line 9, in
File "d:\andre\python\python36\lib\site-packages\parserator\main.py", line 70, in dispatch
args.func(args)
File "d:\andre\python\python36\lib\site-packages\parserator\main.py", line 118, in init
f.write(parser_template.init_template())
File "d:\andre\python\python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u3145' in position 252: character maps to

@deanbrigham
Copy link

I had the same error, the issue is with the little pokemon (?) character holding the signs in parser_template.py

Once I deleted those lines from the file everything seemed to initialize as expected.

@elbaulp
Copy link

elbaulp commented May 28, 2019

Same here! Using from Windows 10.

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