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 when running poetry install on Windows 11 #5985

Closed
3 tasks done
brno32 opened this issue Jul 10, 2022 · 3 comments
Closed
3 tasks done

UnicodeDecodeError when running poetry install on Windows 11 #5985

brno32 opened this issue Jul 10, 2022 · 3 comments
Labels
kind/bug Something isn't working as expected

Comments

@brno32
Copy link

brno32 commented Jul 10, 2022

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I'm starting a new project and I get the following error in a fresh virtual environment

Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 11 installs, 0 updates, 0 removals

  • Installing pyparsing (3.0.9)
  • Installing atomicwrites (1.4.1)
  • Installing attrs (21.4.0)
  • Installing colorama (0.4.5)
  • Installing more-itertools (8.13.0)
  • Installing packaging (21.3)
  • Installing pluggy (0.13.1)
  • Installing py (1.11.0)
  • Installing wcwidth (0.2.5)
  • Installing decorator (5.1.1)
  • Installing pytest (5.4.3)

  Stack trace:

  8  ~\.poetry\lib\poetry\_vendor\py3.9\clikit\console_application.py:131 in run
      129│             parsed_args = resolved_command.args
      130│
    → 131│             status_code = command.handle(parsed_args, io)
      132│         except KeyboardInterrupt:
      133│             status_code = 1

  7  ~\.poetry\lib\poetry\_vendor\py3.9\clikit\api\command\command.py:120 in handle
      118│     def handle(self, args, io):  # type: (Args, IO) -> int
      119│         try:
    → 120│             status_code = self._do_handle(args, io)
      121│         except KeyboardInterrupt:
      122│             if io.is_debug():

  6  ~\.poetry\lib\poetry\_vendor\py3.9\clikit\api\command\command.py:171 in _do_handle
      169│         handler_method = self._config.handler_method
      170│
    → 171│         return getattr(handler, handler_method)(args, io, self)
      172│
      173│     def __repr__(self):  # type: () -> str

  5  ~\.poetry\lib\poetry\_vendor\py3.9\cleo\commands\command.py:92 in wrap_handle
       90│         self._command = command
       91│
    →  92│         return self.handle()
       93│
       94│     def handle(self):  # type: () -> Optional[int]

  4  ~\.poetry\lib\poetry\console\commands\install.py:80 in handle
       78│
       79│         try:
    →  80│             builder = EditableBuilder(self.poetry, self._env, self._io)
       81│         except ModuleOrPackageNotFound:
       82│             # This is likely due to the fact that the project is an application

  3  ~\.poetry\lib\poetry\masonry\builders\editable.py:34 in __init__
       32│ class EditableBuilder(Builder):
       33│     def __init__(self, poetry, env, io):
    →  34│         super(EditableBuilder, self).__init__(poetry)
       35│
       36│         self._env = env

  2  ~\.poetry\lib\poetry\_vendor\py3.9\poetry\core\masonry\builders\builder.py:92 in __init__
       90│         )
       91│
    →  92│         self._meta = Metadata.from_package(self._package)
       93│
       94│     @property

  1  ~\.poetry\lib\poetry\_vendor\py3.9\poetry\core\masonry\metadata.py:56 in from_package
      54│         if package.readme:
      55│             with package.readme.open(encoding="utf-8") as f:
    → 56│                 meta.description = f.read()
      57│
      58│         meta.keywords = ",".join(package.keywords)

  UnicodeDecodeError

  'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

  at ~\AppData\Local\Programs\Python\Python39\lib\codecs.py:322 in decode
       318│ 
       319│     def decode(self, input, final=False):
       320│         # decode input (taking the buffer into account)
       321│         data = self.buffer + input
    →  322│         (result, consumed) = self._buffer_decode(data, self.errors, final)
       323│         # keep undecoded input until the next call
       324│         self.buffer = data[consumed:]
       325│         return result
       326│
@brno32 brno32 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 10, 2022
@dimbleby
Copy link
Contributor

per the stack trace, it's obviously trying to read your README.

      55│             with package.readme.open(encoding="utf-8") as f:
    → 56│                 meta.description = f.read()

Is there something unusual in that? Is it not utf-8?

@brno32
Copy link
Author

brno32 commented Jul 10, 2022

Wow lol. This was a default README generated by GitHub, so not sure how something non utf-8 got in there, but removing it did the trick. Thanks

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants