Skip to content

unsupported operand type(s) for /: 'str' and 'str' #8226

@femtotrader

Description

@femtotrader
  • Poetry version: Poetry (version 1.5.1)
  • Python version:

Returns this odd message !

poetry debug info


Poetry

unsupported operand type(s) for /: 'str' and 'str'
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Hello,

I don't understand why I'm gettring this error message

unsupported operand type(s) for /: 'str' and 'str'

Here is stack trace

> poetry build -vvv

  Stack trace:

  13  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:327 in run
       325│
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  12  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\application.py:190 in _run
       188│         self._load_plugins(io)
       189│
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│

  11  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│

  10  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:473 in _run_command
       471│
       472│         if error is not None:
     → 473│             raise error
       474│
       475│         return terminate_event.exit_code

   9  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:454 in _run_command
       452│
       453│         try:
     → 454│             self._event_dispatcher.dispatch(command_event, COMMAND)
       455│
       456│             if command_event.command_should_run():

   8  ~\AppData\Roaming\Python\Python310\site-packages\cleo\events\event_dispatcher.py:26 in dispatch
        24│
        25│         if listeners:
     →  26│             self._do_dispatch(listeners, event_name, event)
        27│
        28│         return event

   7  ~\AppData\Roaming\Python\Python310\site-packages\cleo\events\event_dispatcher.py:89 in _do_dispatch
        87│                 break
        88│
     →  89│             listener(event, event_name, self)
        90│
        91│     def _sort_listeners(self, event_name: str) -> None:

   6  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\application.py:296 in configure_env
       294│
       295│         io = event.io
     → 296│         poetry = command.poetry
       297│
       298│         env_manager = EnvManager(poetry, io=io)

   5  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\commands\command.py:23 in poetry
        21│     def poetry(self) -> Poetry:
        22│         if self._poetry is None:
     →  23│             return self.get_application().poetry
        24│
        25│         return self._poetry

   4  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\application.py:129 in poetry
       127│             project_path = self._io.input.option("directory")
       128│
     → 129│         self._poetry = Factory().create_poetry(
       130│             cwd=project_path,
       131│             io=self._io,

   3  ~\AppData\Roaming\Python\Python310\site-packages\poetry\factory.py:58 in create_poetry
        56│             io = NullIO()
        57│
     →  58│         base_poetry = super().create_poetry(cwd=cwd, with_groups=with_groups)
        59│
        60│         poetry_file = base_poetry.pyproject_path

   2  C:\tools\Anaconda3\lib\site-packages\poetry\core\factory.py:51 in create_poetry
        49│
        50│         # Checking validity
     →  51│         check_result = self.validate(local_config)
        52│         if check_result["errors"]:
        53│             message = ""

   1  ~\AppData\Roaming\Python\Python310\site-packages\poetry\factory.py:359 in validate
       357│         results = super().validate(config, strict)
       358│
     → 359│         results["errors"].extend(validate_object(config))
       360│
       361│         # A project should not depend on itself.

  TypeError

  unsupported operand type(s) for /: 'str' and 'str'

  at ~\AppData\Roaming\Python\Python310\site-packages\poetry\json\__init__.py:41 in validate_object
       37│
       38│         errors.append(message)
       39│
       40│     core_schema = json.loads(
    →  41│         (CORE_SCHEMA_DIR / "poetry-schema.json").read_text(encoding="utf-8")
       42│     )
       43│
       44│     properties = {*schema["properties"].keys(), *core_schema["properties"].keys()}
       45│     additional_properties = set(obj.keys()) - properties

Looks similar to #508

and here is stack trace for poetry debug info -vvv

> poetry debug info -vvv

Poetry

  Stack trace:

  13  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:327 in run
       325│
       326│             try:
     → 327│                 exit_code = self._run(io)
       328│             except BrokenPipeError:
       329│                 # If we are piped to another process, it may close early and send a

  12  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\application.py:190 in _run
       188│         self._load_plugins(io)
       189│
     → 190│         exit_code: int = super()._run(io)
       191│         return exit_code
       192│

  11  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:431 in _run
       429│             io.input.interactive(interactive)
       430│
     → 431│         exit_code = self._run_command(command, io)
       432│         self._running_command = None
       433│

  10  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:473 in _run_command
       471│
       472│         if error is not None:
     → 473│             raise error
       474│
       475│         return terminate_event.exit_code

   9  ~\AppData\Roaming\Python\Python310\site-packages\cleo\application.py:457 in _run_command
       455│
       456│             if command_event.command_should_run():
     → 457│                 exit_code = command.run(io)
       458│             else:
       459│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

   8  ~\AppData\Roaming\Python\Python310\site-packages\cleo\commands\base_command.py:119 in run
       117│         io.input.validate()
       118│
     → 119│         status_code = self.execute(io)
       120│
       121│         if status_code is None:

        63│         except KeyboardInterrupt:
        64│             return 1

   6  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\commands\debug\info.py:20 in handle
        18│             "\n".join(
        19│                 [
     →  20│                     f"Version: {self.poetry.VERSION}",
        21│                     f"Python:  {poetry_python_version}",
        22│                 ]

   5  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\commands\command.py:23 in poetry
        21│     def poetry(self) -> Poetry:
        22│         if self._poetry is None:
     →  23│             return self.get_application().poetry
        24│
        25│         return self._poetry

   4  ~\AppData\Roaming\Python\Python310\site-packages\poetry\console\application.py:129 in poetry
       127│             project_path = self._io.input.option("directory")
       128│
     → 129│         self._poetry = Factory().create_poetry(
       130│             cwd=project_path,
       131│             io=self._io,

   3  ~\AppData\Roaming\Python\Python310\site-packages\poetry\factory.py:58 in create_poetry
        56│             io = NullIO()
        57│
     →  58│         base_poetry = super().create_poetry(cwd=cwd, with_groups=with_groups)
        59│
        60│         poetry_file = base_poetry.pyproject_path

   2  C:\tools\Anaconda3\lib\site-packages\poetry\core\factory.py:51 in create_poetry
        49│
        50│         # Checking validity
     →  51│         check_result = self.validate(local_config)
        52│         if check_result["errors"]:
        53│             message = ""

   1  ~\AppData\Roaming\Python\Python310\site-packages\poetry\factory.py:359 in validate
       357│         results = super().validate(config, strict)
       358│
     → 359│         results["errors"].extend(validate_object(config))
       360│
       361│         # A project should not depend on itself.

  TypeError

  unsupported operand type(s) for /: 'str' and 'str'

  at ~\AppData\Roaming\Python\Python310\site-packages\poetry\json\__init__.py:41 in validate_object
       37│
       38│         errors.append(message)
       39│
       40│     core_schema = json.loads(
    →  41│         (CORE_SCHEMA_DIR / "poetry-schema.json").read_text(encoding="utf-8")
       42│     )
       43│
       44│     properties = {*schema["properties"].keys(), *core_schema["properties"].keys()}
       45│     additional_properties = set(obj.keys()) - properties

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions