Bug 1749881 - Patch to work with Fedora sagemath package
Summary: Patch to work with Fedora sagemath package
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: cantor
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-06 16:05 UTC by Paulo Andrade
Modified: 2019-09-06 16:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-06 16:55:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
cantor-sagemath-python3.patch (1.14 KB, patch)
2019-09-06 16:05 UTC, Paulo Andrade
no flags Details | Diff

Description Paulo Andrade 2019-09-06 16:05:08 UTC
Created attachment 1612463 [details]
cantor-sagemath-python3.patch

The attached patch works with both the upstream sagemath
that uses python2, and with the Fedora rpm package that uses
python3. A minor extra patch will be added in the sagemath
package for full functionality.

  Please also consider adding the patch to the supported
Fedora releases.

Comment 1 Rex Dieter 2019-09-06 16:09:01 UTC
Wouldn't this be more useful submitted to cantor upstream?  (then everyone would benefit, not just fedora).

Futher, it's not clear why this patch is needed, can you provide some sort of justification/reason?

Comment 2 Paulo Andrade 2019-09-06 16:32:44 UTC
 The patch can be simplified a bit, can just write:

print('____TMP_DIR____', sage.misc.misc.SAGE_TMP)

instead of

print(\"%s %s\" % ('____TMP_DIR____', sage.misc.misc.SAGE_TMP))

The problem is that with python3 syntax:

$ python3 -c 'print 1, 2'
  File "<string>", line 1
    print 1, 2
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(1, 2)?
$ python3 -c 'print(1, 2)'
1 2

Currently I believe only Fedora is building a sagemath package with python3.

I will report the problem upstream.
Another cool feature could be to add an entry to use local documentation,
instead of from www.sagemath.org. Will include the request on the upstream
bug report.

Comment 3 Paulo Andrade 2019-09-06 16:55:04 UTC
Main issue reported at:
https://bugs.kde.org/show_bug.cgi?id=411645
[Make sagemath backend compatible with sagemath built with python3]

Second issue reported at:
https://bugs.kde.org/show_bug.cgi?id=411646
[Please consider adding a configuration to use local sagemath documentation]


Note You need to log in before you can comment on or make changes to this bug.