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
factory openSUSE Urllib3Using.py on Python 2 #373
Comments
Looks like the issue comes from Urllib3Using.py trying to use the http.server import, which seems to be only in the standard library of python 3 and not python 2. |
@kayhayen would you like me to work on this issue? |
Confirming this only occurs on Python 2. It passes on Python 3 |
@tommyli3318 Yes, please do so. I think the issue there is that http.server is a Python3 rename, and the Python2 module should be used as a fallback. I have on factory or develop, I forget, added a requirement on |
@jayvdb which version of Python2.7 are you using? I just ran this using Windows with python2.7.16 and I didn't get this error. Importing http.server seems to raise no issue. |
@tommyli3318 you probably have a backport installed? This is clearly one of the one Python3 namespace cleanups |
All issues with openSUSE in the title are using latest openSUSE rpms. In this case, for Python 2, the As @kayhayen mentioned, you must have a backport, as https://docs.python.org/3/library/http.html vs https://docs.python.org/2.7/search.html?q=http&check_keywords=yes&area=default p.s. I'd love to know of a good backport of |
I see, I wasn't even aware that I have backports installed. It might've just came with my Python3 installation. Thanks for clarifications |
@jayvdb |
2to3 is an installation tool. It doesnt help unless you install something which provides |
I think https://python-future.org/standard_library_imports.html may be where your |
Yup. I installed python2-future, and the urllib3 test is now passing on Python 2. It might be useful to move future to near the top of your list of PyPI packages to test, and then add it as a runtime dependency of Nuitka and derivatives on Python 2. It may solve a lot of heartache, as your tests will often have to copy the same voodoo that future has already built. Soon this will become a loosing battle, as the moment any of the libraries you are testing need |
When you say
do you mean make it so that Nuitka doesn't run unless future is present? Please elaborate if I'm wrong. |
Yes, for Python 2, and only for Python 2. For the things it silently does to make Python 2 much more similar to Python 3. But that is a big decision. Beyond the scope of this problem. |
Nah, "Urllib3Using.py" is first and foremost a program tasked to test that "urllib3" is working correctly, with all the Pythons. Therefore It is supposed to be written portable, and not have too unusual dependencies. All we there need is a small HTTP server, and I believe that https://docs.python.org/2/library/simplehttpserver.html fits the bill here simple enough, so that is what we are going to use. Then, what the test shows, is that the working program continue to work when compiled with Nuitka in standalone mode. No more. For nice and more complete test coverage, we are going to run the test suite of urllib3 against the compiled package, but that is not what this test is supposed to do. There we are going to have their test dependencies installed. For now, standalone tests are not really allowed to require lots of things that are not normally there. |
This is fixed in the current factory and soon 0.6.4, I am closing it therefore. |
When using branch factory Nuitka-0.6.3.1556202417, on openSUSE Python 2.7, .spec
The text was updated successfully, but these errors were encountered: