Skip to content

Problems with extended characters #5

@casperghst42

Description

@casperghst42

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?

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