You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, zign gives an error with the following stack:
File "c:\...\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\...\appdata\local\programs\python\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "c:\...\AppData\Local\Programs\Python\Python38\scripts\ztoken.exe\__main__.py", line 7, in <module>
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\zign\cli.py", line 99, in main
cli()
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1114, in invoke
return Command.invoke(self, ctx)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\zign\cli.py", line 34, in cli
ctx.invoke(token)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\zign\cli.py", line 90, in token
token = get_token_implicit_flow(name, authorize_url=authorize_url, token_url=token_url, client_id=client_id,
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\zign\api.py", line 255, in get_token_implicit_flow
response = perform_implicit_flow(config)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\zign\api.py", line 193, in perform_implicit_flow
info('Your browser has been opened to visit:\n\n\t{}\n'.format(browser_url))
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\clickclick\console.py", line 74, in info
secho(msg, fg='blue', bold=True)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\clickclick\console.py", line 49, in secho
click.secho(*args, **kwargs)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\termui.py", line 478, in secho
return echo(message, file=file, nl=nl, err=err, color=color)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\utils.py", line 260, in echo
file.write(message)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\_compat.py", line 630, in _safe_write
return _write(s)
File "c:\...\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 41, in write
self.__convertor.write(text)
File "c:\...\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 162, in write
self.write_and_convert(text)
File "c:\...\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 187, in write_and_convert
self.write_plain_text(text, cursor, start)
File "c:\...\AppData\Roaming\Python\Python38\site-packages\colorama\ansitowin32.py", line 195, in write_plain_text
self.wrapped.write(text[start:end])
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\_winconsole.py", line 180, in write
return self._text_stream.write(x)
File "c:\...\appdata\local\programs\python\python38\lib\site-packages\click\_winconsole.py", line 164, in write
raise OSError(self._get_error_message(GetLastError()))
OSError: Windows error 6
The cause of this is the following section of code in api.py:
# Redirect stdout and stderr. In Linux, a message is outputted to stdout when opening the browser
# (and then a message to stderr because it can't write).
saved_stdout = os.dup(1)
saved_stderr = os.dup(2)
os.close(1)
os.close(2)
os.open(os.devnull, os.O_RDWR)
try:
webbrowser.open(browser_url, new=1, autoraise=True)
finally:
os.dup2(saved_stdout, 1)
os.dup2(saved_stderr, 2)
The stdout / stderr redirection is not needed for Windows, and unlike on Linux, it looks as though the os.close(1) call is closing stdout itself, instead of the pointer to it. This means later attempts to write to stdout are failing.
The text was updated successfully, but these errors were encountered:
On Windows, zign gives an error with the following stack:
The cause of this is the following section of code in
api.py
:The stdout / stderr redirection is not needed for Windows, and unlike on Linux, it looks as though the
os.close(1)
call is closing stdout itself, instead of the pointer to it. This means later attempts to write to stdout are failing.The text was updated successfully, but these errors were encountered: