[sage-devel] Sage doctesting on shared systems insecure (#13579)

2012-10-10 Thread Jeroen Demeyer
Volker Braun discovered a serious security vulnerability in Sage when
doctesting sage/tests/cmdline.py

Until this is fixed, *do not run Sage doctests on shared systems*.
Doctesting individual files, different from sage/tests/cmdline.py should
still be okay.


ISSUE:

The problem is really due to a bad Python design decision (this should
be and will be reported upstream): when running a script like

$ python /path/to/script.py

then /path/to is added in front of sys.path, so any

$ import some_module

statement in /path/to/script.py will /first/ look in the directory
/path/to for some_module.  This is problematic if the script lives in
/tmp because any user can put files there.  Python does not check for
this.  It happens that sage/tests/cmdline.py does create a Sage script
in /tmp, exposing this vulnerability.


WHAT TO DO NOW:

* if you're a Sage user: go ahead as usual.  As long as you don't
doctest the Sage library, you should be safe.

* if you're a Sage developer: unless nobody else can log in to your
system, do not run anything like "make ptestlong" or "./sage -t
devel/sage/sage".  Consider deleting sage/tests/cmdline.py from your
Sage installation.

* if you're a sysadmin: run the following script to temporarily prevent
this hole from being exploited on your system:
http://boxen.math.washington.edu/home/jdemeyer/plug13579.sh
(this writes some files in /tmp so be careful when /tmp is cleaned
either by a tmp-cleaner or on system startup)


All credit to Volker Braun for discovering this issue!

See also http://trac.sagemath.org/sage_trac/ticket/13579

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread Dima Pasechnik
Many tests (with new gap-4.5 spkgs at #13211) in doctest 
sage/groups/generic.py fail if database_cremona_ellcurve, 
which is an optional package, is not installed.
I wonder why these tests are not marked as optional.

Should database_cremona_ellcurve be promoted to standard?

Dima

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread Jeroen Demeyer
On 2012-10-10 11:58, Dima Pasechnik wrote:
> Many tests (with new gap-4.5 spkgs at #13211) in doctest
> sage/groups/generic.py fail if database_cremona_ellcurve, 
> which is an optional package, is not installed.
> I wonder why these tests are not marked as optional.

If these are tests introduced by #13211, then they should be marked
optional in that ticket.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread Dima Pasechnik


On Wednesday, 10 October 2012 18:06:36 UTC+8, Jeroen Demeyer wrote:
>
> On 2012-10-10 11:58, Dima Pasechnik wrote: 
> > Many tests (with new gap-4.5 spkgs at #13211) in doctest 
> > sage/groups/generic.py fail if database_cremona_ellcurve, 
> > which is an optional package, is not installed. 
> > I wonder why these tests are not marked as optional. 
>
> If these are tests introduced by #13211, then they should be marked 
> optional in that ticket. 
>

no, these tests were always there. I have no idea why this started to play 
up.
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread John Cremona
This is very strange indeed.

Installing the optional database will certainly affect some elliptic
curve tests, and we have gradually eliminated the ones which are so
affected, or marked hem as optional.  But as far as I no, there is no
place in the elliptic curve code where GAP is used.

Could you post one specific example of a failing test?

The optional spkg is 134M (and is steadily growing at the moment) so I
don't think that making it standard is sensible, even if it is the
first spkg I install every time a new Sage is released!

John

On 10 October 2012 11:12, Dima Pasechnik  wrote:
>
>
> On Wednesday, 10 October 2012 18:06:36 UTC+8, Jeroen Demeyer wrote:
>>
>> On 2012-10-10 11:58, Dima Pasechnik wrote:
>> > Many tests (with new gap-4.5 spkgs at #13211) in doctest
>> > sage/groups/generic.py fail if database_cremona_ellcurve,
>> > which is an optional package, is not installed.
>> > I wonder why these tests are not marked as optional.
>>
>> If these are tests introduced by #13211, then they should be marked
>> optional in that ticket.
>
>
> no, these tests were always there. I have no idea why this started to play
> up.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To post to this group, send email to sage-devel@googlegroups.com.
> To unsubscribe from this group, send email to
> sage-devel+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] Sage doctesting on shared systems insecure (#13579)

2012-10-10 Thread Nicolas M. Thiery
On Wed, Oct 10, 2012 at 10:45:50AM +0200, Jeroen Demeyer wrote:
> Volker Braun discovered a serious security vulnerability in Sage when
> doctesting sage/tests/cmdline.py

Yikes! Good job Volker detecting this!

> * if you're a Sage developer: unless nobody else can log in to your
> system, do not run anything like "make ptestlong" or "./sage -t
> devel/sage/sage".  Consider deleting sage/tests/cmdline.py from your
> Sage installation.

Note for the users of the Sage-Combinat queue: I have just inserted a
temporary patch at the bottom of the queue that adds "nodoctest" to
this file, effectively disabling its testing. So you need not worry
about this issue (well, except that any test failure in cmdline.py
that our patches may cause will get unnoticed until the issue is
fixed).

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] Sage doctesting on shared systems insecure (#13579)

2012-10-10 Thread John Cremona
Would it not be a good idea to disable testing this file (or the bad
part in it) until this has been fixed?  In all future testing &
development releases?

John

On 10 October 2012 12:35, Nicolas M. Thiery  wrote:
> On Wed, Oct 10, 2012 at 10:45:50AM +0200, Jeroen Demeyer wrote:
>> Volker Braun discovered a serious security vulnerability in Sage when
>> doctesting sage/tests/cmdline.py
>
> Yikes! Good job Volker detecting this!
>
>> * if you're a Sage developer: unless nobody else can log in to your
>> system, do not run anything like "make ptestlong" or "./sage -t
>> devel/sage/sage".  Consider deleting sage/tests/cmdline.py from your
>> Sage installation.
>
> Note for the users of the Sage-Combinat queue: I have just inserted a
> temporary patch at the bottom of the queue that adds "nodoctest" to
> this file, effectively disabling its testing. So you need not worry
> about this issue (well, except that any test failure in cmdline.py
> that our patches may cause will get unnoticed until the issue is
> fixed).
>
> Cheers,
> Nicolas
> --
> Nicolas M. Thiéry "Isil" 
> http://Nicolas.Thiery.name/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To post to this group, send email to sage-devel@googlegroups.com.
> To unsubscribe from this group, send email to 
> sage-devel+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] Sage doctesting on shared systems insecure (#13579)

2012-10-10 Thread Jeroen Demeyer
On 2012-10-10 13:59, John Cremona wrote:
> Would it not be a good idea to disable testing this file (or the bad
> part in it) until this has been fixed?  In all future testing &
> development releases?
The idea is *not* to do any further releases until this gets sorted out.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: Cygwin on XP attempt

2012-10-10 Thread kcrisman
Just to put this somewhere, here are the tests which failed on my XP
box.  I have strong reason to believe these are not at all
independent, but putting them here anyway.  Here are two very common
types, both of which I find unsurprising, given "fork" problems on
Cygwin.  I also seem to have had issues with interfaces - ECL
complaining that REQUIRE_MAXIMA didn't make sense, GAP things not
working.



1 items had failures:
   1 of   9 in __main__.example_0
***Test Failed*** 1 failures.
For whitespace errors, see the file tmptest/parigp_3500.py
 [30.9 s]
sage -t  "devel/sage/sage/tests/startup.py"
  4 [main] python2.7 1368 C:\cygwin\home\newsagetest
\sage-5.4.rc0\local\bin\
python2.7.exe: *** fatal error - unable to remap \\?\C:\cygwin\home
\newsagetest\  sage-5.4.rc0\devel\sage-
main\build\sage\rings\polynomial\plural.dll to same
addr  ess as parent: 0x1E88 !=
0x1E8A
Stack trace:
Frame Function  Args
002281A8  6102796B  (002281A8, , , 0208)
00228498  6102796B  (6117EC60, 8000, , 61180977)
002294C8  61004F1B  (611A7FAC, 6125B6CC, 1E88, 1E8A)
End of stack trace
  3 [main] python 3576 fork: child 1368 - died waiting for dll
loading, errn  o 11
2622942 [main] python2.7 2156 C:\cygwin\home\newsagetest
\sage-5.4.rc0\local\bin\
python2.7.exe: *** fatal error - unable to remap \\?\C:\cygwin\home
\newsagetest\  sage-5.4.rc0\devel\sage-
main\build\sage\rings\polynomial\plural.dll to same
addr  ess as parent: 0x1E88 !=
0x1E8A
Stack trace:
Frame Function  Args
002281E8  6102796B  (002281E8, , , 0208)
002284D8  6102796B  (6117EC60, 8000, , 61180977)
00229508  61004F1B  (611A7FAC, 6125B6CC, 1E88, 1E8A)
End of stack trace
3023972 [main] python 3576 fork: child 2156 - died waiting for dll
loading, errn  o 11


1 items had failures:
 156 of 191 in __main__.example_1
***Test Failed*** 156 failures.
Traceback (most recent call last):
  File "tmptest/cmdline_2888.py", line 610, in 
quit_sage(verbose=False)
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python/site-packages/
sage/all.p  y", line 260, in quit_sage
from twisted.internet import reactor
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/reactor.py", line 37, in

from twisted.internet import default
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/default.py", line 56, in

install = _getInstallFunction(platform)
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/default.py", line 48, in
_g  etInstallFunction
from twisted.internet.pollreactor import install
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/pollreactor.py", line 23,
i  n 
from twisted.internet import posixbase
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/posixbase.py", line 55,
in   
from twisted.internet import fdesc, process, _signals
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/process.py", line 103, in
<  module>
detectLinuxBrokenPipeBehavior()
  File "/home/newsagetest/sage-5.4.rc0/local/lib/python2.7/site-
packages/Twisted  -12.1.0-py2.7-
cygwin-1.7.9-i686.egg/twisted/internet/process.py", line 93, in
de  tectLinuxBrokenPipeBehavior
reads, writes, exes = select.select([w], [], [], 0)
ValueError: filedescriptor out of range in select()



The following tests failed:


sage -t  "devel/sage/sage/algebras/group_algebra.py"
sage -t  "devel/sage/sage/algebras/group_algebra_new.py" #
Time out
sage -t  "devel/sage/sage/algebras/iwahori_hecke_algebra.py" #
Time out
sage -t  "devel/sage/sage/algebras/nil_coxeter_algebra.py"
sage -t  "devel/sage/sage/algebras/quatalg/
quaternion_algebra.py"
sage -t  "devel/sage/sage/algebras/quatalg/
quaternion_algebra_element.py  x"
sage -t  "devel/sage/sage/algebras/
quaternion_algebra_element.py"
sage -t

[sage-devel] The Larch Environment - toward visual interaction with Sage?

2012-10-10 Thread Nicolas M. Thiery
On Fri, Sep 28, 2012 at 02:59:14PM -0500, Jason Grout wrote:
> Fernando posted this (below) on the IPython-dev list.  This looks
> like a really impressive take on how to interact with Python code.
> It's using Jython, so not immediately usable for us.  But if we
> could do these things from the notebook...  (I've been thinking a
> lot about how to do these sorts of things from the notebook.)

Wow, impressive! I have been dreaming of just that for years.

Sage-Combinat people: you should really watch the video, and think
about all the doors it opens in term of interactive exploration of
combinatorial objects. If we could have such features for Sage,
through larch, spyder, improvements to the notebook, or any other
approach, that would be a *breakthrough* in our way of interacting
with Sage, using it for teaching, conducting experiments, ...

Cheers,
Nicolas


 Original Message 
Subject: [IPython-dev] The Larch Environment - anyone seen this before?
Date: Fri, 28 Sep 2012 12:28:42 -0700
From: Fernando Perez 
Reply-To: IPython developers list 
To: IPython Development list 

https://sites.google.com/site/larchenv/

obviously lots of similarities with the notebook, and some very
interesting ideas about rich input that seem to be well implemented.
It's a java/jython tool internally.  I hadn't seen it before.

--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: Cygwin on XP attempt

2012-10-10 Thread kcrisman
Incidentally, I can't find the full test log in SAGE_TESTDIR - does it
exist, and where is it?  Again, a cursory reading of the developer
guide doesn't seem to have this info, but it's probably there.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] SearchForest and post_process...

2012-10-10 Thread Florent Hivert
  Hi There,

Thanks to Nicolas the Little, Sage has a SearchForest class. It is a very nice
tools to iterate through sets defined by a recursive choice
tree. Unfortunately, currently due to the name someone who doesn't know that
it exists has no chance to find it. It seems that there is an agreement that
the mane should be changed but we didn't yet find a good one. Let me describe
a little what it does (please refer to the doc for more informations and
examples):

The enumerated set is mostly described by two data:
  - roots which are the starting nodes of the recursive generation
  - children with compute the immediate successors of a node in the generation
tree.
One can also provide a post_process function that allows for customizing the
nodes that are actually produced. Furthermore, if it returns None, then the
node won't be output at all.

I'd like to gather proposal and find an agreement on the names for
SearchForest and post_process.

Here are some proposal for search forest:
 - TreeGeneratedSet
 - ForestGeneratedSet
 - RecursivelyGeneratedSet
 - ChoiceTree
 - ChoiceForest
...

Nathann Cohen suggested to rename post_process with map_function, underlying
the fact that post_process is mapped on the sets of node of the tree. I'd like
to have a vote on this rename, possibly with alternative proposal.

\begin{pub}
I'm finishing to polish a class named currently
{{{SearchForestMapReduce}}} which allows to apply in a parallel and
distributed way a map-reduce scheme on the node generated by a such a
forest. For example, here's the Sage code for binary words of length less
or equal that 16:

  sage: S = SearchForest(
  ... roots = [[]],
  ... children = lambda l: [l+[0], l+[1]] if len(l) < 16 else [])
  sage: S.map_reduce(
  ... map_function = lambda z: x**len(z),
  ... reduce_function = lambda x,y: x+y,
  ... reduce_init = 0 )
  65536*x^16 + 32768*x^15 + 16384*x^14 + 8192*x^13 + 4096*x^12 + 2048*x^11 
+ 1024*x^10 + 512*x^9 + 256*x^8 + 128*x^7 + 64*x^6 + 32*x^5 + 16*x^4 + 8*x^3 + 
4*x^2 + 2*x + 1
\end{pub}

Thanks for your suggestions,

Florent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: SearchForest and post_process...

2012-10-10 Thread Simon King
Hi Florent,

On 2012-10-10, Florent Hivert  wrote:
> The enumerated set is mostly described by two data:
>   - roots which are the starting nodes of the recursive generation
>   - children with compute the immediate successors of a node in the generation
> tree.
> One can also provide a post_process function that allows for customizing the
> nodes that are actually produced. Furthermore, if it returns None, then the
> node won't be output at all.
>
> I'd like to gather proposal and find an agreement on the names for
> SearchForest and post_process.
>
> Here are some proposal for search forest:
>  - TreeGeneratedSet
>  - ForestGeneratedSet
>  - RecursivelyGeneratedSet

Why not "RecursiveSet"? The word "Generated" seems redundant to me.

And what you tell about the role of "post_process" makes me think it could be
renamed into "branch_cut".

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] Re: SearchForest and post_process...

2012-10-10 Thread Nicolas Borie

Le 10/10/2012 15:53, Simon King a écrit :


Why not "RecursiveSet"? The word "Generated" seems redundant to me.

And what you tell about the role of "post_process" makes me think it could be
renamed into "branch_cut".

Best regards,
Simon

Hello,

The post_process hardly depend on a fonction (placed in itertools of 
sage) which is "imap_and_filter_none". There are two points on this 
output processing : you cut branches and you also apply an output 
fonction...


I like the Set suffix for the name. As the feature returns a parent with 
category, it seems fine for me the name should be close to blablablaSet. 
IMHO, the feature accept multiples roots but no one would search for 
"forest", we naturally search for Tree, TreeLikeStruture, ...


In an other directions, we should make a micro patch to modify the 
documentation of EnumeratedSet, FiniteEnumeratedSet, ...Set to advertise 
the user of the existance of the searchForest (old name) feature. I 
don't know if sphnix accept such references... Just putting in other doc 
: for set defined with roots and a children fonction, 
see:/SearchForest. Perhaps also, the code should be moved out from 
bactrack.py...


Cheers,
Nicolas B.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: SearchForest and post_process...

2012-10-10 Thread Jason Grout

On 10/10/12 8:53 AM, Simon King wrote:

And what you tell about the role of "post_process" makes me think it could be
renamed into "branch_cut".


Or it could renamed "visit" or "trim" or even just "callback"

Jason


--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread Dima Pasechnik


On Wednesday, 10 October 2012 18:53:03 UTC+8, John Cremona wrote:
>
> This is very strange indeed. 
>
> Installing the optional database will certainly affect some elliptic 
> curve tests, and we have gradually eliminated the ones which are so 
> affected, or marked hem as optional.  But as far as I no, there is no 
> place in the elliptic curve code where GAP is used. 
>

oops, it appears that I cannot reproduce this on a clean install.
Must be some weirdness coming from pre-existing installations, I 
don't have any other explanation.

 

>
> Could you post one specific example of a failing test? 
>

It looked as follows:

File "/usr/local/src/sage/sage-5.4.rc0/devel/sage/sage/groups/generic.py", 
line 253:
sage: E=EllipticCurve('389a1')
Exception raised:
Traceback (most recent call last):
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py", line 
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/sagedoctest.py", 
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, 
compileflags)
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py", line 
1172, in run_one_example
compileflags, 1) in test.globs
  File "", line 1, in 
E=EllipticCurve('389a1')###line 253:
sage: E=EllipticCurve('389a1')
  File 
"/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/schemes/elliptic_curves/constructor.py",
 
line 345, in EllipticCurve
return ell_rational_field.EllipticCurve_rational_field(x)
  File 
"/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/schemes/elliptic_curves/ell_rational_field.py",
 
line 208, in __init__
X = sage.databases.cremona.CremonaDatabase()[label]
  File 
"/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/databases/cremona.py",
 
line 1569, in CremonaDatabase
_db = LargeCremonaDatabase(name)
  File 
"/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/databases/cremona.py",
 
line 1325, in __init__
+ 'not appear to be a valid SQL Cremona database.')
RuntimeError: Database at 
/usr/local/src/sage/sage-5.4.rc0/local/share/cremona/cremona.db does not 
appear to be a valid SQL Cremona database.
**
File "/usr/local/src/sage/sage-5.4.rc0/devel/sage/sage/groups/generic.py", 
line 254:
sage: P=E(-1,1)
Exception raised:
Traceback (most recent call last):
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py", line 
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/sagedoctest.py", 
line 38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename, 
compileflags)
  File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py", line 
1172, in run_one_example
compileflags, 1) in test.globs
  File "", line 1, in 
P=E(-Integer(1),Integer(1))###line 254:
sage: P=E(-1,1)
NameError: name 'E' is not defined

(just to prove I wasn't daydreaming :-))
 

Dima


> The optional spkg is 134M (and is steadily growing at the moment) so I 
> don't think that making it standard is sensible, even if it is the 
> first spkg I install every time a new Sage is released! 
>
> John 
>
> On 10 October 2012 11:12, Dima Pasechnik > 
> wrote: 
> > 
> > 
> > On Wednesday, 10 October 2012 18:06:36 UTC+8, Jeroen Demeyer wrote: 
> >> 
> >> On 2012-10-10 11:58, Dima Pasechnik wrote: 
> >> > Many tests (with new gap-4.5 spkgs at #13211) in doctest 
> >> > sage/groups/generic.py fail if database_cremona_ellcurve, 
> >> > which is an optional package, is not installed. 
> >> > I wonder why these tests are not marked as optional. 
> >> 
> >> If these are tests introduced by #13211, then they should be marked 
> >> optional in that ticket. 
> > 
> > 
> > no, these tests were always there. I have no idea why this started to 
> play 
> > up. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-devel" group. 
> > To post to this group, send email to 
> > sage-...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > sage-devel+...@googlegroups.com . 
> > Visit this group at http://groups.google.com/group/sage-devel?hl=en. 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: Cygwin on XP attempt

2012-10-10 Thread John H Palmieri
On Wednesday, October 10, 2012 5:31:56 AM UTC-7, kcrisman wrote:
>
> Incidentally, I can't find the full test log in SAGE_TESTDIR - does it 
> exist, and where is it?  Again, a cursory reading of the developer 
> guide doesn't seem to have this info, but it's probably there. 
>

When running doctests with "sage -t ..." or "sage -tp ...", I don't think a 
log file is created. You get one when you do "make test" or "make 
ptestlong", etc.: look at the Makefile to see the command used to create 
the log file.

-- 
John
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] database_cremona_ellcurve required to doctest sage/groups/generic.py

2012-10-10 Thread R. Andrew Ohana
See trac.sagemath.org/12341, that patch needs to be rebased (SAGE_DATA ->
SAGE_SHARE), but otherwise it should fix this issue.

On Wed, Oct 10, 2012 at 7:53 AM, Dima Pasechnik  wrote:

>
>
> On Wednesday, 10 October 2012 18:53:03 UTC+8, John Cremona wrote:
>>
>> This is very strange indeed.
>>
>> Installing the optional database will certainly affect some elliptic
>> curve tests, and we have gradually eliminated the ones which are so
>> affected, or marked hem as optional.  But as far as I no, there is no
>> place in the elliptic curve code where GAP is used.
>>
>
> oops, it appears that I cannot reproduce this on a clean install.
> Must be some weirdness coming from pre-existing installations, I
> don't have any other explanation.
>
>
>
>>
>> Could you post one specific example of a failing test?
>>
>
> It looked as follows:
>
> File "/usr/local/src/sage/sage-5.4.rc0/devel/sage/sage/groups/generic.py",
> line 253:
> sage: E=EllipticCurve('389a1')
> Exception raised:
> Traceback (most recent call last):
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py",
> line 1231, in run_one_test
> self.run_one_example(test, example, filename, compileflags)
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/sagedoctest.py",
> line 38, in run_one_example
> OrigDocTestRunner.run_one_example(self, test, example, filename,
> compileflags)
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py",
> line 1172, in run_one_example
> compileflags, 1) in test.globs
>   File "", line 1, in 
> E=EllipticCurve('389a1')###line 253:
> sage: E=EllipticCurve('389a1')
>   File
> "/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/schemes/elliptic_curves/constructor.py",
> line 345, in EllipticCurve
> return ell_rational_field.EllipticCurve_rational_field(x)
>   File
> "/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/schemes/elliptic_curves/ell_rational_field.py",
> line 208, in __init__
> X = sage.databases.cremona.CremonaDatabase()[label]
>   File
> "/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/databases/cremona.py",
> line 1569, in CremonaDatabase
> _db = LargeCremonaDatabase(name)
>   File
> "/usr/local/src/sage/sage-5.4.rc0/local/lib/python/site-packages/sage/databases/cremona.py",
> line 1325, in __init__
> + 'not appear to be a valid SQL Cremona database.')
> RuntimeError: Database at
> /usr/local/src/sage/sage-5.4.rc0/local/share/cremona/cremona.db does not
> appear to be a valid SQL Cremona database.
> **
> File "/usr/local/src/sage/sage-5.4.rc0/devel/sage/sage/groups/generic.py",
> line 254:
> sage: P=E(-1,1)
> Exception raised:
> Traceback (most recent call last):
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py",
> line 1231, in run_one_test
> self.run_one_example(test, example, filename, compileflags)
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/sagedoctest.py",
> line 38, in run_one_example
> OrigDocTestRunner.run_one_example(self, test, example, filename,
> compileflags)
>   File "/usr/local/src/sage/sage-5.4.rc0/local/bin/ncadoctest.py",
> line 1172, in run_one_example
> compileflags, 1) in test.globs
>   File "", line 1, in 
> P=E(-Integer(1),Integer(1))###line 254:
> sage: P=E(-1,1)
> NameError: name 'E' is not defined
>
> (just to prove I wasn't daydreaming :-))
>
>
> Dima
>
>
>> The optional spkg is 134M (and is steadily growing at the moment) so I
>> don't think that making it standard is sensible, even if it is the
>> first spkg I install every time a new Sage is released!
>>
>> John
>>
>> On 10 October 2012 11:12, Dima Pasechnik  wrote:
>> >
>> >
>> > On Wednesday, 10 October 2012 18:06:36 UTC+8, Jeroen Demeyer wrote:
>> >>
>> >> On 2012-10-10 11:58, Dima Pasechnik wrote:
>> >> > Many tests (with new gap-4.5 spkgs at #13211) in doctest
>> >> > sage/groups/generic.py fail if database_cremona_ellcurve,
>> >> > which is an optional package, is not installed.
>> >> > I wonder why these tests are not marked as optional.
>> >>
>> >> If these are tests introduced by #13211, then they should be marked
>> >> optional in that ticket.
>> >
>> >
>> > no, these tests were always there. I have no idea why this started to
>> play
>> > up.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sage-devel" group.
>> > To post to this group, send email to sage-...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > sage-devel+...@**googlegroups.com.
>> > Visit this group at 
>> > http://groups.google.com/**group/sage-devel?hl=en.
>>
>> >
>> >
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To post 

[sage-devel] Re: [sage-combinat-devel] Re: SearchForest and post_process...

2012-10-10 Thread Florent Hivert
   Hi Simon,

> On 2012-10-10, Florent Hivert  wrote:
> > I'd like to gather proposal and find an agreement on the names for
> > SearchForest and post_process.
> 
> I don't know if my answer to sage-devel will automatically appear here
> as well. If not: I suggested "RecursiveSet" and "branch_cut" as new
> names for SearchForest and post_process (though I am not so sure if
> "branch_cut" is the actual purpose of post_process).

Thanks for your suggestion. Actually "branch_but" doesn't describe what
"post_process" does. Cutting branch is done by children. The precise
description of the purpose of post_process is the following:

Through roots and children we are given a recursive tree of nodes n. From this
tree we want to derive a set S. First of all, often we need to apply a certain
function f(n) to compute the actual element of S. So in this sense we are just
applying a map f to the set of the node. On the other hand sometimes, all the
nodes are used to build element of S. Sometime only certain node are kept (eg
leaves), the other node are just intermediate steps of the recursion. In this
case f can return None to indicate that no element of s is associated to the
node n.

For example, suppose that you want to iterate through all permutations of a
given set S. One solution is to take element of S one by one an to insert them
at every position. So a node contains two informations
  - the list lst of already inserted element
  - the set st of the yet to be inserted element
You want to generate a permutation only if st is empty (leaves on the
tree). Also instead of list you may want to generate tuples. Here is the code:

sage: def children((lst, st)):
...   st = set(st) # make a copy
...   if st:
...  el = st.pop()
...  for i in range(0, len(lst)+1):
...  yield (lst[0:i]+[el]+lst[i:], st)
sage: list(children(([1,2], {3,7,9})))
[([9, 1, 2], set([3, 7])), ([1, 9, 2], set([3, 7])), ([1, 2, 9], set([3, 
7]))]
sage: S = SearchForest( [([], {1,3,6,8})],
...   children,
...   post_process = lambda (l, s): tuple(l) if not s else None, 
...   category=FiniteEnumeratedSets())
sage: S.list()
[(6, 3, 1, 8), (3, 6, 1, 8), (3, 1, 6, 8), (3, 1, 8, 6), (6, 1, 3, 8), (1, 
6, 3, 8), (1, 3, 6, 8), (1, 3, 8, 6), (6, 1, 8, 3), (1, 6, 8, 3), (1, 8, 6, 3), 
(1, 8, 3, 6), (6, 3, 8, 1), (3, 6, 8, 1), (3, 8, 6, 1), (3, 8, 1, 6), (6, 8, 3, 
1), (8, 6, 3, 1), (8, 3, 6, 1), (8, 3, 1, 6), (6, 8, 1, 3), (8, 6, 1, 3), (8, 
1, 6, 3), (8, 1, 3, 6)]
sage: S.cardinality()
24

By the way, I'm adding this to the documentation ;-)

Nathann is suggesting to call post_process "map_function" because we just map
it on the node, dropping the None results.

I hope it is more clear,

Cheers,

Florent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




[sage-devel] Re: Cygwin on XP attempt

2012-10-10 Thread kcrisman


On Wednesday, October 10, 2012 11:04:43 AM UTC-4, John H Palmieri wrote:
>
> On Wednesday, October 10, 2012 5:31:56 AM UTC-7, kcrisman wrote:
>>
>> Incidentally, I can't find the full test log in SAGE_TESTDIR - does it 
>> exist, and where is it?  Again, a cursory reading of the developer 
>> guide doesn't seem to have this info, but it's probably there. 
>>
>
> When running doctests with "sage -t ..." or "sage -tp ...", I don't think 
> a log file is created. You get one when you do "make test" or "make 
> ptestlong", etc.: look at the Makefile to see the command used to create 
> the log file.
>
> Thanks.

Hmm, is that a bug that a log file is not created otherwise (or at least 
the option)?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.




Re: [sage-devel] Sage doctesting on shared systems insecure (#13579)

2012-10-10 Thread Maarten Derickx
Maybe it can be fixed by using:

from __future__ import absolute_import

I at least know that python 3 fixed some issues caused by relative imports. 
But I'm not 100% sure if this problem is also solved.

Le mercredi 10 octobre 2012 14:14:22 UTC+2, Jeroen Demeyer a écrit :
>
> On 2012-10-10 13:59, John Cremona wrote: 
> > Would it not be a good idea to disable testing this file (or the bad 
> > part in it) until this has been fixed?  In all future testing & 
> > development releases? 
> The idea is *not* to do any further releases until this gets sorted out. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.