pombreda / markowik

Automatically exported from code.google.com/p/markowik
MIT License
0 stars 0 forks source link

Markowik does not work with markdown 2.1.0 #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm getting following error every time I try to execute command.

dy@kontas:/usr/local/python/bin$ markowik markdoc gwdoc
/usr/lib/python2.5/site-packages/markowik/main.py:96: Warning: 'with' will 
become a reserved keyword in Python 2.6
Traceback (most recent call last):
  File "/usr/bin/markowik", line 8, in <module>
    load_entry_point('markowik==0.1.1', 'console_scripts', 'markowik')()
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 277, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2179, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1912, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.5/site-packages/markowik/__init__.py", line 10, in <module>
    from markowik.main import convert, BadURL
  File "/usr/lib/python2.5/site-packages/markowik/main.py", line 96
    with codecs.open(opts.input, 'r', opts.encoding) as fp:
              ^
SyntaxError: invalid syntax

Application is installed on debian / python 2.7 (multiple python install + 2.4 
+ 2.5).
Same in windows for any python version

Original issue reported on code.google.com by damir.zelenika on 21 Jan 2012 at 11:46

GoogleCodeExporter commented 9 years ago
The with statement is available since ython 2.6 - according to your traceback, 
you are using Python 2.5. In simple words: Markowik requires Python > 2.6.

A quick fix to make markowik work with Python 2.5 is to add this line before 
any other imports in main.py:

from __future__ import division

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 12:14

GoogleCodeExporter commented 9 years ago
I switched to python 2.7 and now there's other error:

dy@kontas:/usr/local/python/
bin$ ./markowik /home/dy/mrd
Traceback (most recent call last):
  File "./markowik", line 8, in <module>
    load_entry_point('markowik==0.1.1', 'console_scripts', 'markowik')()
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 318, in
load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 2221, in
load_entry_point
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 1954, in load
  File
"/usr/local/python/lib/python2.7/site-packages/markowik/__init__.py", line
10, in <module>
    from markowik.main import convert, BadURL
  File "/usr/local/python/lib/python2.7/site-packages/markowik/main.py",
line 10, in <module>
    from markowik import util
  File "/usr/local/python/lib/python2.7/site-packages/markowik/util.py",
line 7, in <module>
    from markdown import etree, STX, ETX
ImportError: cannot import name etree

Help me, please, because your app is ideal way to maintain / synchronize
wikipages on google code, github and sourceforge,
thnx

Original comment by damir.zelenika on 22 Jan 2012 at 12:47

GoogleCodeExporter commented 9 years ago
How did you install markowik? Via PyPI (i.e. with pip or easy_install), by 
manually running setup.py, or are you using a buildout? It seems the markdown 
module used by markowik isn't the one expected. What output do you get from:

$ python -c 'import markdown; print markdown.version'

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 3:56

GoogleCodeExporter commented 9 years ago
Concerning the command in the previous post, of course use the same python used 
to run markowik.

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 3:57

GoogleCodeExporter commented 9 years ago
I checked it myself and the problem is that the API of the markdown module has 
changed (in particular, the etree is missing). I'll fix this and publich a new 
version.

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 4:10

GoogleCodeExporter commented 9 years ago
I've installed markowik using pip

Original comment by damir.zelenika on 22 Jan 2012 at 4:50

GoogleCodeExporter commented 9 years ago
Python markdown 2.1 has a reasonable bunch of changes (compared to 2.0.3) -- it 
will take me a while to adjust markowik to work with the new Markdown version. 
In the mean time, you can fix your situation by installing markowik in version 
2.0.3:

$ pip install markdown==2.0.3

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 8:16

GoogleCodeExporter commented 9 years ago
I've jut published a new version of markowik (0.1.2) which explicitly requires 
Python Markdown 2.0.3. If you run,

$ pip install markowik --upgrade

you should be done. The only (unlikely) problem of this solution is, that other 
Python packages might require Python Markdown 2.1 -- a conflict! Here the 
solution is to run markowik isolated, using buildout (see the section 
'Contributions' in the README: 
http://pypi.python.org/pypi/markowik#contributions) or virtualenv.

Original comment by obensonne@googlemail.com on 22 Jan 2012 at 8:45

GoogleCodeExporter commented 9 years ago
I've just set markdown to 2.0.3 and everything seems OK.
Thanks a lot for very agile intervention.

Original comment by damir.zelenika on 22 Jan 2012 at 10:30

GoogleCodeExporter commented 9 years ago
Release 0.2 fixes this issue.

Original comment by obensonne@googlemail.com on 23 Jan 2012 at 10:46