[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-13 Thread miss-islington


miss-islington  added the comment:


New changeset d4128485d6c2cbfebe756f3eeec2c60137b63bba by Miss Islington (bot) 
in branch '3.10':
bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754)
https://github.com/python/cpython/commit/d4128485d6c2cbfebe756f3eeec2c60137b63bba


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-13 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset dd8eb303b90d63e1f56684bedadca6674bb74a29 by Łukasz Langa in 
branch 'main':
bpo-26228: [doc] Adapt PTY documentation updates from GH-4167 (GH-27754)
https://github.com/python/cpython/commit/dd8eb303b90d63e1f56684bedadca6674bb74a29


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26233
pull_request: https://github.com/python/cpython/pull/27758

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-13 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +26230
pull_request: https://github.com/python/cpython/pull/27754

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-12 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is now merged. Thanks for all input, everyone! ✨  ✨

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-12 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5d34ad4e1943a88c9d3aadd300fd0f05dab7 by Miss Islington (bot) 
in branch '3.10':
bpo-26228: Fix pty EOF handling (GH-12049) (GH-27732)
https://github.com/python/cpython/commit/5d34ad4e1943a88c9d3aadd300fd0f05dab7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-11 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +26212
pull_request: https://github.com/python/cpython/pull/27732

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-11 Thread Łukasz Langa

Change by Łukasz Langa :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2021-08-11 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 81ab8db235580317edcb0e559cd4c983f70883f5 by Zephyr Shannon in 
branch 'main':
bpo-26228: Fix pty EOF handling (GH-12049)
https://github.com/python/cpython/commit/81ab8db235580317edcb0e559cd4c983f70883f5


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2020-10-25 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
pull_requests: +21879
pull_request: https://github.com/python/cpython/pull/22962

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1

2020-08-21 Thread Soumendra Ganguly


Change by Soumendra Ganguly :


--
title: pty.spawn hangs on FreeBSD 9.3, 10.x -> pty.spawn hangs on FreeBSD 9.3, 
10.x, 12.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2020-08-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2020-08-09 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Hi! Can anyone please take a look at

https://bugs.python.org/issue41494 [ 
https://github.com/python/cpython/pull/21752 ]?

I think these are related. I wrote a new function called wspawn, which is like 
spawn+the following differences.

1. It sets window size at the beginning.
2. It registers a SIGWINCH handler.
3. It does not depend on OSError to return. It does a clean return instead.

--
nosy: +soumendra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2019-02-26 Thread Geoff Shannon


Geoff Shannon  added the comment:

I'm aware of it. I actually wrote that patch as well. :D

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2019-02-26 Thread STINNER Victor


STINNER Victor  added the comment:

Please have a look at this pty.spawn() documentation change:
https://github.com/python/cpython/pull/11980

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2019-02-26 Thread Geoff Shannon


Geoff Shannon  added the comment:

I took a shot at fixing this in a smaller more targeted patch.  I think this 
should still solve the major issue of pty.spawn hanging on platforms that don't 
raise an error.  In addition, pty.spawn should now _ALWAYS_ return the terminal 
to the previous settings.

--
nosy: +RadicalZephyr

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2019-02-26 Thread Geoff Shannon


Change by Geoff Shannon :


--
pull_requests: +12074

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2019-02-25 Thread Jarry Shaw


Jarry Shaw  added the comment:

Chris' patch works on macOS 10.14 (Mojave); but after it terminates, tty 
attributes are not restored (new-lines are missing). btw, I've implemented a 
workaround library with solution through either `ps` command or `psutil` 
package, see `ptyng` on PyPI.

--
nosy: +jarryshaw

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-11-24 Thread Martin Panter

Martin Panter  added the comment:

If it helps, here is a basic test case I wrote for “pty.spawn”. I hope that it 
exposes the problem on Free BSD, but I have only tested it on Linux.

parent = r'''\
import pty, sys
pty.spawn((sys.executable, "-c", sys.argv[1]))
'''
child = r'''\
import sys
# Read input first of all to minimize output buffering
input = sys.stdin.readline()
print("isatty: {}, {}, {}".format(
sys.stdin.isatty(), sys.stdout.isatty(), sys.stderr.isatty()))
print("input: " + repr(input))
sys.stdout.write("stdout data\n")
sys.stderr.write("stderr data\n")
'''
args = (sys.executable, "-c", parent, child)
parent = subprocess.Popen(args,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
try:
parent.stdin.write(b"stdin data\n")
parent.stdin.flush()
# Leave input open. When the child closes the slave terminal on
# Free BSD, “spawn” used to keep waiting for input (BPO 26228).
output = parent.stdout.read()
finally:
parent.stdout.close()
parent.stdin.close()
parent.wait()
self.assertEqual(0, parent.returncode, repr(output))
self.assertIn(b"isatty: True, True, True", output)
self.assertIn(br"input: 'stdin data\n'", output)
self.assertIn(b"stdout data", output)
self.assertIn(b"stderr data", output)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-10-29 Thread Cornelius Diekmann

Change by Cornelius Diekmann :


--
pull_requests: +4136

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-07-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2984

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-04-26 Thread John Beck

John Beck added the comment:

Solaris has this problem also, and Chris' patch fixes it for us.

--
nosy: +jbeck

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread Martin Panter

Martin Panter added the comment:

Behaviour change in Free BSD as I understand. Nothing changed in Python, but 
perhaps older versions of Free BSD behaved like Linux and raised EIO (or 
another errno; it is not clear).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread STINNER Victor

STINNER Victor added the comment:

> That used to be true in FBSD, but then someone fixed (?) it, and now the 
> master side simply returns EOF when read-from.

Is it a behaviour change in a new version of Python? Or a change in FreeBSD? I 
don't understand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-01-02 Thread Cornelius Diekmann

Cornelius Diekmann added the comment:

I just tested pty.spawn() on OS X 10.6.8 and FreeBSD 11 and it also hangs. It 
works on Linux.

Your patch solves the problem. I proposed a test suite for pty.spawn() in 
issue29070. The test suite currently only exposes the problem, as suggested by 
Martin.

--
nosy: +Cornelius Diekmann

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2016-01-27 Thread Martin Panter

Martin Panter added the comment:

I agree with all the changes you made. I made one review comment.

It would be nice to add a test case to expose the problem. Correct me if I am 
wrong, but it doesn’t look like pty.spawn() is tested at all.

FWIW on Linux, reading from the master end seems to raise EIO if the slave has 
been closed. And writing to the master when the slave is closed seems to fill 
up a buffer and eventually blocks.

Ideally I think the best solution for handing exec() failure (Issue 17824) 
would be to eliminate fork-exec with posix_spawn(); see Issue 20104. But as you 
say, that’s a separate problem.

--
components: +Library (Lib)
nosy: +martin.panter
stage:  -> patch review
type:  -> behavior
versions: +Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com