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

Click seems incompatible with Python's IDLE (on Windows) #1021

Closed
doobeh opened this issue May 18, 2018 · 2 comments
Closed

Click seems incompatible with Python's IDLE (on Windows) #1021

doobeh opened this issue May 18, 2018 · 2 comments
Labels
bug windows Issues pertaining to the Windows environment
Milestone

Comments

@doobeh
Copy link

doobeh commented May 18, 2018

Open up IDLE (python -m idlelib.idle) and enter the following code:

import click

@click.command()
def hello():
    click.echo('Hello World!')


if __name__ == '__main__':
    hello()

Then save, and hit F5 to run-- gives the following error:

Traceback (most recent call last):
  File "C:\Users\username\Desktop\idler.py", line 9, in <module>
    hello()
  File "C:\Users\username\Environments\idler\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\username\Environments\idler\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\username\Environments\idler\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\username\Environments\idler\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\username\Desktop\idler.py", line 5, in hello
    click.echo('Hello World!')
  File "C:\Users\username\Environments\idler\lib\site-packages\click\utils.py", line 217, in echo
    file = _default_text_stdout()
  File "C:\Users\username\Environments\idler\lib\site-packages\click\_compat.py", line 621, in func
    rv = wrapper_func()
  File "C:\Users\username\Environments\idler\lib\site-packages\click\_compat.py", line 385, in get_text_stdout
    rv = _get_windows_console_stream(sys.stdout, encoding, errors)
  File "C:\Users\username\Environments\idler\lib\site-packages\click\_winconsole.py", line 261, in _get_windows_console_stream
    func = _stream_factories.get(f.fileno())
io.UnsupportedOperation: fileno

OSX Works fine. Seems like same avenue as #770

@jcrotts jcrotts added windows Issues pertaining to the Windows environment bug labels May 21, 2018
@segevfiner
Copy link
Contributor

I think this might be fixed by: #1135.

@davidism
Copy link
Member

Seems to be fixed now. 7.1 will be out soon with the merged PR.

@davidism davidism added this to the 7.1 milestone Feb 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug windows Issues pertaining to the Windows environment
Projects
None yet
Development

No branches or pull requests

4 participants