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

Python 2 support for tests #6259

Closed
jay opened this issue Nov 28, 2020 · 3 comments
Closed

Python 2 support for tests #6259

jay opened this issue Nov 28, 2020 · 3 comments
Assignees
Labels

Comments

@jay
Copy link
Member

jay commented Nov 28, 2020

I did this

make test from master in Ubuntu 16.

== Contents of files in the log/ dir after test 1452
Traceback (most recent call last):
  File "./negtelnetserver.py", line 358, in <module>
    setup_logging(options)
  File "./negtelnetserver.py", line 320, in setup_logging
    handler = ClosingFileHandler(options.logfile)
  File "/home/owner/curl/tests/util.py", line 41, in __init__
    self.setStream(None)
AttributeError: 'ClosingFileHandler' object has no attribute 'setStream'

This is a problem since #6206 landed. The error is from attempting to start the server and because it can't start the server I guess it doesn't count those tests. This error appears to be because Python 2 doesn't have setStream in StreamHandler.

Tests don't fail because of this, instead the server fails silently and it appears those tests don't run.

Also a problem in the CI.

We've had other issues with Python 2 , I think there was a problem with the SMB server as well. I think the larger issue is should Python 2 still be supported for tests. I would think if only because I have LTS builds that package it.

curl/libcurl version

Ubuntu 16 LTS
Python 2.7.12
curl 7.73.1-DEV (x86_64-pc-linux-gnu) libcurl/7.73.1-DEV OpenSSL/1.1.1h zlib/1.2.8 nghttp2/1.41.0 librtmp/2.3

/cc @mback2k

@emilengler
Copy link
Contributor

We've had other issues with Python 2 , I think there was a problem with the SMB server as well. I think the larger issue is should Python 2 still be supported for tests. I would think if only because I have LTS builds that package it.

No, please no more Python 2 support! It reached end of life on January 1st this year and I think we should accept that decision.

@bagder
Copy link
Member

bagder commented Nov 28, 2020

I'm with @emilengler, I rather think we should work on making python2 fail gracefully. Although if someone wants to work on fixing python 2 stuff I won't stand in the way. It just seems like the wrong thing to put a lot of effort into.

@mback2k mback2k self-assigned this Nov 30, 2020
@mback2k
Copy link
Member

mback2k commented Nov 30, 2020

I am with @emilengler and @bagder, but will try to fix it anyway this time.

mback2k added a commit to mback2k/curl that referenced this issue Nov 30, 2020
Backporting the Python 3 implementation of setStream
to ClosingFileHandler as a fallback within Python 2.

Reported-by: Jay Satiro

Fixes curl#6259
@mback2k mback2k closed this as completed in 753a2c7 Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

4 participants