piskvorky / smart_open

Utils for streaming large files (S3, HDFS, gzip, bz2...)
MIT License
3.22k stars 383 forks source link

Fix test_http.request_callback #828

Closed ddelange closed 3 months ago

ddelange commented 3 months ago

Title

Fix tests with urllib3 v2

Motivation

Fix #784, CI was running only 3.7 (hence urllib3 v1) due to a typo regarding python-version.

Tests

Fix sftp tests now that CI is running python 3.8--3.12

Work in progress

Checklist

Before you create the PR, please make sure you have:

Workflow

Please avoid rebasing and force-pushing to the branch of the PR once a review is in progress. Rebasing can make your commits look a bit cleaner, but it also makes life more difficult from the reviewer, because they are no longer able to distinguish between code that has already been reviewed, and unreviewed code.

ddelange commented 3 months ago

with the new python versions in the test matrix, ssl in integration test started complaining about ftps server's self-signed cert

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1131)

so i explicitly created a self-signed cert for localhost and passed it in the integration test. but now there's

ERROR    smart_open.ftp:ftp.py:96 Unable to connect to FTP server: try checking the host and port!

and i'm not sure how to proceed.

ddelange commented 3 months ago

~@RachitSharma2001 as author of these files, do you have any idea?~

ddelange commented 3 months ago

got it, we're green now:)

  rsa_cert_file=/etc/vsftpd.pem
+ rsa_private_key_file=/etc/vsftpd.key
ddelange commented 3 months ago

@mpenkov please review

mpenkov commented 3 months ago

LGTM, thank you!