[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-27 Thread STINNER Victor
STINNER Victor added the comment: Chi Hsuan Yen confirmed that "python3.7m -m test test_curses -u curses" now pass on Android, so I close the issue. Thanks. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset 61e2bc74dfab1ceee332d3f480dcf86c478c87c5 by Victor Stinner in branch 'master': bpo-29176: Fix name of the _curses.window class (#52) https://github.com/python/cpython/commit/61e2bc74dfab1ceee332d3f480dcf86c478c87c5 --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset 2b221b78d602f1684a81b85af748fa55b1449dac by Victor Stinner (Christian Heimes) in branch 'master': bpo-29176 Use tmpfile() in curses module (#235) https://github.com/python/cpython/commit/2b221b78d602f1684a81b85af748fa55b1449dac --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-24 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7253aded71df8d4bf8684fc78d11c596079211b3 by Victor Stinner (Mariatta) in branch '3.6': bpo-29176: Fix name of the _curses.window class (#52) (#532) https://github.com/python/cpython/commit/7253aded71df8d4bf8684fc78d11c596079211b3 --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-06 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +441 ___ Python tracker ___ ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-04 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I've just tried with the latest git-master. With NDK r13b and my build scripts, [1] test_curses passed. shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -m test test_curses -u curses Run tests sequentially 0:00:00 [1/1] test_curses 1 test OK. Total duration:

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-02 Thread STINNER Victor
STINNER Victor added the comment: me: "I change the issue type to security" I'm not sure anymore that the change is really related to security. I don't think that replacing mkstemp("/tmp/py.curses.putwin.XX") with tmpfile() has an impact on security. So I don't think that it's worth it to

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-03-02 Thread STINNER Victor
STINNER Victor added the comment: Xavier de Gaye, Chi Hsuan Yen: I just merged Christian Heimes's PR. So the function should now work on Android. Can you double check that it works? Is it worth it to backport the change to Python 3.6? Do you plan to try to have a full Android support in

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-23 Thread STINNER Victor
STINNER Victor added the comment: > POSIX.1-2001 specifies: an error message may be written to stdout if the > stream cannot be opened. At least, I don't see such message in the Android implementation: https://android.googlesource.com/platform/bionic/+/android-5.0.0_r1/libc/bionic/tmpfile.cpp

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I hope that this never happen in real world, but in theory this change can introduce regression. That is why I think it should be documented in Misc/NEWS. -- ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread Christian Heimes
Christian Heimes added the comment: I think we can live with the fact some tmpfile() might write an error message if the system is broken. If user's tmp is not writeable, the user has more serious issues than a write to stdout inside curses module. --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The manpage of tmpfile contains the note: POSIX.1-2001 specifies: an error message may be written to stdout if the stream cannot be opened. Did you tested tmpfile() with readonly temporary files directory or overfull file system? --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread STINNER Victor
STINNER Victor added the comment: I created https://github.com/python/cpython/pull/237 using tmpfile(). The patch is simpler than my previous PR using Python tempfile. Oh... I didn't see that Christian wrote almost the same change 20 min before me :-D --

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread STINNER Victor
Changes by STINNER Victor : -- pull_requests: +198 ___ Python tracker ___ ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread Christian Heimes
Christian Heimes added the comment: Thanks Chi Hsuan Yen, I have created a new PR that replaces mkstemp() with tmpfile(). -- ___ Python tracker ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread Christian Heimes
Changes by Christian Heimes : -- pull_requests: +196 ___ Python tracker ___ ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-22 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: > Is tmpfile() available on Android? Yes. Just tried it with Android NDK r13 with clang and API 21 (Android 5.0). Here's the source code test.c: #include int main() { FILE *fp = NULL; char c = '\0'; fp = tmpfile(); fprintf(fp, "123\n");

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread STINNER Victor
STINNER Victor added the comment: Is tmpfile() available on Android? -- ___ Python tracker ___ ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-21 Thread Christian Heimes
Christian Heimes added the comment: How about https://linux.die.net/man/3/tmpfile instead? The tmpfile() function opens a unique temporary file in binary read/write (w+b) mode. The file will be automatically deleted when it is closed or the program terminates. -- nosy:

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-17 Thread STINNER Victor
STINNER Victor added the comment: Thank you for your check! Good to know that it works on Android. Chi Hsuan Yen added the comment: > I know little about the C API. Just a question: isn't > PyImport_ImportModuleNoBlock deprecated? I am not aware of any deprecation:

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-17 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Here are test results for PR 53: shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -m test -u curses test_curses Run tests sequentially 0:00:00 [1/1] test_curses 1 test OK. Total duration: 1 sec Tests result: SUCCESS abcshell@ASUS_Z00E_2:/data/local/tmp $ I know

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-12 Thread STINNER Victor
STINNER Victor added the comment: I created the PR https://github.com/python/cpython/pull/53 for curses_temporaryfile.patch. -- pull_requests: +48 ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-12 Thread STINNER Victor
STINNER Victor added the comment: I created https://github.com/python/cpython/pull/52 for curses_fix_window_class_name.patch. -- pull_requests: +47 ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "Check that pickling/unpickling the windows object doesn't cause crash or undefined behaviour. Currently the pickling fails because the name of the class is not true name." Ah, good idea. I tested with curses_fix_window_class_name.patch:

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Check that pickling/unpickling the windows object doesn't cause crash or undefined behaviour. Currently the pickling fails because the name of the class is not true name. -- ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor
STINNER Victor added the comment: curses_fix_window_class_name.patch: Fix the name of the C window class: "_curses.window", not "_curses.curses window" (with a space in the class name) !? The following example current displays : --- import curses w = curses.initscr() curses.endwin()

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-10 Thread STINNER Victor
STINNER Victor added the comment: curses_temporaryfile.patch: Call tempfile.TemporaryFile in getwin() and putwin() to create the temporary file in a more portable and safer manner. The curses library requires a FILE* object, but TemporaryFile.close() must be called to remove the temporary

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-03 Thread Xavier de Gaye
Changes by Xavier de Gaye : -- assignee: xdegaye -> ___ Python tracker ___ ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor
STINNER Victor added the comment: Oops, I missed Chi Hsuan Yen's comment: > I guess replace mkstemp (C function) with tempfile.mkstemp (Python function) > can solve the problem. So yes, I agree :-) -- ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor
STINNER Victor added the comment: I change the issue type to security. -- type: behavior -> security ___ Python tracker ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor
STINNER Victor added the comment: The putwin() function uses mkstemp() with the path template /tmp/py.curses.getwin.XX. I would prefer to use the Python function tempfile.mkstemp(). This function has a more portable behaviour. For example, Python is able to atomatically make the file

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +haypo, serhiy.storchaka stage: needs patch -> patch review ___ Python tracker ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Xavier de Gaye
Xavier de Gaye added the comment: The test suite runner in the test.libregrtest.main module calls tempfile.gettempdir() and mkstemp_curses.patch uses the same logic to fix the problem on Android where the tests that I run use TMPDIR=/data/local/tmp on Android API 24. As a side note, when the

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Xavier de Gaye
Changes by Xavier de Gaye : Added file: http://bugs.python.org/file46266/ncurses.patch ___ Python tracker ___

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-06 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I guess replace mkstemp (C function) with tempfile.mkstemp (Python function) can solve the problem. -- nosy: +Chi Hsuan Yen ___ Python tracker

[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-06 Thread Xavier de Gaye
New submission from Xavier de Gaye: == ERROR: test_module_funcs (test.test_curses.TestCurses) Test module-level functions -- Traceback (most recent call last):