[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-03 Thread miss-islington
miss-islington added the comment: New changeset 91e888904478271c27c52c773863b41f5a8f7f30 by Miss Islington (bot) in branch '3.10': bpo-14916: use specified tokenizer fd for file input (GH-31006) https://github.com/python/cpython/commit/91e888904478271c27c52c773863b41f5a8f7f30 --

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-01 Thread miss-islington
Change by miss-islington : -- pull_requests: +29250 pull_request: https://github.com/python/cpython/pull/31065 ___ Python tracker ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-01 Thread miss-islington
miss-islington added the comment: New changeset 89b13042fcfc95bae21a49806a205ef62f1cdd73 by Paul m. p. P in branch 'main': bpo-14916: use specified tokenizer fd for file input (GH-31006) https://github.com/python/cpython/commit/89b13042fcfc95bae21a49806a205ef62f1cdd73 -- nosy:

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-01-28 Thread pmp-p
Change by pmp-p : -- pull_requests: +29187 pull_request: https://github.com/python/cpython/pull/31006 ___ Python tracker ___ ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-10 Thread pmp-p
Change by pmp-p : -- pull_requests: +21251 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22190 ___ Python tracker ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-10 Thread pmp-p
Change by pmp-p : -- versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9 -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-09 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2020-09-09 Thread pmp-p
pmp-p added the comment: all PyRun_InteractiveOne* functions are also affected it is really annoying when implementing repl behaviour when embedding( use cases : pyodide, android, wasi ) But I think the correct patch is : -char *newtok = PyOS_Readline(stdin, stdout,

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2015-10-03 Thread Yauheni Kaliuta
Yauheni Kaliuta added the comment: Any progress with the problem? I just wanted to use the feature, but it looks like the bug.sh is still reproduces the bug. -- nosy: +Yauheni Kaliuta ___ Python tracker

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-25 Thread emmanuel
emmanuel added the comment: Kevin, I now fully agree with you. Regarding points 2 3 I dismissed modifying sys.stdin/out in python out of hand because it still would not allow to have a proper behaviour with two concurrent consoles on the same interpreter. Anyway this is not a very meaningful

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-25 Thread Kevin Barry
Kevin Barry added the comment: emmanuel, The Python interpreter isn't reentrant, so you could only run two interactive sessions connected to the same Python environment if you implemented your own REPL function that unlocked the GIL when waiting for input, then lock it just long enough to

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-24 Thread Kevin Barry
Kevin Barry added the comment: emmanuel, Regarding your points: All three can be taken care of with a combination of my patch and setting sys.stdin, sys.stdout, and sys.stderr to the pty. (That should really be done internally with another patch, since os.fdopen is OS-specific. Also,

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-20 Thread emmanuel
emmanuel added the comment: Kevin, I've read more carefully your messages and investigated some more. It seems that there are several issues: 1/ To take input from a defined tty without interfering with standard file descriptors 2/ To have the result (object) of evaluation printed to a defined

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-18 Thread emmanuel
emmanuel added the comment: Kevin, These are good points. I had a cursory look at the python source code and observed the following: - There may also be a concern with stderr (used to print the prompt in PyOS_Readline) - PyOS_Readline has two different definitions in files pgenmain.c and

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread emmanuel
Changes by emmanuel garcia6.emman...@wanadoo.fr: -- nosy: +emmanuel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14916 ___ ___ Python-bugs-list

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread emmanuel
emmanuel added the comment: run the attached shell script to observe the bug ./bug.sh 0 - shows the bug ./bug.sh 1 - shows the expected behaviour (using a workaround) tested on linux with python 2.7 -- Added file: http://bugs.python.org/file29431/bug.sh

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread emmanuel
Changes by emmanuel garcia6.emman...@wanadoo.fr: Added file: http://bugs.python.org/file29432/bug.sh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14916 ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread emmanuel
Changes by emmanuel garcia6.emman...@wanadoo.fr: Removed file: http://bugs.python.org/file29431/bug.sh ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14916 ___

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread Kevin Barry
Kevin Barry added the comment: emmanuel, Thanks for the suggestion. Your workaround is exactly the same as using dup2 (in C) to replace stdin/stdout/stderr with the pty, however. If you added the following lines to your C code, it would have the same effect as the command-line redirection in

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread emmanuel
emmanuel added the comment: Kevin, Indeed the code I submitted can be written entirely in C using pipe fork execl dup2 etc. as you suggest. The only purpose of mixing bash and C is to have a short self-contained file showing the problem. Anyway, whether in C or bash the workaround is less

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2013-03-17 Thread Kevin Barry
Kevin Barry added the comment: One additional issue, which my patch doesn't address, is that PyRun_InteractiveLoop should really take *two* FILE* arguments, with the second one being optional. This is because on Linux (and presumably on other *nixes) if a read operation is blocked on a file

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-10-08 Thread Kevin Barry
Kevin Barry added the comment: I still see the potential cause addressed by my patch in the 2.7, 3.3, and default branches, so I'm assuming that all versions from 2.6 on have this problem. I also see that I can elect to change the Status and Resolution of this report. Does that mean I need

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-10-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14916 ___ ___ Python-bugs-list mailing

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-24 Thread Kevin Barry
Kevin Barry ta0k...@gmail.com added the comment: The patch from before needed a slight modification for when Python actually defaults to an interactive session on stdin. Since I rebuild this for my current distro (Slackware64 13.37,) I switched to the Python 2.6.6 source. This might not be

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-24 Thread Kevin Barry
Kevin Barry ta0k...@gmail.com added the comment: I've attached a simplified example program (working3.c) that demonstrates both the original problem and that the patch (Python-2.6.6-Run_Interactive-fix.patch) works. It eliminates the need for a pty, 'xterm', and redirection. Compile the

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-23 Thread Kevin Barry
Kevin Barry ta0k...@gmail.com added the comment: Here is a patch that corrects the problem (quoted below and attached.) This only corrects the problem when 'PyOS_ReadlineFunctionPointer' is set, e.g. you must 'import readline', otherwise Python will defer to stdin/stdout with

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-07-23 Thread Kevin Barry
Kevin Barry ta0k...@gmail.com added the comment: I've attached a new example source file to demonstrate the fix. Compile the attached program with (*after* patching and installing Python): gcc `python-config --cflags` working2.c -o working2 `python-config --ldflags` and run it with:

[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-05-25 Thread Kevin Barry
New submission from Kevin Barry ta0k...@gmail.com: I have been trying to get PyRun_InteractiveLoop to run on a pty (Linux) without replacing stdin and stdout with that pty; however, it seems like Python (2.6.6) is hard-coded to only run interactively on stdin and stdout. Compile the attached