Bug 974769

Summary: [abrt] sympy-0.7.1-3.fc18: posixpath.py:68:join:AttributeError: 'NoneType' object has no attribute 'endswith'
Product: [Fedora] Fedora Reporter: tkit <ch199405>
Component: sagemathAssignee: Paulo Andrade <paulo.cesar.pereira.de.andrade>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: ch199405, h.rosemarin, loganjerry, paulo.cesar.pereira.de.andrade, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:865598d594bf820a76e91c161e2d0075987ead85
Fixed In Version: sagemath-5.9-6.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-23 00:33:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 866044    
Attachments:
Description Flags
File: backtrace
none
File: core_backtrace
none
File: dso_list
none
File: environ none

Description tkit 2013-06-15 16:02:03 UTC
Version-Release number of selected component:
sympy-0.7.1-3.fc18

Additional info:
reporter:       libreport-2.1.4
cmdline:        /usr/bin/python /usr/bin/isympy
executable:     /usr/bin/isympy
kernel:         3.9.4-200.fc18.x86_64
runlevel:       N 5
uid:            1000

Truncated backtrace:
posixpath.py:68:join:AttributeError: 'NoneType' object has no attribute 'endswith'

Traceback (most recent call last):
  File "/usr/bin/isympy", line 162, in <module>
    main()
  File "/usr/bin/isympy", line 158, in main
    from sympy.interactive import init_session
  File "/usr/lib/python2.7/site-packages/sympy/__init__.py", line 20, in <module>
    from sympy.core import *
  File "/usr/lib/python2.7/site-packages/sympy/core/__init__.py", line 8, in <module>
    from expr import Expr, AtomicExpr
  File "/usr/lib/python2.7/site-packages/sympy/core/expr.py", line 4, in <module>
    from evalf import EvalfMixin
  File "/usr/lib/python2.7/site-packages/sympy/core/evalf.py", line 6, in <module>
    import mpmath.libmp as libmp
  File "/usr/lib/python2.7/site-packages/mpmath/__init__.py", line 6, in <module>
    from .ctx_mp import MPContext
  File "/usr/lib/python2.7/site-packages/mpmath/ctx_mp.py", line 48, in <module>
    from sage.libs.mpmath.ext_main import Context as BaseMPContext
  File "integer.pxd", line 9, in init sage.libs.mpmath.ext_main (sage/libs/mpmath/ext_main.c:27731)
  File "integer.pyx", line 178, in init sage.rings.integer (sage/rings/integer.c:38301)
  File "/usr/lib64/python2.7/site-packages/sage/rings/infinity.py", line 203, in <module>
    import sage.rings.rational
  File "fast_arith.pxd", line 5, in init sage.rings.rational (sage/rings/rational.c:27576)
  File "fast_arith.pyx", line 51, in init sage.rings.fast_arith (sage/rings/fast_arith.c:7830)
  File "integer_ring.pyx", line 66, in init sage.rings.integer_ring (sage/rings/integer_ring.c:11999)
  File "/usr/lib64/python2.7/site-packages/sage/rings/ideal.py", line 36, in <module>
    from sage.interfaces.singular import singular as singular_default
  File "/usr/lib64/python2.7/site-packages/sage/interfaces/singular.py", line 334, in <module>
    from expect import Expect, ExpectElement, FunctionElement, ExpectFunction
  File "/usr/lib64/python2.7/site-packages/sage/interfaces/expect.py", line 51, in <module>
    import cleaner
  File "/usr/lib64/python2.7/site-packages/sage/interfaces/cleaner.py", line 17, in <module>
    import sage.misc.misc as misc
  File "/usr/lib64/python2.7/site-packages/sage/misc/misc.py", line 2082, in <module>
    import sage.server.support
  File "/usr/lib64/python2.7/site-packages/sage/server/support.py", line 19, in <module>
    import sage.misc.sagedoc as sagedoc
  File "/usr/lib64/python2.7/site-packages/sage/misc/sagedoc.py", line 1434, in <module>
    browse_sage_doc = _sage_doc()
  File "/usr/lib64/python2.7/site-packages/sage/misc/sagedoc.py", line 1221, in __init__
    self._base_path = os.path.join(SAGE_DOC, "output/html/en/")
  File "/usr/lib64/python2.7/posixpath.py", line 68, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Local variables in innermost frame:
a: None
path: None
b: 'output/html/en/'
p: ('output/html/en/',)

Comment 1 tkit 2013-06-15 16:02:07 UTC
Created attachment 761635 [details]
File: backtrace

Comment 2 tkit 2013-06-15 16:02:10 UTC
Created attachment 761636 [details]
File: core_backtrace

Comment 3 tkit 2013-06-15 16:02:13 UTC
Created attachment 761637 [details]
File: dso_list

Comment 4 tkit 2013-06-15 16:02:19 UTC
Created attachment 761638 [details]
File: environ

Comment 5 Jerry James 2013-06-17 23:12:37 UTC
Since the stack trace goes into sagemath files and then chokes on an apparently sagemath-related name, I am reassigning this to the sagemath component.  Paulo, do you have any idea what is happening here?

I can get the same result on Fedora 18 like this, by the way:

$ python
Python 2.7.3 (default, Aug  9 2012, 17:23:57) 
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mpmath

Comment 6 Paulo Andrade 2013-06-19 00:34:44 UTC
Apparently this problem reappeared (now in Fedora)
http://code.google.com/p/mpmath/issues/detail?id=215

Comment 7 Jerry James 2013-07-15 20:14:43 UTC
*** Bug 983252 has been marked as a duplicate of this bug. ***

Comment 8 Thomas Spura 2013-07-25 08:45:37 UTC
Same problem here.

Does it makes sense to patch sage.env to use the correct Fedora-specific install directories? E.g.:

$ diff -ur /usr/lib64/python2.7/site-packages/sage/env.py env.py 
--- /usr/lib64/python2.7/site-packages/sage/env.py	2013-07-25 10:38:11.196114919 +0200
+++ env.py	2013-07-25 10:38:05.885120763 +0200
@@ -43,7 +43,7 @@
         'SAGE_PACKAGES'    : opj('$SAGE_ROOT', 'spkg'),
         'SAGE_LOGS'        : opj('$SAGE_ROOT', 'logs', 'pkgs'),
         'SAGE_SPKG_INST'   : opj('$SAGE_ROOT', 'spkg', 'installed'),
-        'SAGE_DOC'         : "/usr/share/doc/sagemath-5.9",
+        'SAGE_DOC'         : opj('$SAGE_ROOT', 'devel', 'sage', 'doc'),
         'DOT_SAGE'         : opj(os.environ.get('HOME','$SAGE_ROOT'), '.sage'),
         # SAGE_LIB is the site-packages directory if the sage library
         # has been installed, otherwise it is the same of SAGE_SRC

Before "iptest" was crashing because SAGE_DOC wasn't the valid doc install directory, after this patch it is failing because of SAGE_LOCAL.

After installing sagemath-devel (that dependency seems to be missing then too) and the following patch "iptest" seems to be working:

$ diff -u env.py /usr/lib64/python2.7/site-packages/sage/env.py
--- env.py	2013-07-25 10:38:05.885120763 +0200
+++ /usr/lib64/python2.7/site-packages/sage/env.py	2013-07-25 10:42:35.553824133 +0200
@@ -34,8 +34,8 @@
         'LOCAL_IDENTIFIER' : '$HOSTNAME.%s'%os.getpid(),
 
         # bunch of sage directories and files
-        'SAGE_ROOT'        : None,
-        'SAGE_LOCAL'       : opj('$SAGE_ROOT', 'local'),
+        'SAGE_ROOT'        : "/usr",
+        'SAGE_LOCAL'       : opj('$SAGE_ROOT'),
         'SAGE_SHARE'       : opj('$SAGE_LOCAL', 'share'),
         # for backwards compatibility we include SAGE_DATA
         'SAGE_DATA'        : '$SAGE_SHARE',
@@ -43,7 +43,7 @@
         'SAGE_PACKAGES'    : opj('$SAGE_ROOT', 'spkg'),
         'SAGE_LOGS'        : opj('$SAGE_ROOT', 'logs', 'pkgs'),
         'SAGE_SPKG_INST'   : opj('$SAGE_ROOT', 'spkg', 'installed'),
-        'SAGE_DOC'         : opj('$SAGE_ROOT', 'devel', 'sage', 'doc'),
+        'SAGE_DOC'         : opj('$SAGE_ROOT', 'share', 'doc', 'sagemath-5.9'),
         'DOT_SAGE'         : opj(os.environ.get('HOME','$SAGE_ROOT'), '.sage'),
         # SAGE_LIB is the site-packages directory if the sage library
         # has been installed, otherwise it is the same of SAGE_SRC

Comment 9 Paulo Andrade 2013-08-12 18:53:02 UTC
Sorry for the very long delay looking into it again. I was
forgetting about it :-(
I will use a patch almost identical to Thomas suggestion,
basically only changing SAGE_ROOT definition to match what
other patches expect, %{_libdir}/sagemath, and where there
are other symlinks to system directories.

Comment 10 Fedora Update System 2013-08-12 20:52:21 UTC
sagemath-5.9-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/sagemath-5.9-6.fc18

Comment 11 Fedora Update System 2013-08-12 20:59:23 UTC
sagemath-5.9-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/sagemath-5.9-6.fc19

Comment 12 Fedora Update System 2013-08-15 02:35:46 UTC
Package sagemath-5.9-6.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing sagemath-5.9-6.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-14696/sagemath-5.9-6.fc18
then log in and leave karma (feedback).

Comment 13 Fedora Update System 2013-08-23 00:33:07 UTC
sagemath-5.9-6.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2013-08-23 00:42:20 UTC
sagemath-5.9-6.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.