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

UnicodeDecodeError #75

Open
paranoidi opened this issue Jun 11, 2018 · 0 comments
Open

UnicodeDecodeError #75

paranoidi opened this issue Jun 11, 2018 · 0 comments

Comments

@paranoidi
Copy link

Almost ~40% of subtitles fail to parse because of unicode errors.

Traceback (most recent call last):
  File "/home/username/bin/nocc", line 11, in <module>
    load_entry_point('nocc', 'console_scripts', 'nocc')()
  File "/home/username/projects/nocc/nocc/nocc.py", line 155, in main
    nocc(fn)
  File "/home/username/projects/nocc/nocc/nocc.py", line 47, in nocc
    subs = pysrt.open(filename)
  File "/home/username/.local/venvs/nocc/lib/python3.5/site-packages/pysrt/srtfile.py", line 153, in open
    new_file.read(source_file, error_handling=error_handling)
  File "/home/username/.local/venvs/nocc/lib/python3.5/site-packages/pysrt/srtfile.py", line 180, in read
    self.eol = self._guess_eol(source_file)
  File "/home/username/.local/venvs/nocc/lib/python3.5/site-packages/pysrt/srtfile.py", line 257, in _guess_eol
    first_line = cls._get_first_line(string_iterable)
  File "/home/username/.local/venvs/nocc/lib/python3.5/site-packages/pysrt/srtfile.py", line 269, in _get_first_line
    first_line = next(iter(string_iterable))
  File "/home/username/.local/venvs/nocc/lib/python3.5/codecs.py", line 711, in __next__
    return next(self.reader)
  File "/home/username/.local/venvs/nocc/lib/python3.5/codecs.py", line 642, in __next__
    line = self.readline()
  File "/home/username/.local/venvs/nocc/lib/python3.5/codecs.py", line 555, in readline
    data = self.read(readsize, firstline=True)
  File "/home/username/.local/venvs/nocc/lib/python3.5/codecs.py", line 501, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa3 in position 4: invalid start byte

Please enable "errors=ignore" in open()

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