Skip to content

Unicode characters in podcast information can cause OPML export to fail #215

@Keeper-of-the-Keys

Description

@Keeper-of-the-Keys

Discovered today with https://podcast.thelinuxexp.com/@tlenewspodcast

He uses \u2019 for ' in the description.

Caused the following error:

WARNING:gpodder.util:Exception while atomic-saving file: 'ascii' codec can't encode character '\u2019' in position 2086: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/share/harbour-org.gpodder.sailfish/gpodder/util.py", line 817, in update_file_safely
    yield tmp_filename
  File "/usr/share/harbour-org.gpodder.sailfish/gpodder/opml.py", line 202, in write
    fp.write(doc.toprettyxml(indent='  ', newl=os.linesep))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 2086: ordinal not in range(128)
ERROR:gpodder.opml:Could not open file for writing: /home/defaultuser/Documents/test.opml
Traceback (most recent call last):
  File "/usr/share/harbour-org.gpodder.sailfish/gpodder/opml.py", line 202, in write
    fp.write(doc.toprettyxml(indent='  ', newl=os.linesep))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 2086: ordinal not in range(128)

Solution is probably to move to utf-8 instead of ascii, not sure if this is an issue in gpodder or the libraries being used, will investigate more.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions