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

OSError on MinGW64 with MSYS2 on Windows 8.1 #1338

Closed
victorliu opened this issue Jun 10, 2019 · 2 comments

Comments

@victorliu
Copy link

commented Jun 10, 2019

A most basic script containing:

import click
click.echo('run')

Produces the following stacktrace:

Traceback (most recent call last):
  File "t.py", line 3, in <module>
    click.echo('run')
  File "C:/msys64/mingw64/lib/python3.7/site-packages\click\utils.py", line 260, in echo
    file.write(message)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\click\_compat.py", line 630, in _safe_write
    return _write(s)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\colorama\ansitowin32.py", line 41, in write
    self.__convertor.write(text)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\colorama\ansitowin32.py", line 164, in write
    self.wrapped.write(text)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\click\_winconsole.py", line 180, in write
    return self._text_stream.write(x)
  File "C:/msys64/mingw64/lib/python3.7/site-packages\click\_winconsole.py", line 164, in write
    raise OSError(self._get_error_message(GetLastError()))
OSError: Windows error 1

I am running under a MinGW64 bash shell installed through MSYS2 on a Windows 8.1 machine.
This is with Python 3.7, colorama 0.4.1, and Click 7.0, but the error goes back to 6.0, whereas it does not occur on 5.1. Python 2 does not exhibit the error.

@davidism davidism added the windows label Jun 11, 2019
@davidism

This comment has been minimized.

Copy link
Member

commented Jun 11, 2019

None of MinGW, MSYS2, or Windows 8.1 are officially supported, but I'll leave this open for a while in case someone sees something.

@danyeaw

This comment has been minimized.

Copy link

commented Sep 10, 2019

I can reproduce this issue with MSYS2 in Windows 10 when trying to use black which depends on click.

danyeaw added a commit to danyeaw/click that referenced this issue Sep 13, 2019
Fixes pallets#1338. In version 6.0, echo and prompt functions were modified to
work with full unicode in the windows console by emulating an output
stream. Since MSYS2 uses a bash console it was creating an OSError to
apply these modifications when running in this environment.
danyeaw added a commit to danyeaw/click that referenced this issue Sep 14, 2019
Fixes pallets#1338. In version 6.0, echo and prompt functions were modified to
work with full unicode in the windows console by emulating an output
stream. Since MSYS2 uses a bash console it was creating an OSError to
apply these modifications when running in this environment.
davidism added a commit to danyeaw/click that referenced this issue Oct 9, 2019
Fixes pallets#1338. In version 6.0, echo and prompt functions were modified to
work with full unicode in the windows console by emulating an output
stream. Since MSYS2 uses a bash console it was creating an OSError to
apply these modifications when running in this environment.
@davidism davidism added this to the 7.1 milestone Oct 9, 2019
@davidism davidism closed this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.