Skip to content

Unicode issues #215

Closed
Closed
@dnalor

Description

@dnalor
  • It seems the catalog number can be non-ascii, so there was a encoding error in program.py.
    Fix: common/program.py line 370:
                if metadata.catalogNumber:
                    self._stdout.write("Cat no  : %s\n" %
                                       metadata.catalogNumber.encode('utf-8'))
Ripping track 5 of 10: 05 - Gripped by Fear.flac
CRCs match for track 5                    
Peak level: 99.52% 
Rip quality: 100.00%
Traceback (most recent call last):
  File "/home/user/appdata/venv-whipper/bin/whipper", line 11, in <module>
    load_entry_point('whipper==0.5.1', 'console_scripts', 'whipper')()
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/main.py", line 40, in main
    ret = cmd.do()
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/basecommand.py", line 124, in do
    return self.cmd.do()
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/basecommand.py", line 124, in do
    return self.cmd.do()
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/cd.py", line 190, in do
    self.doCommand()
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/cd.py", line 479, in doCommand
    _ripIfNotRipped(i + 1)
  File "/home/user/appdata/venv-whipper/lib/python2.7/site-packages/whipper-0.5.1-py2.7.egg/whipper/command/cd.py", line 375, in _ripIfNotRipped
    if os.path.exists(path):
  File "/home/user/appdata/venv-whipper/lib64/python2.7/genericpath.py", line 26, in exists
    os.stat(path)
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u25b7' in position 69: ordinal not in range(256)

Other examples:
Jean-Michel Jarre - Revolutions / Track 3 / https://musicbrainz.org/release/e2d4719c-34d2-445f-a1f1-c6877b614411
R.E.M. - Green / Track 8 (Character u'\u2010')

Fix: command/cd.py line 362:

            logger.debug('ripIfNotRipped: path %r' % path)
            trackResult.number = number
# convert
            path = unicode( path.encode('latin1','ignore'), 'latin1', 'ignore')

Metadata

Metadata

Assignees

Labels

AcceptedAccepted issue on our roadmapBugGeneric bug: can be used together with more specific labelsNeeded: testsTests are requiredPriority: lowLow prioritySprintableSmall enough to sprint onStretchOptional goal for the current sprint (may not be delivered)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions