tarsqi / ttk

Tarsqi Toolkit
Apache License 2.0
25 stars 10 forks source link

Guessing the source breaks when --pipe is used #71

Open marcverhagen opened 7 years ago

marcverhagen commented 7 years ago

When using pipes the source guessing code breaks because the input variable on the Tarsqi instance is None.

  File "/Users/marc/Desktop/tarsqi/code/ttk/git/ttk/docmodel/main.py", line 68, in guess_source
    content = filename_or_string[:chars_to_read]
TypeError: 'NoneType' object has no attribute '__getitem__'

Checking the input cannot be done at the same spot as with the file input because we cannot read from the pipe twice, so this will need to be done later when we have extracted the string from the standard input.

marcverhagen commented 7 years ago

For now I just updated the documentation to alert users to this.