File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 99# #363: old input loop would fail to spot auth failure because of scheduling
1010# vs. su calling write() twice.
1111if 'DO_SLOW_AUTH_FAILURE' in os .environ :
12- os .write (2 , 'su: ' )
12+ os .write (2 , u 'su: '. encode () )
1313 time .sleep (0.5 )
14- os .write (2 , 'incorrect password\n ' )
14+ os .write (2 , u 'incorrect password\n '. encode () )
1515 os ._exit (1 )
1616
1717
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def test_valid_syntax(self):
4141 stdout , stderr = proc .communicate ()
4242 self .assertEquals (0 , proc .returncode )
4343 self .assertEquals (stdout ,
44- mitogen .parent .BootstrapProtocol .EC0_MARKER + '\n ' )
44+ mitogen .parent .BootstrapProtocol .EC0_MARKER + b ( '\n ' ) )
4545 self .assertIn (b ("Error -5 while decompressing data" ), stderr )
4646 finally :
4747 fp .close ()
Original file line number Diff line number Diff line change 1414
1515import mitogen .parent
1616
17+ try :
18+ file
19+ except NameError :
20+ from io import FileIO as file
21+
1722
1823def wait_for_child (pid , timeout = 1.0 ):
1924 deadline = time .time () + timeout
@@ -226,7 +231,8 @@ def test_dev_tty_open_succeeds(self):
226231 ])
227232 deadline = time .time () + 5.0
228233 mitogen .core .set_block (proc .stdin .fileno ())
229- self .assertEquals (mitogen .core .b ('hi\n ' ), proc .stdin .read ())
234+ # read(3) below due to https://bugs.python.org/issue37696
235+ self .assertEquals (mitogen .core .b ('hi\n ' ), proc .stdin .read (3 ))
230236 waited_pid , status = os .waitpid (proc .pid , 0 )
231237 self .assertEquals (proc .pid , waited_pid )
232238 self .assertEquals (0 , status )
You can’t perform that action at this time.
0 commit comments