bvanrijn / debianpaste-clients

Fork of a Python client for Debian Pastezone
http://paste.debian.net/
GNU General Public License v2.0
0 stars 0 forks source link

`add` without pipe hangs forever #5

Closed bvanrijn closed 8 years ago

bvanrijn commented 8 years ago

What steps will reproduce the problem? (1) Type python3 paste.py add without arguments

What is the expected output? That paste does something instead of waiting forever for standard input

What do you see instead? It seems like paste hangs while it waits for standard input

Error: No error. But after stopping paste with ^C:

KeyboardInterrupt

Traceback:

Traceback (most recent call last):
  File "paste.py", line 230, in <module>
    (msg, ret) = action.call(actions[cmd])
  File "paste.py", line 56, in call
    return self.__getattribute__(method_name)()
  File "paste.py", line 69, in actionAddPaste
    code = [ i.rstrip() for i in sys.stdin.readlines() ]
KeyboardInterrupt

A possible way to fix this issue would be to check if a pipe is being used, and if not, use a simple text editor like vi or nano.

bvanrijn commented 8 years ago

Hm. I don't know. cat also hangs forever when called without a filename argument.