William Stein wrote: >> ValueError: invalid literal for float(): ^[[0;31m >> ^[[0m2.3896350000000002 >> ********************************************************************** >> 1 items had failures: >> 2 of 3 in __main__.example_2 >> ***Test Failed*** 2 failures. >> For whitespace errors, see the file .doctest_sage0.py >> [9.3 s] >> exit code: 256 >> >> Seems you are right! > > Bummer. OK, following http://www.thescripts.com/forum/thread167794.html could > you try replacing return float(self.eval('cputime(%s)'%t)) by > > aString = self.eval('cputime(%s)'%t) > IDENTITY_MAP = ''.join([chr(x) for x in range(256)]) > BAD_MAP = ''.join([chr(x) for x in range(32) + [124]) ^^ > aNewString = aString.translate(IDENTITY_MAP, BAD_MAP) > return float(aNewString) >
I put in: aString = self.eval('cputime(%s)'%t) IDENTITY_MAP = ''.join([chr(x) for x in range(256)]) BAD_MAP = ''.join([chr(x) for x in range(32) + [124]]) aNewString = aString.translate(IDENTITY_MAP, BAD_MAP) return float(aNewString) > and let me know what happens. If this works, it will at least make it > clear how we can fix the problem... I guess. > Got this: sage: Exiting SAGE (CPU time 0m0.00s, Wall time 0m3.60s). [EMAIL PROTECTED] sage-2.10.1.rc0]$ ./sage -t devel/sage-main/sage/interfaces/sage0.py 2>&1 | tee -a test_sage0.log sage -t devel/sage-main/sage/interfaces/sage0.py ********************************************************************** File "sage0.py", line 143: sage: _= sage0.cputime() # random output Exception raised: Traceback (most recent call last): File "/home/jaap/downloads/sage-2.10.1.rc0/local/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "<doctest __main__.example_2[0]>", line 1, in <module> _= sage0.cputime() # random output###line 143: sage: _= sage0.cputime() # random output File "/home/jaap/downloads/sage-2.10.1.rc0/local/lib/python2.5/site-packages/sage/interfaces/sage0.py", line 154, in cputime return float(aNewString) ValueError: invalid literal for float(): [0;31m [0m1.962701 ********************************************************************** File "sage0.py", line 147: sage: _= sage0.cputime() # random output Exception raised: Traceback (most recent call last): File "/home/jaap/downloads/sage-2.10.1.rc0/local/lib/python2.5/doctest.py", line 1212, in __run compileflags, 1) in test.globs File "<doctest __main__.example_2[2]>", line 1, in <module> _= sage0.cputime() # random output###line 147: sage: _= sage0.cputime() # random output File "/home/jaap/downloads/sage-2.10.1.rc0/local/lib/python2.5/site-packages/sage/interfaces/sage0.py", line 154, in cputime return float(aNewString) ValueError: invalid literal for float(): [0;31m [0m2.5486119999999999 ********************************************************************** 1 items had failures: 2 of 3 in __main__.example_2 ***Test Failed*** 2 failures. For whitespace errors, see the file .doctest_sage0.py [11.1 s] exit code: 256 I seems not all characters are caught. > I wonder if the notebook works kind of funky for you on that > same computer? I mean, if there are funny control codes everywhere > in sage0, then that would impact the notebook as well, possibly. > This test first failed in sage-2.10.1.alpha1. As did the notebook() with gnutls related problems. I removed the alpha0, but on sage-2.10, I got sage -t devel/sage-main/sage/interfaces/sage0.py ^[[?1034h [23.4 s] ------------------------------------------------ Note the strange characters, or are they intentionally there? Jaap --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---