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

parse_package_xml.py: Always write output file as UTF-8 for python3. #828

Merged
merged 1 commit into from Sep 26, 2016

Conversation

de-vri-es
Copy link
Contributor

In python3, reading or writing text files by use a default encoding depending on your locale. That means that handling of package.xml file containing UTF-8 without a UTF-8 locale doesn't work. See below for an example error.

This PR makes sure UTF-8 is used as encoding with python3 regardless of your locale. Note that this is a essentially the same issue as fixed in ros-infrastructure/catkin_pkg#143.

Traceback (most recent call last):
  File "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py", line 107, in <module>
    main()
  File "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py", line 103, in main
    ofile.write('\n'.join(lines))
UnicodeEncodeError: 'ascii' codec can't encode character '\u0160' in position 107: ordinal not in range(128)

@dirk-thomas
Copy link
Member

Thanks.

@dirk-thomas dirk-thomas merged commit 1c2ad7c into ros:kinetic-devel Sep 26, 2016
@de-vri-es de-vri-es deleted the python3 branch January 28, 2018 14:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants