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

Fix ^C during venv creation #1258

Merged
merged 1 commit into from
Apr 13, 2019
Merged

Fix ^C during venv creation #1258

merged 1 commit into from
Apr 13, 2019

Conversation

asottile
Copy link
Contributor

Resolves #1257

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok but pytest fails on Windows 2.7 with a not that helpful error 🤔

@asottile
Copy link
Contributor Author

It passed before, I think this is a flake / issue with pytest-xdist / pytest -- can you rerun it?

@gaborbernat
Copy link
Member

Triggered a rerun 👍

@gaborbernat
Copy link
Member

gaborbernat commented Apr 12, 2019

What's the flake issue with pytest-xdist? Still fails 😢

@asottile
Copy link
Contributor Author

What's the flake issue with pytest-xdist?

It has to do with printing non-ascii characters in error messages during pytest failures and multiprocessing in python2.x specifically on windows -- I've had a rough time trying to reproduce it myself but here's the stacktrace (I've seen this before):

INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 209, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 249, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 67, in pytest_runtestloop
INTERNALERROR>   File "<remote exec>", line 84, in run_one_test
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 78, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 93, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 175, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\skipping.py", line 127, in pytest_runtest_makereport
INTERNALERROR>     rep = outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 249, in pytest_runtest_makereport
INTERNALERROR>     return TestReport.from_item_and_call(item, call)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\reports.py", line 361, in from_item_and_call
INTERNALERROR>     longrepr = item.repr_failure(excinfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\python.py", line 848, in repr_failure
INTERNALERROR>     return self._repr_failure_py(excinfo, style=style)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\nodes.py", line 285, in _repr_failure_py
INTERNALERROR>     truncate_locals=truncate_locals,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 552, in getrepr
INTERNALERROR>     return fmt.repr_excinfo(self)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 790, in repr_excinfo
INTERNALERROR>     reprtraceback = self.repr_traceback(excinfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 747, in repr_traceback
INTERNALERROR>     reprentry = self.repr_traceback_entry(entry, einfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 717, in repr_traceback_entry
INTERNALERROR>     localsrepr = self.repr_locals(entry.locals)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 679, in repr_locals
INTERNALERROR>     str_repr = pprint.pformat(value)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 63, in pformat
INTERNALERROR>     return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 122, in pformat
INTERNALERROR>     self._format(object, sio, 0, 0, {}, 0)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 140, in _format
INTERNALERROR>     rep = self._repr(object, context, level - 1)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 226, in _repr
INTERNALERROR>     self._depth, level)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 238, in format
INTERNALERROR>     return _safe_repr(object, context, maxlevels, level)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 323, in _safe_repr
INTERNALERROR>     rep = repr(object)
INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode character u'\u280b' in position 40: ordinal not in range(128)

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 209, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 249, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\xdist\dsession.py", line 115, in pytest_runtestloop
INTERNALERROR>     self.loop_once()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\xdist\dsession.py", line 138, in loop_once
INTERNALERROR>     call(**kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\xdist\dsession.py", line 180, in worker_workerfinished
INTERNALERROR>     assert not crashitem, (crashitem, node)
INTERNALERROR> AssertionError: ('tests/unit/session/test_parallel.py::test_parallel_show_output', <WorkerController gw1>)
INTERNALERROR> assert not 'tests/unit/session/test_parallel.py::test_parallel_show_output'
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 209, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\main.py", line 249, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<remote exec>", line 67, in pytest_runtestloop
INTERNALERROR>   File "<remote exec>", line 84, in run_one_test
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 78, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 93, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 175, in call_and_report
INTERNALERROR>     report = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 68, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\manager.py", line 62, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\skipping.py", line 127, in pytest_runtest_makereport
INTERNALERROR>     rep = outcome.get_result()
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\runner.py", line 249, in pytest_runtest_makereport
INTERNALERROR>     return TestReport.from_item_and_call(item, call)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\reports.py", line 361, in from_item_and_call
INTERNALERROR>     longrepr = item.repr_failure(excinfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\python.py", line 848, in repr_failure
INTERNALERROR>     return self._repr_failure_py(excinfo, style=style)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\nodes.py", line 285, in _repr_failure_py
INTERNALERROR>     truncate_locals=truncate_locals,
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 552, in getrepr
INTERNALERROR>     return fmt.repr_excinfo(self)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 790, in repr_excinfo
INTERNALERROR>     reprtraceback = self.repr_traceback(excinfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 747, in repr_traceback
INTERNALERROR>     reprentry = self.repr_traceback_entry(entry, einfo)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 717, in repr_traceback_entry
INTERNALERROR>     localsrepr = self.repr_locals(entry.locals)
INTERNALERROR>   File "d:\a\1\s\.tox\py27\lib\site-packages\_pytest\_code\code.py", line 679, in repr_locals
INTERNALERROR>     str_repr = pprint.pformat(value)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 63, in pformat
INTERNALERROR>     return PrettyPrinter(indent=indent, width=width, depth=depth).pformat(object)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 122, in pformat
INTERNALERROR>     self._format(object, sio, 0, 0, {}, 0)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 140, in _format
INTERNALERROR>     rep = self._repr(object, context, level - 1)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 226, in _repr
INTERNALERROR>     self._depth, level)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 238, in format
INTERNALERROR>     return _safe_repr(object, context, maxlevels, level)
INTERNALERROR>   File "C:\hostedtoolcache\windows\Python\2.7.14\x64\Lib\pprint.py", line 323, in _safe_repr
INTERNALERROR>     rep = repr(object)
INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode character u'\u280b' in position 218: ordinal not in range(128)

@asottile
Copy link
Contributor Author

looks like it didn't trigger, I'll just trivial-amend

@asottile asottile merged commit 5cf41e7 into tox-dev:master Apr 13, 2019
@asottile asottile deleted the fix_keyboardinterrupt_while_creating branch April 13, 2019 20:06
@gaborbernat
Copy link
Member

It's still failing on master, for some reason now reliably. Maybe a side-effect of the Azure image upgrade. Either way, we need to fix now to merge further PRs. 😢

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

Successfully merging this pull request may close these issues.

[BUG] tox congratulates me even if I ^C it
2 participants