← All tasks
pythonscrapinghub/dateparser #978Not a task: already works

open('docs/introduction.rst').read()) and UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 10312: character maps to <undefined>

envgap__scrapinghub__dateparser-978

01 / FAILURE SIGNATURE

As reported upstream

UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 10312: character
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
ff439d1c5f87ef997951e66c31861720726faffb
Manifest
setup.py
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

scrapinghub/dateparser #978 · read the original issue
When I try to install a package from GitHub, it gives me an error:



```

ERROR: Command errored out with exit status 1:

     command: 'D:\apps\Anaconda3\envs\autospider\python.exe' -c 'import sys, setuptools, tok

enize; sys.argv[0] = '"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-mvfy06ye\\se

tup.py'"'"'; __file__='"'"'C:\\Users\\AppData\\Local\\Temp\\pip-req-build-mvfy06ye\\s

etup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'

\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info -

-egg-base 'C:\Users\barto\AppData\Local\Temp\pip-pip-egg-info-i5jufi9v'

         cwd: C:\Users\barto\AppData\Local\Temp\pip-req-build-mvfy06ye\

    Complete output (7 lines):

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "C:\Users\AppData\Local\Temp\pip-req-build-mvfy06ye\setup.py", line 6, in <

module>

        introduction = re.sub(r':members:.+|..\sautomodule::.+|:class:|:func:|:ref:', '', op

en('docs/introduction.rst').read())

      File "\apps\Anaconda3\envs\lib\encodings\cp1250.py", line 23, in decode

        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

    UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 10312: character

maps to <undefined>

```



The problem is with introduction.rst file. Changing `open('docs/introduction.rst').read())` in my fork repo into `open('docs/introduction.rst', encoding='utf-8').read())` in setup.py solved problem.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]