-
Notifications
You must be signed in to change notification settings - Fork 51
ValueError: invalid literal for int() ... #28
Comments
One case that causes this error (on line 167 with cram 0.7 and python 3.8) is a test where the command is followed by lines intended to be fed to it on stdin, e.g.,
Try a here document as a workaround:
|
Getting rid of my only |
(opened https://bugs.launchpad.net/ubuntu/+source/cram/+bug/1901372 mostly as a precursor to requesting packaging if this gets fixed here, since this is the upstream that ubuntu is using.) |
Just accidentally discovered that if you add
to a cram 0.6/python2 test, you also get
and then, to my confusion, discovered that taking out the |
The crash is caused by invoking cat without any arguments. Given a test script:
Under the hood, cram generates a shell script looking something like this:
and pipes that to the shell's stdin. This causes the shell to assume the input after the cat command is meant for its stdin, so the output erroneously becomes:
That second line is being misinterpreted by Cram as its internal output, causing the crash. I'm not really sure what the right fix is here. Invoking cat without in any arguments in a test doesn't make much sense, but I'm not sure what I'd expect it to do. It also breaks anything in the test that comes after it. |
I was actually using |
i just ran into this (boiled down to the above another suggestion -- if the above wouldn't work -- would be to at least trap the error, and say something to the user, maybe point at this bug. let me know if i can help in any way. |
sometimes cram just crashes with
I was able to find the problem with my test via patching cram/_test.py to print cmd and out on line 157 but I was unable to produce a sscce though.
The text was updated successfully, but these errors were encountered: