waylan/Python-Markdown — pull request #163 by allanderek (2012-12-04 11:26:53+00:00)
Title: Input file not existing error reporting.

I have been using Python-Markdown recently and occasionally type in the incorrect input file name, resulting in:

Traceback (most recent call last):
File "markdown/__main__.py", line 87, in
run()
File "markdown/__main__.py", line 81, in run
markdown.markdownFromFile(**options)
File "/afs/inf.ed.ac.uk/user/a/aclark6/Python/Python-Markdown/markdown/__init__.py", line 452, in markdownFromFile
kwargs.get('encoding', None))
File "/afs/inf.ed.ac.uk/user/a/aclark6/Python/Python-Markdown/markdown/__init__.py", line 357, in convertFile
input_file = codecs.open(input, mode="r", encoding=encoding)
File "/usr/lib64/python2.6/codecs.py", line 881, in open
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: 'laskdjf'

This is a very simple fix which will result in the slightly friendlier:

Input file: laskdjf does not exist.
Cannot continue, exiting.