phyllisstein / Pandown

A powerful, versatile, highly Subliminal Pandoc build wrapper for ST2/3
64 stars 12 forks source link

error running Pandown 3/26/13 #2

Closed rkjohnson closed 11 years ago

rkjohnson commented 11 years ago

Running up-to-date Pandown as of 3/26/13, and Pandoc 1.11.1. Win 7, ST 2, build 2217.

When running any Pandown command, receive an error "Pandown requires Pandoc". The console shows the following:

[Pandown: Exception: environment can only contain strings] error: Pandown requires Pandoc

Looks like I'm getting an error here

def checkPandoc(self, env):
    cmd = ['pandoc', '--version']
    try:
        output = subprocess.check_call(cmd, env=env)
    except Exception as e:
        err("Exception: " + str(e))
        return False
phyllisstein commented 11 years ago

I'm sorry that you're having trouble! I just tested the latest version in my own copy of ST2 and found that it ran okay. Let's see if we can't get this straightened out. Could you try adding the line print(env) right below cmd=['pandoc', '--version']? So it'd look like this:

def checkPandoc(self, env):
    cmd = ['pandoc', '--version']
    print(env)
    try:
        output = subprocess.check_call(cmd, env=env)
    except Exception as e:
        err("Exception: " + str(e))
        return False

    return output == 0

Take a look at the output there (you don't have to paste it all in) and see if it's set to anything but flat keys and values.

rkjohnson commented 11 years ago

No problem! Thanks for looking into this. So nothing really looks wrong with what prints out, but my PATH variable did have a couple things:

'PATH': u'C:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;
C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;
C:\\Windows\\system32;
C:\\Windows;
C:\\Windows\\System32\\Wbem;
C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;
C:\\Program Files (x86)\\Common Files\\Roxio Shared\\DLLShared\\;
C:\\Program Files (x86)\\Common Files\\Roxio Shared\\OEM\\DLLShared\\;
C:\\Program Files (x86)\\Common Files\\Roxio Shared\\OEM\\DLLShared\\;
C:\\Program Files (x86)\\Common Files\\Roxio Shared\\OEM\\12.0\\DLLShared\\;
C:\\Program Files (x86)\\Roxio\\OEM\\AudioCore\\;
C:\\Program Files (x86)\\Windows Live\\Shared;
C:\\Program Files\\Dell\\Dell Data Protection\\Access\\Advanced\\Wave\\Gemalto\\Access Client\\v5\\;
C:\\Program Files (x86)\\NTRU Cryptosystems\\NTRU TCG Software Stack\\bin\\;
C:\\Program Files\\NTRU Cryptosystems\\NTRU TCG Software Stack\\bin\\;
C:\\MATLAB\\R2012b\\bin;
C:\\MATLAB\\R2012a\\bin;
C:\\Program Files\\Microsoft Windows Performance Toolkit\\;
C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;
C:\\Program Files\\TortoiseSVN\\bin;
C:\\Program Files (x86)\\Git\\cmd;
C:\\Program Files (x86)\\Altium Designer S09 Viewer\\System;
C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\;
C:\\Users\\rjohnson\\AppData\\Local\\Pandoc\\:C:\\Users\\rjohnson\\AppData\\Local\\Pandoc\\:C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\',

(I added line breaks on ; to make it easier to read) I'm not sure where that u comes from at the beginning, and then the last path has three paths munged together. The last two on that line come from my Pandown settings file

"install_path": "C:\\Users\\rjohnson\\AppData\\Local\\Pandoc\\",
"texbin_path": "C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\"

If I make those both blank I get "C:\Users\rjohnson\AppData\Local\Pandoc\::" for the last entry. Other than that, nothing really stands out.

rkjohnson commented 11 years ago

Ok, it looks like that mystery 'u' is the problem. If I comment out line 41 in pandownBuildCommand.py, it passes fine.

Next issue (let me know if you want this filed separately). After running pandown to build an html file say of C:\test.md, I see this in the console:

['pandoc', u'--output=C:\\test.html', u'--to=html5', u'--from=markdown-tex_math_single_backslash+escaped_line_breaks+line_blocks-markdown_attribute+all_symbols_escapable+simple_tables+fancy_lists+strikeout+definition_lists-hard_line_breaks+inline_code_attributes-abbreviations+table_captions+latex_macros+citations+example_lists+auto_identifiers+markdown_in_html_blocks+subscript+tex_math_dollars+inline_notes+grid_tables-mmd_title_block+implicit_figures-autolink_bare_uris+pandoc_title_block+startnum+multiline_tables+fenced_code_blocks+footnotes+implicit_header_references-link_attributes+raw_tex+blank_before_blockquote-intraword_underscores+blank_before_header-tex_math_double_backslash-mmd_header_identifiers+header_attributes+raw_html+pipe_tables+superscript', u'--smart', u'--parse-raw', u'--normalize', u'--standalone', u'C:\\test.md']
Running pandoc --output=C:\test.html --to=html5 --from=markdown-tex_math_single_backslash+escaped_line_breaks+line_blocks-markdown_attribute+all_symbols_escapable+simple_tables+fancy_lists+strikeout+definition_lists-hard_line_breaks+inline_code_attributes-abbreviations+table_captions+latex_macros+citations+example_lists+auto_identifiers+markdown_in_html_blocks+subscript+tex_math_dollars+inline_notes+grid_tables-mmd_title_block+implicit_figures-autolink_bare_uris+pandoc_title_block+startnum+multiline_tables+fenced_code_blocks+footnotes+implicit_header_references-link_attributes+raw_tex+blank_before_blockquote-intraword_underscores+blank_before_header-tex_math_double_backslash-mmd_header_identifiers+header_attributes+raw_html+pipe_tables+superscript --smart --parse-raw --normalize --standalone C:\test.md

But nothing gets created. If I copy the text after 'Running' on line 2 and paste into a console, it produces the .html file fine... weird!

phyllisstein commented 11 years ago

See if anything strange show up if you click Tools→Build Results→Show Build Results. There'll likely be an error message in that panel. But I think the more serious problem was that the paths were being appended incorrectly: I don't have a Windows machine to test with, and didn't realize they were separated by semicolons instead of colons. Let me try pushing a change through in just a minute.

phyllisstein commented 11 years ago

Alright, great news! I managed to set up Windows 7 in Boot Camp and take a look at what was going on myself. You were right about the Unicode thing causing trouble---apparently Windows doesn't like that. Adding a few str() functions appears to get the basic stuff running. I'm still having some trouble with the build-to-window thing, but I ought to be able to hunt down the problem now.

rkjohnson commented 11 years ago

Great! I tested this morning and found it was still having issues with the path, but I never had a chance to look into it and comment back here. I'll give this a shot tomorrow. Thanks!

rkjohnson commented 11 years ago

Everything seems to be working well now on my Windows PC. Thanks!!

phyllisstein commented 11 years ago

Fantastic! I'm so glad. Keep me posted if anything else goes wrong!