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

UnicodeEncodeError #43

Closed
thomas-mc-work opened this issue Oct 10, 2016 · 8 comments
Closed

UnicodeEncodeError #43

thomas-mc-work opened this issue Oct 10, 2016 · 8 comments
Labels
Bug Generic bug: can be used together with more specific labels

Comments

@thomas-mc-work
Copy link
Contributor

thomas-mc-work commented Oct 10, 2016

I got this error after track seven has finished for the cd https://musicbrainz.org/release/8a76dde5-287d-4cb2-88e0-5c7a621c654c:

Traceback (most recent call last):
  File "/usr/local/bin/rip", line 37, in <module>
    sys.exit(main.main(sys.argv[1:]))
  File "/usr/local/lib/python2.7/site-packages/morituri/rip/main.py", line 40, in main
    ret = c.parse(argv)
  File "/usr/local/lib/python2.7/site-packages/morituri/rip/main.py", line 118, in parse
    logcommand.LogCommand.parse(self, argv)
  File "/usr/local/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/local/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/local/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/local/lib/python2.7/site-packages/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/usr/local/lib/python2.7/site-packages/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/usr/local/lib/python2.7/site-packages/morituri/extern/command/command.py", line 363, in parse
    ret = self.do(args)
  File "/usr/local/lib/python2.7/site-packages/morituri/rip/cd.py", line 174, in do
    self.doCommand()
  File "/usr/local/lib/python2.7/site-packages/morituri/rip/cd.py", line 482, in doCommand
    ripIfNotRipped(i + 1)
  File "/usr/local/lib/python2.7/site-packages/morituri/rip/cd.py", line 376, in ripIfNotRipped
    if os.path.exists(path):
  File "/usr/lib/python2.7/genericpath.py", line 18, in exists
    os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 92: ordinal not in range(128)
@JoeLametta
Copy link
Collaborator

Hi, thanks for the bug report.
This one looks like it's a locale issue (maybe your system doesn't use an UTF-8 locale): could run the following command and post its output?

locale

@JoeLametta JoeLametta added the Bug Generic bug: can be used together with more specific labels label Oct 10, 2016
@thomas-mc-work
Copy link
Contributor Author

Output of locale is:

LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

@JoeLametta
Copy link
Collaborator

JoeLametta commented Oct 11, 2016

Output of locale is:
Thanks.

What happens if you try ripping that CD again with whipper running it like this?

PYTHONIOENCODING='utf8' $rip_invocation_here

Obviously first replace $rip_invocation_here with the actual command.

EDIT: If that fails also try this one:

LANGUAGE="en_US.UTF-8" $rip_invocation_here

@thomas-mc-work
Copy link
Contributor Author

thomas-mc-work commented Oct 13, 2016

PYTHONIOENCODING='utf8' $rip_invocation_here

This one made it working.

@JoeLametta
Copy link
Collaborator

This one made it working.

This one needs to be investigated but, right now, please keep using that workaround.

@thomas-mc-work
Copy link
Contributor Author

thomas-mc-work commented Oct 15, 2016

Oh no, I was wrong, the locale info wasn't right. I'm starting the rip command in a script that is being invoked from an udev rule. When i run locale within the script then i get this output:

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

So i need to investigate what environment i've got when getting started by udev.

@thomas-mc-work
Copy link
Contributor Author

So that means whipper is working right, so we can close this. Thank you anyway!

@JoeLametta
Copy link
Collaborator

So that means whipper is working right, so we can close this. Thank you anyway!

You're welcome! Thanks for the extensive feedback: that's a relief...
Anyway, in the future, whipper will be rewritten as a Python 3 project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Generic bug: can be used together with more specific labels
Projects
None yet
Development

No branches or pull requests

2 participants