load deprecation warning in SageCell

84 views
Skip to first unread message

Ingo Dahn

unread,
May 24, 2022, 2:10:13 PM5/24/22
to sage-devel
When I call
in a sagecell I get in the output
/home/sc_serv/sage/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/misc/remote_file.py:46: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated. content = urlopen(req, timeout=1, context=SSLContext())

How can I avoid this message?

Since load is a Sage function, I hope this is the right place to ask.

Matthias Koeppe

unread,
May 24, 2022, 3:02:51 PM5/24/22
to sage-devel

Mike

unread,
Sep 7, 2022, 4:14:27 PM9/7/22
to sage-devel
Since the referenced fix won't be available until sage-9.7, is there a (temporary) way to avoid this error message when loading files from github into a sage cell?

Dima Pasechnik

unread,
Sep 7, 2022, 4:23:37 PM9/7/22
to sage-devel
On Wed, Sep 7, 2022 at 9:14 PM Mike <mill...@gmail.com> wrote:
>
> Since the referenced fix won't be available until sage-9.7, is there a (temporary) way to avoid this error message when loading files from github into a sage cell?
you basically need to apply the patch from
https://trac.sagemath.org/ticket/33771 on the sage cell server you're
using.


>
> On Tuesday, May 24, 2022 at 3:02:51 PM UTC-4 Matthias Koeppe wrote:
>>
>> Fixed in https://trac.sagemath.org/ticket/33771
>>
>> On Tuesday, May 24, 2022 at 11:10:13 AM UTC-7 ingo...@gmail.com wrote:
>>>
>>> When I call
>>> load('https://raw.githubusercontent.com/ingodahn/sageutils/master/physics.py')
>>> in a sagecell I get in the output
>>> /home/sc_serv/sage/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/misc/remote_file.py:46: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated. content = urlopen(req, timeout=1, context=SSLContext())
>>>
>>> How can I avoid this message?
>>>
>>> Since load is a Sage function, I hope this is the right place to ask.
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/83ca3348-bd29-4912-9569-112c28e52d11n%40googlegroups.com.

Nils Bruin

unread,
Sep 7, 2022, 7:10:02 PM9/7/22
to sage-devel
On Tuesday, 24 May 2022 at 11:10:13 UTC-7 ingo...@gmail.com wrote:
When I call
in a sagecell I get in the output
/home/sc_serv/sage/local/var/lib/sage/venv-python3.10.3/lib/python3.10/site-packages/sage/misc/remote_file.py:46: DeprecationWarning: ssl.SSLContext() without protocol argument is deprecated. content = urlopen(req, timeout=1, context=SSLContext())

How can I avoid this message?


If you're OK with changing the cell content, you can use python's standard warning control infrastructure to suppress the message. For instance, the following silences any warnings that would arise from the "load" invocation:
 
import warnings
with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    load('https://raw.githubusercontent.com/ingodahn/sageutils/master/physics.py')
Message has been deleted

Mike

unread,
Sep 9, 2022, 9:51:05 PM9/9/22
to sage-devel
Thank you for the suggestion, but I'd rather change the cell content as little as possible. I'm trying to present a simple interface to my freshmen students, so I think it'll be easier to tell them to ignore the warnings than to explain the extra code.  (I was hoping the load command might have an "ignore warnings" option.)

Dima Pasechnik

unread,
Sep 10, 2022, 5:32:17 AM9/10/22
to sage-devel


On Sat, 10 Sep 2022, 10:01 Mike, <mill...@gmail.com> wrote:
The sage cell server I'm using is sagecell.sagemath.org.  Is there someone I should ask to apply that patch?

the main contact for this sagecell is listed there on the 1st page, at the Problems section near the bottom.


Reply all
Reply to author
Forward
0 new messages