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

init.py: make sure files read with utf-8 encoding #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

init.py: make sure files read with utf-8 encoding #3

wants to merge 1 commit into from

Conversation

chinmaykunkikar
Copy link

  1. The encodings of various files and Command Prompt of Windows vary heavily. By passing 'encoding' parameter we make sure they are read and processed in UTF-8.

The following is the stack trace when do_transcribe is called:
Traceback (most recent call last):
File "init.py", line 72, in do_transcribe
toTranscribe = inFile.read()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 2: character maps to

  1. Tweak - When setInPath is called, make the prompt look as -
    'setInPath > '

1. The encodings of various files and Command Prompt of Windows vary heavily. By passing 'encoding' parameter we make sure they are read and processed in UTF-8.

The following is the stack trace when do_transcribe is called:
Traceback (most recent call last):
  File "init.py", line 72, in do_transcribe
    toTranscribe = inFile.read()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1776.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 2: character maps to <undefined>

2. Tweak - When setInPath is called, make the prompt look as -
                        'setInPath > '
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

Successfully merging this pull request may close these issues.

1 participant