Skip to content

podgen fails to write (UTF-8) encoded feed to file #65

@ndkv

Description

@ndkv

When trying to write an UTF-8 encoded feed to file I get a

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 249: ordinal not in range(128)

generated by fd.write(rss) on line 690 in podcast.py.

A solution is to use the open function from the codecs module and specify the encoding explicitly like so

with open(filename, "w", encoding=encoding) as fd:
    fd.write(rss)

Although this fixes the problem I feel that I'm "holding podgen wrong" and am mishandling my unicode strings somewhere else... any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions