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

deprecation warning: OpenSSL.rand, despite not importing it #674

Closed
warner opened this issue Jul 23, 2017 · 11 comments · Fixed by #675
Closed

deprecation warning: OpenSSL.rand, despite not importing it #674

warner opened this issue Jul 23, 2017 · 11 comments · Fixed by #675

Comments

@warner
Copy link
Member

warner commented Jul 23, 2017

I've got some CI tests that look for deprecation warnings (in the py27 build), and these have recently started complaining about something internal in Twisted's use of OpenSSL.

Twisted (in src/twisted/protocols/tls.py) does from OpenSSL.SSL import (somestuff), and OpenSSL/__init__.py does from OpenSSL import rand, and rand.py has a top-level warnings.warn that says rand is deprecated and applications should use os.urandom instead (added for #631).

% PYTHONWARNINGS=default::DeprecationWarning python -c "import OpenSSL"
-c:1: DeprecationWarning: OpenSSL.rand is deprecated - you should use os.urandom instead
%

That advice is fine, of course, but I don't see a way for applications to avoid triggering the import-time warning (Twisted isn't using or even importing OpenSSL.rand).

If apps are depending upon being able to do import OpenSSL; OpenSSL.rand.bytes() (rather than from OpenSSL.rand import bytes), then I guess we can't remove the import from __init__.py. Could we maybe move the warning calls to the individual functions?

@alex
Copy link
Member

alex commented Jul 23, 2017

Maybe we should just delete it after a very short deprecation period? There's no reason to use it, porting away is trivial, and I'm not aware of any consumers, and if you really need it, you can avoid upgrading for a while.

@alex
Copy link
Member

alex commented Jul 23, 2017

(by short deprecation period, I mean, "we should delete it now")

@alex
Copy link
Member

alex commented Jul 23, 2017

Going to send a PR to do that, we can bikeshed there :-)

@kwlzn
Copy link

kwlzn commented Sep 8, 2017

looks like this change hasn't made it out to release yet? the last release I see is 1.7.20 on Jul 20, which predates the repairing PR by 3 days.

any chance of getting a release cut for pypi consumption?

@bsipocz
Copy link

bsipocz commented Sep 8, 2017

I second @kwlzn's request, our CI started to error out because of this issue.

@bsipocz bsipocz mentioned this issue Sep 8, 2017
7 tasks
@alex
Copy link
Member

alex commented Sep 8, 2017

@hynek @reaperhulk Either of you want to do a release? Always Be Releasing :-)

@hynek
Copy link
Contributor

hynek commented Sep 9, 2017 via email

@alex
Copy link
Member

alex commented Sep 9, 2017

@hynek nice! have fun, unless you object I'll try to con @reaperhulk into doing the release, he's got PyPI credentials.

@kwlzn
Copy link

kwlzn commented Sep 13, 2017

we're going to temporarily pin a downgrade to 17.1.0 as this is blocking our release - will follow along here for updates so we can bump back to latest.

@reaperhulk
Copy link
Member

17.3.0 is out :)

@kwlzn
Copy link

kwlzn commented Sep 14, 2017

thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants