Skip to content

UnicodeDecode erroron Windows install via pip #31

@mpibpc-mroose

Description

@mpibpc-mroose

Whe installieng your package on Windows I get:

pip install python-powerdns                  
Collecting python-powerdns
  Using cached python-powerdns-2.1.0.tar.gz (14 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\mroose\AppData\Local\Temp\pip-install-9lebja68\python-powerdns_acda99872ed242afb6c7bfa0fc067fd1\setup.py", line 36, in <module>
          long_description=open(readme_file).read(),
        File "C:\Python39\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 0x9d in position 5076: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This is possibly caused by the statement:

long_description=open(readme_file).read(),

which should maybe changed to:

long_description=open(readme_file, 'r', encoding='UTF-8').read(),

As there are more open statements in setup.py the may get changed, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions