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

PGPy compatibility break with Python < 3.8 #368

Closed
MarcinGinszt opened this issue Feb 24, 2021 · 4 comments
Closed

PGPy compatibility break with Python < 3.8 #368

MarcinGinszt opened this issue Feb 24, 2021 · 4 comments
Labels

Comments

@MarcinGinszt
Copy link

6e34a00
This commit uses the logging.debug function with keyword argument stacklevel.
stacklevel in this library is allowed as a keyword argument for Python versions >= 3.8
https://docs.python.org/3/library/logging.html?highlight=stacklevel
Changed in version 3.8: The stacklevel parameter was added.
Running this code on Python 3.6 results in an error

  | File "/opt/app-root/lib/python3.6/site-packages/pgpy/decorators.py", line 104, in usage
  | "".format(**em), stacklevel=4)
  | File "/usr/lib64/python3.6/logging/__init__.py", line 1912, in debug
  | root.debug(msg, *args, **kwargs)
  | File "/usr/lib64/python3.6/logging/__init__.py", line 1296, in debug
  | self._log(DEBUG, msg, args, **kwargs)
  | TypeError: _log() got an unexpected keyword argument 'stacklevel'
@MarcinGinszt MarcinGinszt changed the title PGPy compatilibity break with Python < 3.8 PGPy compatibility break with Python < 3.8 Feb 24, 2021
@J-M0 J-M0 added the bug label Feb 24, 2021
@J-M0
Copy link
Collaborator

J-M0 commented Feb 24, 2021

Hey @MarcinGinszt, thanks for the report! Would you mind sharing some example code that triggers this? I'd like to make a test.

@MarcinGinszt
Copy link
Author

Any code using PGPKey.encrypt() will fail. Thanks!

@J-M0
Copy link
Collaborator

J-M0 commented Apr 9, 2021

Can you provide a more detailed sample please? I know the parameter isn't in older Python versions, but I'm having trouble triggering the bug.

@J-M0
Copy link
Collaborator

J-M0 commented Apr 9, 2021

Nevermind, I got it

@J-M0 J-M0 closed this as completed in a691584 Apr 9, 2021
J-M0 added a commit that referenced this issue Apr 15, 2021
J-M0 added a commit that referenced this issue Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants