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

Use as preprocessor error #2

Closed
shenghxie opened this issue Sep 10, 2018 · 4 comments
Closed

Use as preprocessor error #2

shenghxie opened this issue Sep 10, 2018 · 4 comments

Comments

@shenghxie
Copy link

I was trying to use pancritic as a preprocessor for pandoc using
pancritic docum1.md -t markdown -m a | pandoc -s -o docum1.pdf
but got the following error.
I was planning to apply --filters in pandoc.
I am wondering the correct way of using it as a preprocessor.

Traceback (most recent call last):
File "/usr/local/bin/pancritic", line 11, in
sys.exit(cli())
File "/usr/local/lib/python2.7/site-packages/pancritic/main.py", line 137, in cli
main(*get_args())
File "/usr/local/lib/python2.7/site-packages/pancritic/main.py", line 117, in get_args
output_format = normalize_format(os.path.splitext(args.output)[1][1:])
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 98, in splitext
return genericpath._splitext(p, sep, altsep, extsep)
File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 99, in _splitext
sepIndex = p.rfind(sep)
AttributeError: 'NoneType' object has no attribute 'rfind'

@ickc
Copy link
Owner

ickc commented Oct 1, 2018

Can you upload your docum1.md?

@shenghxie
Copy link
Author

shenghxie commented Jan 15, 2019

docum1.md is quite simple:

# Heading
{++add++}
{--remove--}
{>>comment<<}
content
~$ pancritic docum1.md -t markdown -m a | pandoc -s -o docum1.pdf
Traceback (most recent call last):
  File "/usr/local/bin/pancritic", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/pancritic/main.py", line 137, in cli
    main(*get_args())
  File "/usr/local/lib/python2.7/site-packages/pancritic/main.py", line 117, in get_args
    output_format = normalize_format(os.path.splitext(args.output)[1][1:])
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 98, in splitext
    return genericpath._splitext(p, sep, altsep, extsep)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py", line 99, in _splitext
    sepIndex = p.rfind(sep)
AttributeError: 'NoneType' object has no attribute 'rfind'

@shenghxie shenghxie reopened this Jan 15, 2019
@alerque
Copy link
Contributor

alerque commented Apr 5, 2019

This might be related to #5. I don't get this particular error, but your error seems to have to do with processing the output_format, so it might just be related.

@ickc
Copy link
Owner

ickc commented Apr 5, 2019

I just tested this case and it runs fine. But I noticed that you're using Python 2.7. Have you try using Python 3 to run that?

(In case it is really just Python 2, since Python 2 is deprecating in less than a year, I don't think it is worth spending time to fix that... Sorry, Python 2.)

@ickc ickc closed this as completed Apr 5, 2019
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

3 participants