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

'IO' object has no attribute 'ask' #4790

Closed
3 tasks done
nschrader opened this issue Nov 17, 2021 · 8 comments
Closed
3 tasks done

'IO' object has no attribute 'ask' #4790

nschrader opened this issue Nov 17, 2021 · 8 comments
Labels
kind/bug Something isn't working as expected

Comments

@nschrader
Copy link

  • 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).
  • OS version and name: Ubuntu 20.04
  • Poetry version: 1.2.0a2
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

After adding a repository but no credentials, I cannot publish:

> poetry config repositories.xyz.url "http://python.repo/an/index/"

Fix #3104 (comment), then

> poetry publish -r xyz -vvv
Loading configuration file /home/user/.config/pypoetry/config.toml
Loading configuration file /home/user/.config/pypoetry/auth.toml
Loading configuration file /home/user/project/poetry.toml
Adding repository xyz (http://python.repo/an/index/)


  Stack trace:

  8  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/application.py:330 in run
      328│ 
      329│             try:
    → 330│                 exit_code = self._run(io)
      331│             except Exception as e:
      332│                 if not self._catch_exceptions:

  7  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/application.py:180 in _run
      178│         self._load_plugins(io)
      179│ 
    → 180│         return super()._run(io)
      181│ 
      182│     def _configure_io(self, io: IO) -> None:

  6  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/application.py:425 in _run
      423│                 io.set_input(ArgvInput(argv))
      424│ 
    → 425│         exit_code = self._run_command(command, io)
      426│         self._running_command = None
      427│ 

  5  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/application.py:467 in _run_command
      465│ 
      466│         if error is not None:
    → 467│             raise error
      468│ 
      469│         return event.exit_code

  4  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/application.py:451 in _run_command
      449│ 
      450│             if event.command_should_run():
    → 451│                 exit_code = command.run(io)
      452│             else:
      453│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

  3  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/commands/base_command.py:118 in run
      116│         io.input.validate()
      117│ 
    → 118│         status_code = self.execute(io)
      119│ 
      120│         if status_code is None:

  2  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/cleo/commands/command.py:85 in execute
       83│ 
       84│         try:
    →  85│             return self.handle()
       86│         except KeyboardInterrupt:
       87│             return 1

  1  ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/console/commands/publish.py:78 in handle
       76│         )
       77│ 
    →  78│         publisher.publish(
       79│             self.option("repository"),
       80│             self.option("username"),

  AttributeError

  'IO' object has no attribute 'ask'

  at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/publishing/publisher.py:82 in publish
       78│         )
       79│         # Requesting missing credentials but only if there is not a client cert defined.
       80│         if not resolved_client_cert:
       81│             if username is None:
    →  82│                 username = self._io.ask("Username:")
       83│ 
       84│             # skip password input if no username is provided, assume unauthenticated
       85│             if username and password is None:
       86│                 password = self._io.ask_hidden("Password:")
@nschrader nschrader added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 17, 2021
@WizzyGeek
Copy link

Facing the same issue on 1.2.0a2

@JeppeKlitgaard
Copy link

JeppeKlitgaard commented Dec 3, 2021

I am also facing this issue on 1.2.0a2, Windows 10 in Powershell

@Conchylicultor
Copy link

Conchylicultor commented Dec 7, 2021

Same issue to me on Poetry (version 1.2.0a2) (on mac)

@KafCoppelia
Copy link

Same issue on Poetry 1.2.0a2 on Ubuntu 20.04

@NiklasRosenstein
Copy link

I have the same issue; it appears that ask() was removed in the IO class between cleo-0.8.1 (which poetry-1.1.12 depends on) and cleo-1.0.0a4 (which poetry-1.2.0a2 depends on).

@dimbleby
Copy link
Contributor

duplicate #4349

@mkniewallner
Copy link
Member

Closing, since this should be fixed by 1.2.0b2.

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 29, 2022
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

Successfully merging a pull request may close this issue.

8 participants