markpress icon indicating copy to clipboard operation
markpress copied to clipboard

NameError: name 'nextpress' is not defined

Open sdondley opened this issue 6 years ago • 4 comments

markpress -n new_post.md results in:

Traceback (most recent call last):                                                                                                                                     
  File "/Users/me/git_repos/markpress/bin/markpress.py", line 13, in <module>                                                                                
    nextpress.main()                                                                                                                                                   
NameError: name 'nextpress' is not defined

sdondley avatar May 11 '19 21:05 sdondley

I know very little python but here are print()s that may help:

PATH variable: /Users/me/git_repos/markpress/bin

sys.path object: ['/Users/me/git_repos/markpress/bin', '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages', '/Users/me/git_repos/markpress/bin/../lib']

sdondley avatar May 11 '19 22:05 sdondley

It appears that something happened when importing nextpress module. maybe missing dependency.

I have made an update. The new version will print the reason of importing failure. Please try again and feed me back.

skywind3000 avatar May 12 '19 00:05 skywind3000

I now get:

Traceback (most recent call last):
  File "/Users/me/git_repos/markpress/bin/markpress.py", line 10, in <module>
    import nextpress
  File "/Users/me/git_repos/markpress/lib/nextpress.py", line 15, in <module>
    import config
  File "/Users/me/git_repos/markpress/lib/config.py", line 25, in <module>
    cfg = ascmini.ConfigReader(ININAME)
  File "/Users/me/git_repos/markpress/lib/ascmini.py", line 686, in __init__
    self.load(ininame, codec)
  File "/Users/me/git_repos/markpress/lib/ascmini.py", line 728, in load
    for key, val in cp.items(sect):
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 857, in items
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 857, in <listcomp>
    return [(option, value_getter(option)) for option in d.keys()]
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 854, in <lambda>
    section, option, d[option], d)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 394, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/configparser.py", line 444, in _interpolate_some
    "found: %r" % (rest,))
configparser.InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%5TvbAA'

sdondley avatar May 12 '19 13:05 sdondley

The traceback is helpful.

I found a similar issue on SO:

https://stackoverflow.com/questions/14340366/configparser-and-string-with

The top answer suggests me disable interpolation in ini parser.

I made a patch for that.

Please try the latest version, thanks.

skywind3000 avatar May 12 '19 14:05 skywind3000