[sage-devel] Re: How to deal with unsorted output of dictionaries in doctests

2020-01-27 Thread Nils Bruin
On Monday, January 27, 2020 at 2:01:04 PM UTC-8, Nils Bruin wrote: > > For 2) there are different possibilities. > a) Something like sorted(D.iteritems()) works, but it means the doctest > now displays a list of tuples rather than something that looks like a dict: > not a problem for "TESTS:"

Re: [sage-devel] How to deal with unsorted output of dictionaries in doctests

2020-01-27 Thread Nils Bruin
On Monday, January 27, 2020 at 4:51:28 PM UTC-8, David Roe wrote: > > > What about having another special doctest comment like "# sort-keys" that > makes the doctest framework sort the keys before printing? This could be > then implemented in one of the above ways in the doctest code. > David >

Re: [sage-devel] How to deal with unsorted output of dictionaries in doctests

2020-01-27 Thread David Roe
On Mon, Jan 27, 2020 at 5:01 PM Nils Bruin wrote: > For 2) there are different possibilities. > a) Something like sorted(D.iteritems()) works, but it means the doctest > now displays a list of tuples rather than something that looks like a dict: > not a problem for "TESTS:" but less than

Re: [sage-devel] How to deal with unsorted output of dictionaries in doctests

2020-01-27 Thread Michael Orlitzky
On 1/27/20 5:01 PM, Nils Bruin wrote: > This came up in https://trac.sagemath.org/ticket/29042 : > In current IPython, dictionaries are no longer sorted on output, because > in Py3 there is a slightly more meaningful order to the dict: it's close > to insertion order. So it seems reasonable to

[sage-devel] How to deal with unsorted output of dictionaries in doctests

2020-01-27 Thread Nils Bruin
This came up in https://trac.sagemath.org/ticket/29042 : In current IPython, dictionaries are no longer sorted on output, because in Py3 there is a slightly more meaningful order to the dict: it's close to insertion order. So it seems reasonable to follow this order for printing too. Yet, the

Re: [sage-devel] Re: Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Michael Orlitzky
On 1/27/20 12:59 PM, Matthias Koeppe wrote: >    > In my opinion, it should set these permissions when it creates the > DOT_SAGE directory > for the first time (similar to how permissions of files like > ~/.python_history or ~/.bash_history are set), but not adjust them if > the directory already

Re: [sage-devel] Re: Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Jan Groenewald
Hi On Mon, 27 Jan 2020 at 20:57, John H Palmieri wrote: > > > On Monday, January 27, 2020 at 9:59:04 AM UTC-8, Matthias Koeppe wrote: >> >> On Monday, January 27, 2020 at 9:34:41 AM UTC-5, Marc Mezzarobba wrote: >>> >>> >>> I just noticed that Sage unconditionally changes the permissions of the

[sage-devel] Re: Should Sage fiddle with .sage file permissions?

2020-01-27 Thread John H Palmieri
On Monday, January 27, 2020 at 9:59:04 AM UTC-8, Matthias Koeppe wrote: > > On Monday, January 27, 2020 at 9:34:41 AM UTC-5, Marc Mezzarobba wrote: >> >> >> I just noticed that Sage unconditionally changes the permissions of the >> DOT_SAGE directory to rwx--- even after the user manually

[sage-devel] Re: Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Matthias Koeppe
On Monday, January 27, 2020 at 9:34:41 AM UTC-5, Marc Mezzarobba wrote: > > > I just noticed that Sage unconditionally changes the permissions of the > DOT_SAGE directory to rwx--- even after the user manually modified them > (sage/misc/misc.py, l. 92ff). It seems to me however that there are >

Re: [sage-devel] Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Nils Bruin
On Monday, January 27, 2020 at 7:58:27 AM UTC-8, Dima Pasechnik wrote: > > I suppose the idea of closing ~/.sage/ to the world was that it may > contain something like (salted or not?) passwods for sagenb, > as well as sagenb notebooks, so that students on the same host don't > have a way to

Re: [sage-devel] Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Dima Pasechnik
On Mon, Jan 27, 2020 at 2:34 PM Marc Mezzarobba wrote: > > Hi, > > I just noticed that Sage unconditionally changes the permissions of the > DOT_SAGE directory to rwx--- even after the user manually modified them > (sage/misc/misc.py, l. 92ff). It seems to me however that there are > perfectly

Re: [sage-devel] Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Michael Orlitzky
On 1/27/20 9:34 AM, Marc Mezzarobba wrote: > Should Sage fiddle with .sage file permissions? No. Automating chown/chmod is usually exploitable, but also just no. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and

[sage-devel] Should Sage fiddle with .sage file permissions?

2020-01-27 Thread Marc Mezzarobba
Hi, I just noticed that Sage unconditionally changes the permissions of the DOT_SAGE directory to rwx--- even after the user manually modified them (sage/misc/misc.py, l. 92ff). It seems to me however that there are perfectly valid reasons to share one's .sage with other users. Worse, Sage