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

Redirecting stdout to NUL (Windows) raises exception #2555

Closed
uranusjr opened this issue Jul 10, 2018 · 2 comments
Closed

Redirecting stdout to NUL (Windows) raises exception #2555

uranusjr opened this issue Jul 10, 2018 · 2 comments

Comments

@uranusjr
Copy link
Member

I’m not sure if this is a bug in Pipenv. Crayon, Click, or even Python, but I need to log it somewhere.

Discovered #2527 (comment).

To reproduce:

λ pipenv >NUL
Traceback (most recent call last):
  File "C:\Users\uranusjr\Documents\programming\pipenv\.venv\Scripts\pipenv-script.py", line 11, in <module>
    load_entry_point('pipenv', 'console_scripts', 'pipenv')()
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\cli.py", line 1017, in sync
    pypi_mirror=pypi_mirror,
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\core.py", line 2545, in do_sync
    system=system,
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\core.py", line 1330, in do_init
    pypi_mirror=pypi_mirror,
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\core.py", line 767, in do_install_dependencies
    bold=True,
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\utils.py", line 259, in echo
    file.write(message)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\_compat.py", line 577, in _safe_write
    return _write(s)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\colorama\ansitowin32.py", line 40, in write
    self.__convertor.write(text)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\colorama\ansitowin32.py", line 141, in write
    self.write_and_convert(text)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\colorama\ansitowin32.py", line 166, in write_and_convert
    self.write_plain_text(text, cursor, start)
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\colorama\ansitowin32.py", line 175, in write_plain_text
    self.wrapped.flush()
  File "c:\users\uranusjr\documents\programming\pipenv\pipenv\vendor\click\_winconsole.py", line 164, in write
    raise OSError(self._get_error_message(GetLastError()))
OSError: Windows error 1

I believe any command that outputs to stdout (i.e. all of them) has this problem. Stderr works fine. I do not know whether Linux and macOS has this problem.

@uranusjr
Copy link
Member Author

Seems to work on WSL, I assume it is a Windows-only problem, and is from an upstream library (likely Click).

@uranusjr
Copy link
Member Author

Tracked in pallets/click#1065 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant