-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
NameError: global name 'numb' is not defined #974
Comments
from that point on stdin is dead, any try to access it causes this exception, even if caught. |
this happens quite a lot since sometimes when i enter a command into my program i instinctively hit enter on the numpad. from that point on my application becomes unusable and i have to kill it. no workaround found so far. |
I can't reproduce this. Please provide steps that I can reproduce in the docker image.
To run in Docker:
|
this causes the bug for me: from pwn import *
import sys
inp = sys.stdin.readline().strip().decode('utf-8')
i'm sorry but i cannot use docker, since my custom linux distribution based on musl libc doesn't yet bundle a go compiler. but even if it's not reproducible on a mainstream distro, the bug is real as can be seen from the fat XXX in the comment... |
note that i cannot reproduce the issue either in an interactive python session - it must be run from a script |
a member of my team just tried it on debian, and he was able to reproduce the issue running the above script. sigh of relief |
I still cannot reproduce this on either macOS or Ubuntu 16.04.
|
I don't have any computers with a full keyboard, so no number pad to hit the |
it should be sufficient to just hit "+" on numeric block. my friends debian version is
|
damn, in that case i guess you won't be able to reproduce it! no usb keyboard lying around somewhere ? |
Nope! :-\ |
In any case, this is in the |
It looks like that code (minus the XXX warning, which was added later) comes from ab3d128
|
hey @br0ns , do you have an idea why this code is interfering with my invocation of sys code ? this looks like quite a nasty hook to me. |
You can disable term mode by setting PWNLIB_NOTERM in your environment, or
invoking your script with "python foo.py NOTERM". This will disable all
animations and fancy terminal things, and also resolve your issue.
…On Sat, May 6, 2017 at 6:54 PM rofl0r ***@***.***> wrote:
hey @br0ns <https://github.com/br0ns> , do you have an idea why this code
is interfering with my invocation of sys code ? this looks like quite a
nasty hook to me.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#974 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG0GEhAxoyNV-cHTQkHjNS6bUCpGwvVks5r3QgWgaJpZM4NSDEH>
.
|
thanks! when looking at the issues/PRs here, i have the feeling that assigning @br0ns to a task is about the same as closing it with EWONTFIX.. :) |
@zachriggle: is there a way to set this from code, rather than changing the environment or script args ? i'd rather do context.term_mode = False in my code and have the issue fixed once and for all, than having to start my program from a shell wrapper so i dont forget to set the env var. |
Unfortunately the term initialization opt-out *must* pre-empt "from pwn
import *"
…On Sun, May 7, 2017 at 11:07 AM rofl0r ***@***.***> wrote:
@zachriggle <https://github.com/zachriggle>: is there a way to set this
from code, rather than changing the environment or script args ? i'd rather
do context.term_mode = False in my code and have the issue fixed once and
for all, than having to start my program from a shell wrapper so i dont
forget to set the env var.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#974 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG0GG6VnXnwrrpKQi9kf7Ztgok98Exjks5r3ewxgaJpZM4NSDEH>
.
|
…ad right now, so can't test.
I've made a PR with an attempt at a fix: #978 The code is based on libtermkey. |
…ad right now, so can't test.
cool! i confirm that the issue is now fixed. if numlock is off, and "+" is being pressed "+k" is shown in the terminal instead of crashing. thank you! |
Merged to |
this happens when i press + and enter on the numeric block without having numlock on.
also kinda weird even that this is handled by pwnlib, since i call a function from sys.
The text was updated successfully, but these errors were encountered: