Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to patch Python-Markdown for Cygwin #11

Closed
david-a-wheeler opened this issue May 26, 2011 · 3 comments
Closed

Need to patch Python-Markdown for Cygwin #11

david-a-wheeler opened this issue May 26, 2011 · 3 comments
Milestone

Comments

@david-a-wheeler
Copy link

Python-Markdown does not work as delivered on Cygwin. It installs, but attempting to run it produces this error:
Traceback (most recent call last):
File "/usr/bin/markdown", line 44, in
from markdown import COMMAND_LINE_LOGGING_LEVEL
File "/usr/bin/markdown.py", line 44, in
ImportError: cannot import name COMMAND_LINE_LOGGING_LEVEL

The problem is that a Cygwin system is actually a Windows system underneath, so it requires the Windows patch. HOWEVER, sys.platform reports 'cygwin', not 'win32', so the patch isn't actually run. Just change the detection code so that 'cygwin' also enables the windows workaround, and all is well.

Here's a patch, please add it!

diff -u markdown.py.old markdown.py
--- markdown.py.old     2011-05-26 17:27:46.000000000 -0400
+++ markdown.py 2011-05-26 18:28:43.014140700 -0400
@@ -30,7 +30,7 @@
 """

 import sys, os
-if sys.platform == 'win32':
+if sys.platform in ['win32', 'cygwin']:
         # We have to remove the Scripts dir from path on windows.
         # If we don't, it will try to import itself rather than markdown lib.
         # This appears to *not* be a problem on *nix systems, only Windows.
@waylan
Copy link
Member

waylan commented May 27, 2011

David,

Your patch won't apply to the current code. In fact, this was changed back in 2.0.1. We are currently at 2.0.3 and closing in on a release of 2.1.

Although, it does occur to me that you may have already upgraded. The problem there is that we renamed the script (we had multiple other problems which contributed to the rename) to markdown_py. However, installing the new version won't remove the old script and won't overwrite it because we used a different name. So the newer, corrected, script is also on your system. I suggest deleting the old one and using the new script. Or perhaps you could create a symbolic link with the name of the old script if you like that better.

@waylan waylan closed this as completed May 27, 2011
@david-a-wheeler
Copy link
Author

Thanks for the reply!!! I'm glad it's being maintained, it looks really useful.

No, I've only got version 2.0 installed. I followed the instructions at http://www.freewisdom.org/projects/python-markdown/Installation for *nix systems, and it told me to install version 2.0 (not 2.0.1), so that's what I did. It said that the github version was for people who wanted to live on the edge, and I wasn't looking for the edge :-).

If you want people to use version 2.0.3, you need to fix the instructions at http://www.freewisdom.org/projects/python-markdown/Installation. I could edit that page, but I don't know if that's what you actually intend. Otherwise, people might follow the instructions :-).

@waylan
Copy link
Member

waylan commented May 27, 2011

Ah, sorry about that. I just removed the specific version number from
that document. should always suggest the most recent version now.

On Fri, May 27, 2011 at 12:44 AM, david-a-wheeler
reply@reply.github.com
wrote:

Thanks for the reply!!! I'm glad it's being maintained, it looks really useful.

No, I've only got version 2.0 installed.  I followed the instructions at http://www.freewisdom.org/projects/python-markdown/Installation for *nix systems, and it told me to install version 2.0 (not 2.0.1), so that's what I did.  It said that the github version was for people who wanted to live on the edge, and I wasn't looking for the edge :-).

If you want people to use version 2.0.3, you need to fix the instructions at http://www.freewisdom.org/projects/python-markdown/Installation.  I could edit that page, but I don't know if that's what you actually intend.  Otherwise, people might follow the instructions :-).

Reply to this email directly or view it on GitHub:
#11 (comment)


\X/ /-\ `/ |_ /-\ ||
Waylan Limberg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants