-
Notifications
You must be signed in to change notification settings - Fork 160
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
Menuconfig fails in MacOs with Python 3 when the terminal is resized #84
Comments
Don't have a Mac handy, unfortunately. To narrow it down, try running
Also try running this program: import curses
def main(stdscr):
while True:
stdscr.get_wch()
curses.wrapper(main) I wonder if it might be related to this issue. I get the same crash on Linux if I add |
I've tried and both
|
@kumekay Could you try running this C program as well, to try to rule out Python-specific issues? #include <curses.h>
#include <stdio.h>
#include <wchar.h>
int main(void)
{
initscr();
while (1) {
wint_t wch;
if (get_wch(&wch) == ERR) {
endwin();
puts("error");
break;
}
if (wch == KEY_RESIZE) {
endwin();
puts("ok");
break;
}
}
} Compile it with
Exits with "ok" on my Linux box when the terminal is resized. |
Just remembered that MacOS switched over to clang, so might need to make it
|
It works on my mac as well:
(The only change I made in your code was addition of |
Always forget something...
Looks like the issue might be on the Python side in that case. I'll see if I can find a Mac to tinker a bit. Not against adding a workaround if it turns out to be a common problem with Python 3 installations on macOS, but it'd be nice to understand what's going on first at least. |
@dobairoland @kumekay
What macOS version are you running? Know how you installed Python 3? I suspect the issue is with some third-party Python 3 package. |
Thank you @ulfalizer for looking into this. We tried with another colleague and he has @kumekay tried on two of his computers and I think he installed Python with pyenv. @kumekay, please give more info about your system setup. |
Could you try the bundled Python 3 too? |
@david-cermak Could you please try it? |
@ulfalizer have checked with the bundled python3 3.7.3 on Catalina 10.15.2 it crashed in both the default Terminal and the iTerm2 |
@david-cermak import curses
def main(stdscr):
while True:
stdscr.get_wch()
curses.wrapper(main) Wonder what's going on for the guy who didn't have issues. |
Yes, the same with the test program
|
Could you try |
Might not be separate from looking at this SO answer. |
Yes, the |
Alright, thanks. I reported a bug at https://www.apple.com/feedback/macos.html, though it seems to be a catch-all for macOS issues, so maybe it'll go into a black hole. There seems to be some Feedback Assistant thing too, though I'm not sure I can access it without a Mac. Anyway, here's what I wrote, in case you feel you like reporting it elsewhere:
Should probably add a workaround in the meantime. |
Pushed out a release with a fix: 68bcecd Would be nice to figure out and report the root issue at some point though. |
Update menuconfig (and kconfiglib and guiconfig, just to sync) to upstream revision 424d0d38e7, to get this commit in, which works around a crash on some macOS Python installations. menuconfig: Work around crash on resize on some macOS systems get_wch() has started raising curses.error when resizing the terminal on some macOS Python installations. Work around for now by falling back on getch(), which still works. See ulfalizer/Kconfiglib#84. Needs more investigation, but I don't have a Mac handy. Based on ulfalizer/Kconfiglib#85, but with some more comments. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Update menuconfig (and kconfiglib and guiconfig, just to sync) to upstream revision 424d0d38e7, to get this commit in, which works around a crash on some macOS Python installations. menuconfig: Work around crash on resize on some macOS systems get_wch() has started raising curses.error when resizing the terminal on some macOS Python installations. Work around for now by falling back on getch(), which still works. See ulfalizer/Kconfiglib#84. Needs more investigation, but I don't have a Mac handy. Based on ulfalizer/Kconfiglib#85, but with some more comments. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Thank you @ulfalizer for working on this and releasing the workaround. |
Menuconfig works fine in MacOs with Python 2. However, it fails with Python 3 with the following error when the terminal window is resized:
This issue was observed in https://github.com/espressif/esp-idf but probably it can be reproduced without it. We reproduced it on several machines.
The issue cannot be observed in Linux nor Windows. It works there as it is expected.
The text was updated successfully, but these errors were encountered: