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

Encoding not declared correctly in agent.py #191

Closed
aph3rson opened this issue Feb 25, 2019 · 3 comments
Closed

Encoding not declared correctly in agent.py #191

aph3rson opened this issue Feb 25, 2019 · 3 comments

Comments

@aph3rson
Copy link
Contributor

When calling _get_agent_source(), the compiled agent is opened with open(). However, the encoding isn't declared in this call properly - therefore, it will use the operating system default to open the file. On some systems, this will likely default to utf-8 or similar - however, Windows systems will still open files as cp1252 (see this StackOverflow thread). The agent.js file appears to contain some characters, such as 0x81 which are invalid in cp1252 (as to why, I'm unsure).

Reformatting agent.js in ANSI seems to fix this issue - however, I think the easier option would be to add encoding='utf-8 to the open() call, as this is the standard method of doing so.

@aph3rson
Copy link
Contributor Author

I can file a PR, if that's necessary.

@leonjza
Copy link
Member

leonjza commented Feb 25, 2019

Thanks for the debugging work on this! Feel free to do a PR if you have time, otherwise, I should be able to get to this later tonight and push a new release. 👍

@aph3rson
Copy link
Contributor Author

#192 will fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants