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

Fix deprecated methods from #4620 #4628

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

matusvalo
Copy link
Collaborator

Steps

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Description

Fixes several issues in #4620:

  • Remove duplicates
  • Remove SSLSocket methods - the methods cannot be inferred when created by factory SSLContext.wrap_socket
  • ssl.RAND_pseudo_bytes -> _ssl.RAND_pseudo_bytes

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Related Issue

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.9.1 milestone Jun 29, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component Minor 💅 Polishing pylint is always nice labels Jun 29, 2021
@Pierre-Sassoulas
Copy link
Member

We basically released 2.9.0 just after merging #4620, I hope it's not too problematic, but we can release 2.9.1 fast if it is :)

@cdce8p
Copy link
Member

cdce8p commented Jun 29, 2021

@Pierre-Sassoulas We can merge this but lets's just wait and see if we get any bug reports about it before doing a hotfix release. As I understand it, those are only minor things so we might not even get one about it.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.041% when pulling 410f180 on matusvalo:stdlib_fix into 52027cb on PyCQA:master.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 0f6a38e into pylint-dev:master Jun 29, 2021
@matusvalo
Copy link
Collaborator Author

matusvalo commented Jun 29, 2021

@Pierre-Sassoulas there is still one problem:
Pylint is having problem with zipimport.zipimporter not sure why:

(pylint38) matus@home:~/dev/pylint$ cat test.py
import zipimport
zipimport.zipimporter('/path/to/zip').load_module()

matus@home:~/dev/pylint$ python test.py                                     
Traceback (most recent call last):
  File "<frozen zipimport>", line 75, in __init__
  File "<frozen importlib._bootstrap_external>", line 87, in _path_stat
FileNotFoundError: [Errno 2] No such file or directory: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 45, in <module>
    zipimport.zipimporter('/path/to/zip').load_module()
  File "<frozen zipimport>", line 81, in __init__
zipimport.ZipImportError: not a Zip file

(pylint38) matus@home:~/dev/pylint$ pylint test.py
************* Module test
test.py:45:0: E1101: Module 'zipimport' has no 'zipimporter' member (no-member)

----------------------------------------------------------------------
Your code has been rated at -15.00/10 (previous run: -15.00/10, +0.00)

Running script crashes because of dummy parameters but zipimporter exists
pylint is saying that module has no member :-( and skips checking of deprecated method (checked with pdb)

@matusvalo matusvalo deleted the stdlib_fix branch June 29, 2021 21:13
@matusvalo
Copy link
Collaborator Author

Doublechecked now, deprecation is not checked due issues with inferrence error in line:
https://github.com/PyCQA/pylint/blob/0f6a38ee54362ae2e4f5f294f26942261d61485e/pylint/checkers/deprecated.py#L63

*** astroid.exceptions.InferenceError: Inference failed for <Attribute.zipimporter l.45 at 0x7fec302fe220>.

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Jun 30, 2021

I think #4631 might be the same problem ? It's not the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Minor 💅 Polishing pylint is always nice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants