Bug 316299 - Doesn't work with Sage 5.8
Summary: Doesn't work with Sage 5.8
Status: RESOLVED FIXED
Alias: None
Product: cantor
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Rieder
URL:
Keywords:
: 323372 325203 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-07 11:20 UTC by Antonio Rojas
Modified: 2014-01-29 19:00 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ipython configuration (128 bytes, text/plain)
2013-05-03 09:20 UTC, Antonio Rojas
Details
fix for sage 5.8 (838 bytes, patch)
2013-05-03 10:34 UTC, Antonio Rojas
Details
Fix for sage 5.8, v2 (1.54 KB, patch)
2013-05-03 14:34 UTC, Antonio Rojas
Details
preliminary fix (5.43 KB, patch)
2013-05-25 16:13 UTC, Alexander Rieder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Rojas 2013-03-07 11:20:15 UTC
After updating Sage to 5.7, tab completion stops working in the worksheets. I get this error in the command line:

AttributeError                            Traceback (most recent call last)
<ipython-input-24-1824bd036cbd> in <module>()
----> 1 __hist_tmp__=_; __IPYTHON__.complete("A.e");_=__hist_tmp__

AttributeError: 'bool' object has no attribute 'complete'



Reproducible: Always
Comment 1 Antonio Rojas 2013-04-01 15:44:58 UTC
And the update to sage 5.8 completely breaks the sage backend...
Comment 2 Alexander Rieder 2013-04-01 20:11:33 UTC
You're right, it is completely broken at the moment. I don't yet know what has changed exactly, but I'll look into it. Thanks for reporting.
Comment 3 Antonio Rojas 2013-05-03 09:20:11 UTC
Created attachment 79659 [details]
ipython configuration

The breakage seems to be caused by the ipython prompt coloring interoduced in 5.8. Adding the attached contiguration file in ~/.sage/ipython-0.12/profile_sage/ (which disables colors) makes it work again. Tab completion is still broken though.
Comment 4 Antonio Rojas 2013-05-03 10:34:03 UTC
Created attachment 79660 [details]
fix for sage 5.8

This patch works for me with sage 5.8, but I haven't tested old sage versions
Comment 5 Antonio Rojas 2013-05-03 14:34:27 UTC
Created attachment 79668 [details]
Fix for sage 5.8, v2

And this one fixes tab completion too
Comment 6 Alexander Rieder 2013-05-05 23:13:06 UTC
Hi,
thank you for working on this, and sorry I didn't get back to you sooner.
Your fixes are correct, allthough (at least on my machine) I've hit several other problems with the newest sage version (the format returned by the complete command changed slightly, plotting needed some adjustments etc). I now have a quick and dirty fix for most of them, except I have a problem with enabling/disabling typesetting completely breaks the command history (the _ or __ variables). 
I hope I will have a fix for this soon (but am always open for suggestions).
Comment 7 Kevin Kofler 2013-05-24 15:10:50 UTC
> Your fixes are correct, allthough (at least on my machine) I've hit several other
> problems with the newest sage version (the format returned by the complete
> command changed slightly, plotting needed some adjustments etc). I now have a
> quick and dirty fix for most of them

Can we please see that fix?

> except I have a problem with enabling/disabling typesetting completely breaks the
> command history (the _ or __ variables).
> I hope I will have a fix for this soon (but am always open for suggestions).

And what's the update on this?

We now finally have SAGE in Fedora, but it's version 5.8 (older versions did not pass review due to bundled libraries, so we got the brand new 5.8 even in Fedora 18 updates) and so it doesn't work with Cantor at all right now. :-( We're going to apply the patch from comment #5, but we could use a more complete fix.
Comment 8 Alexander Rieder 2013-05-25 16:13:51 UTC
Created attachment 80071 [details]
preliminary fix

this is the current state of my work on this bug. sorry it took me so long to update.
The "_"-style variables still don't work, but I hope everything else is working again.
Please give it some testing. 
This probably breaks sage versions <5.8 so before it goes into the main repository i need to come up with a fallback mechanism.
Comment 9 Kevin Kofler 2013-05-29 23:30:48 UTC
I built updated Fedora packages of Cantor with the patch from comment #8 and I tested them today. I can confirm that the patch works fine with SAGE 5.8, and also 5.9 which hit Fedora 18 updates today.
Comment 10 Alexander Rieder 2013-06-23 21:14:44 UTC
Git commit 5374d305f68a30ad04e2d7bb64ba825b436afd1a by Alexander Rieder.
Committed on 23/06/2013 at 21:09.
Pushed by arieder into branch 'master'.

- fix sage backend for newer sage versions (>5.7)
- introduce a "legacy mode" for older versions, using the old commands

tested with sage v5.6 and 5.9

M  +52   -1    src/backends/sage/sagecompletionobject.cpp
M  +5    -0    src/backends/sage/sagecompletionobject.h
M  +8    -7    src/backends/sage/sageexpression.cpp
M  +77   -12   src/backends/sage/sagesession.cpp
M  +4    -2    src/backends/sage/sagesession.h

http://commits.kde.org/cantor/5374d305f68a30ad04e2d7bb64ba825b436afd1a
Comment 11 Alexander Rieder 2013-08-11 17:12:17 UTC
*** Bug 323372 has been marked as a duplicate of this bug. ***
Comment 12 Alexander Rieder 2013-09-23 18:34:57 UTC
*** Bug 325203 has been marked as a duplicate of this bug. ***