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

Problems with extended characters #5

Open
casperghst42 opened this issue Jun 7, 2020 · 0 comments
Open

Problems with extended characters #5

casperghst42 opened this issue Jun 7, 2020 · 0 comments

Comments

@casperghst42
Copy link

Hi,

OS: CentOS 7
Python 3.6

I have a fair number of song/albums/artists which contains extended characters and they cause this:

INFO:root:Loading XML file: '/mnt/music/musichighres/iTunes/iTunes Music Library.xml'
INFO:root:Connecting to MySQL
INFO:root:Clearing database
INFO:root:Making tracks csv
0%| | 12/16072 [00:00<00:01, 12545.28it/s]
Traceback (most recent call last):
File "./itdbloader.py", line 359, in
main()
File "./itdbloader.py", line 40, in wrapped_f
reply = func(*args, **kwargs)
File "./itdbloader.py", line 354, in main
load_itdb(config)
File "./itdbloader.py", line 96, in load_itdb
DbLoader(config, itunes)
File "./itdbloader.py", line 130, in init
self.load_tracks()
File "./itdbloader.py", line 40, in wrapped_f
reply = func(*args, **kwargs)
File "./itdbloader.py", line 169, in load_tracks
writer.writerow(row)
UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 40: ordinal not in range(128)
INFO:root:DbLoader: Closing db

Could you add a decode to the writer.writerow so that it does not crash?

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

1 participant