Skip to content

pytest fails in Windows in Python 3.5, but not 2.7 #1450

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

Closed
BookOwl opened this issue Mar 11, 2016 · 7 comments
Closed

pytest fails in Windows in Python 3.5, but not 2.7 #1450

BookOwl opened this issue Mar 11, 2016 · 7 comments

Comments

@BookOwl
Copy link

BookOwl commented Mar 11, 2016

When I run py -3 -m pytest --version in Python 3.5 on Windows 8.1, I get this error:

Traceback (most recent call last):
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pytest.py", line 17, in <module>
    raise SystemExit(pytest.main())
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\config.py", line 39, in main
    config = _prepareconfig(args, plugins)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\config.py", line 118, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 724, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 338, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 333, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 595, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 249, in _wrapped_call
    wrap_controller.send(call_outcome)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\helpconfig.py", line 28, in pytest_cmdline_parse
    config = outcome.get_result()
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 278, in get_result
    raise ex[1].with_traceback(ex[2])
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 264, in __init__
    self.result = func()
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 596, in execute
    res = hook_impl.function(*args)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\config.py", line 856, in pytest_cmdline_parse
    self.parse(args)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\config.py", line 961, in parse
    self._preparse(args, addopts=addopts)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\config.py", line 932, in _preparse
    args=args, parser=self._parser)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 724, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 338, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 333, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 595, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\vendored_packages\pluggy.py", line 244, in _wrapped_call
    next(wrap_controller)   # first yield
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\capture.py", line 34, in pytest_load_initial_conftests
    _readline_workaround()
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\_pytest\capture.py", line 470, in _readline_workaround
    import readline  # noqa
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\readline.py", line 6, in <module>
    from pyreadline.rlmain import Readline
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\__init__.py", line 11, in <module>
    from . import unicode_helper, logger, clipboard, lineeditor, modes, console
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\console\__init__.py", line 15, in <module>
    from .console import *
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyreadline\console\console.py", line 610, in <module>
    msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\ctypes\__init__.py", line 425, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\Matthew\AppData\Local\Programs\Python\Python35-32\lib\ctypes\__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
TypeError: bad argument type for built-in operation

It used to work in python 3.5 and still does in 2.7, so I don't know what's wrong.

pip list output:

appdirs (1.4.0)
args (0.1.0)
asciimatics (1.6.0)
astor (0.5)
beautifulsoup4 (4.4.0)
clint (0.5.1)
colorama (0.3.7)
CommonMark (0.6.3)
construct (2.0.6)
cycler (0.9.0)
distribute (0.7.3)
et-xmlfile (1.0.1)
fpdf (1.7.2)
future (0.15.2)
google-speech (1.0.14)
grako (3.6.5)
gTTS-token (1.0.1)
html5lib (0.9999999)
httplib2 (0.9.2)
hy (0.11.1)
IMAPClient (0.13)
jdcal (1.2)
kurt (2.0.7)
matplotlib (1.5.1)
mp3play (0.1.15)
numpy (1.10.4)
nustack (0.11.0)
openpyxl (2.3.0)
pdfkit (0.5.0)
Pillow (3.1.1)
pip (8.0.3)
pkginfo (1.2.1)
playsound (1.1.0)
py (1.4.31)
py2exe (0.9.2.2)
PyAudio (0.2.9)
PyAutoGUI (0.9.31)
pyfiglet (0.7.4)
pyglet (1.2.4)
Pygments (2.1.3)
pyhistogram (0.1)
PyMsgBox (1.0.3)
PyOpenGL (3.1.0)
pyparsing (2.0.7)
PyPDF2 (1.25.1)
pypiwin32 (219)
pyreadline (2.0)
pyreq (1.1.0)
PyScreeze (0.1.8)
PySocks (1.5.6)
pytest (2.9.0)
python-2048a (0.0.0)
python-dateutil (2.4.2)
PyTweening (1.0.3)
pytz (2015.7)
pyzmail (1.0.3)
requests (2.9.1)
requests-toolbelt (0.6.0)
rply (0.7.4)
scratchapi (1.0.0)
selenium (2.48.0)
Send2Trash (1.3.0)
setuptools (18.2)
six (1.10.0)
sympy (0.7.6.1)
tk2048 (1.4)
twilio (4.9.0)
twine (1.6.5)
tymeventure (0.1.0)
virtualenv (14.0.6)
wheel (0.29.0)
witkets (0.2.4)
@BookOwl
Copy link
Author

BookOwl commented Mar 11, 2016

I can confirm that pytest works in Python 3.2

@nicoddemus
Copy link
Member

Hi @BookOwl, sorry for taking so long to respond.

Hmm it seems there's something wrong with your installation. I assume executing:

python -c "import readline"

Also raises a TypeError?

@BookOwl
Copy link
Author

BookOwl commented Mar 16, 2016

@nicoddemus, yes, it does.

@codewarrior0
Copy link
Contributor

I cannot reproduce this with Windows, Python 3.5, and py.test 2.9.0. However, my version of pyreadline is 2.1.

@The-Compiler
Copy link
Member

This looks like pyreadline/pyreadline#38 which indeed mentions that's fixed in pyreadline 2.1.

@nicoddemus
Copy link
Member

Thanks @codewarrior0 and @The-Compiler for the info... @BookOwl could you try updating and see if that solves the issue?

@BookOwl
Copy link
Author

BookOwl commented Mar 16, 2016

I updated pyreadline, and py.test now works. Thanks for the help.

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

4 participants