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

[BUG] 构建时ip_info.py 中发生错误`UnicodeEncodeError: 'ascii' codec can't encode characters in position #6384

Closed
3 tasks done
asdfsx opened this issue May 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@asdfsx
Copy link
Contributor

asdfsx commented May 10, 2024

Search before asking

  • I had searched in the issues and found no similar feature requirement.

DeepFlow Component

Server

What you expected to happen

我在centos7.9的容器中构建server端时ip_info.py报错

go generate ./...
Traceback (most recent call last):
  File "ip_info.py", line 101, in <module>
    gen_code(sys.argv[1])
  File "ip_info.py", line 85, in gen_code
    wf.write('var COUNTRY_NAMES = [...]string{%s}\n' % ', '.join(['"%s"' % name for name in country_encoder.items]))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 33-34: ordinal not in range(128)
libs/geo/generator.go:19: running "python3": exit status 1
make: *** [libs/hmap/idmap/ubig_id_map.go] Error 1 

解决办法是在打开文件是指定字符集为utf-8

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@asdfsx asdfsx added the bug Something isn't working label May 10, 2024
@1473371932
Copy link
Contributor

目前使用的是我们提供的build镜像,还是通过手动构做的呀?

@asdfsx
Copy link
Contributor Author

asdfsx commented May 13, 2024

目前使用的是我们提供的build镜像,还是通过手动构做的呀?

我是在agent构建镜像里build了一下server~。应该是构建环境导致的问题。
不过既然这里出了问题,我觉得还是指定一下字符集比较好。

@sharang
Copy link
Member

sharang commented May 14, 2024

@asdfsx thanks for your contribution.

@sharang sharang closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants