Bug 203592 - lang/python27: ImportError: ntpath cannot import name _unicode from genericpath
Summary: lang/python27: ImportError: ntpath cannot import name _unicode from genericpath
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-06 21:37 UTC by avatar4d
Modified: 2018-02-13 19:09 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (python)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description avatar4d 2015-10-06 21:37:46 UTC
I noticed that after updating my installed packages that SickRage was not functioning properly. The the following error was found in my SickRage error log:


2015-10-06 17:00:21 Thread-155 :: Failed doing webui callback: Traceback (most recent call last):
  File "/usr/local/sickrage/sickbeard/webserve.py", line 273, in async_call
    result = function(**kwargs)
  File "/usr/local/sickrage/sickbeard/webserve.py", line 1228, in displayShow
    t = PageTemplate(rh=self, file="displayShow.tmpl")
  File "/usr/local/sickrage/sickbeard/webserve.py", line 124, in __init__
    super(PageTemplate, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/Cheetah/Template.py", line 1259, in __init__
    self._compile(source, file, compilerSettings=compilerSettings)
  File "/usr/local/lib/python2.7/site-packages/Cheetah/Template.py", line 1553, in _compile
    keepRefToGeneratedCode=True)
  File "/usr/local/sickrage/sickbeard/webserve.py", line 168, in compile
    return super(PageTemplate, self).compile(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/Cheetah/Template.py", line 788, in compile
    exec(co, mod.__dict__)
  File "/usr/local/sickrage/cache/cheetah/_usr_local_sickrage_gui_slick_interfaces_default_displayShow_tmpl.py", line 34, in <module>
    import ntpath
  File "/usr/local/lib/python2.7/ntpath.py", line 15, in <module>
    from genericpath import _unicode
ImportError: cannot import name _unicode




I found that /usr/local/lib/python2.7/ntpath.py had the following import lines and after removing the second line everything began function properly. This is clearly not the most appropriate course of action since none of the _unicode tests will execute in ntpath.py this way, but it definitely wasn't working correctly the other way. 

from genericpath import *
from genericpath import _unicode


/usr/local/lib/python2.7/generic.py path only has the following related to unicode so I am not sure why the import in ntpath.py isn't working:

try:
    _unicode = unicode
except NameError:
    # If Python is built without Unicode support, the unicode type
    # will not exist. Fake one.
    class _unicode(object):
        pass
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-01-12 23:22:55 UTC
Is this still relevant? Maintainer feedback?
Comment 2 avatar4d 2018-01-12 23:50:42 UTC
Not to me; I'm no longer using SickRage