Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Travis failures: INTERNALERROR> AttributeError: 'int' object has no attribute 'encode' #29

Open
lnielsen opened this issue Jan 8, 2018 · 0 comments

Comments

@lnielsen
Copy link
Member

lnielsen commented Jan 8, 2018

Problem

Following error is happening on some Python 2.7 builds on Travis now:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/main.py", line 103, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/main.py", line 141, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 196, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 77, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/main.py", line 164, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 196, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/warnings.py", line 94, in pytest_runtest_protocol
INTERNALERROR>     yield
INTERNALERROR>   File "/opt/python/2.7.14/lib/python2.7/contextlib.py", line 24, in __exit__
INTERNALERROR>     self.gen.next()
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/warnings.py", line 75, in catch_warnings_for_item
INTERNALERROR>     new_args = [compat.ascii_escaped(m) for m in warn_msg.args]
INTERNALERROR>   File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/compat.py", line 187, in ascii_escaped
INTERNALERROR>     return val.encode('unicode-escape')
INTERNALERROR> AttributeError: 'int' object has no attribute 'encode'

Cause

Regression in Pytest 3.3.0. See:

Pytest 3.3.1 fixes the issue, but for some reason Travis is still picking up v3.3.0 from time to time.

Fix

Change pytest requirement from:

'pytest>=2.8.0',

to:

'pytest>=2.8.0,!=3.3.0',

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

No branches or pull requests

1 participant