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

已修复: #85

Open
mqqgithub opened this issue Aug 25, 2021 · 1 comment
Open

已修复: #85

mqqgithub opened this issue Aug 25, 2021 · 1 comment

Comments

@mqqgithub
Copy link

已修复:
修改utils.py 中的 json.dumps(map)

json.dumps(map, ensure_ascii=False)

Originally posted by @chenzhang88 in #78 (comment)

@mqqgithub
Copy link
Author

修改在执行报错了
D:>datafaker file D:\ out.txt 10 --meta meta.txt --format json
Exception in thread Thread-2:
Traceback (most recent call last):
File "D:\dev\python\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "D:\dev\python\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "D:\dev\python\lib\site-packages\datafaker\dbs\basedb.py", line 122, in save
self.save_data(lines)
File "D:\dev\python\lib\site-packages\datafaker\dbs\filedb.py", line 24, in save_data
save2file(items, filepath)
File "D:\dev\python\lib\site-packages\datafaker\utils.py", line 26, in save2file
fp.writelines(items)
UnicodeEncodeError: 'gbk' codec can't encode character '\u3dab' in position 41: illegal multibyte sequence

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