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

Charmap error when writing Unicode characters #19

Open
YuyQuan opened this issue May 13, 2019 · 3 comments
Open

Charmap error when writing Unicode characters #19

YuyQuan opened this issue May 13, 2019 · 3 comments
Assignees

Comments

@YuyQuan
Copy link

YuyQuan commented May 13, 2019

Some of the songs on my lastfm account have unicode (emojis 😋) in their track elements (soundcloud 🔥) that kept me from writing out to a file.

with open(outfile, 'a') as outfileobj:

Might be related to #14. Adding
with open(outfile, 'a', encoding='utf-8') as outfileobj:
Fixed my issue.

@Coul33t
Copy link
Collaborator

Coul33t commented Jul 4, 2019

Hi,
Sorry for the HUGE delay. Could you provide me with your username so I can try to reproduce the bug and test the fix you proposed?
Cheers

@Coul33t Coul33t self-assigned this Jul 4, 2019
@gits68
Copy link

gits68 commented Dec 17, 2020

at line 214 in latsexport.py, change:

with open(outfile, 'a') as outfileobj:
to:

with open(outfile, 'a', encoding="utf-8") as outfileobj:
also, at line 48 in file libreimport.py, change :

for line in file(data):
to:

file = open(data, 'r', encoding='utf-8', errors='replace')
for line in file.readlines():

@gits68
Copy link

gits68 commented Dec 17, 2020

not a bug, but usual, in libreimport.py, could you change:

print("%d: Adding to post %s playing %s" % (n, artist, track))
to

print("%d: Adding to post '%s' playing '%s' from album '%s'" % (n, artist, track, album))

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

No branches or pull requests

3 participants