File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1424,7 +1424,7 @@ def print_numbers():
14241424 thread = Thread (target = print_numbers )
14251425 thread .start ()
14261426 sleep (step / 2 )
1427- ip .run_cell_magic ("script" , f" { sys .executable } " , code )
1427+ ip .run_cell_magic ("script" , sys .executable , code )
14281428 thread .join ()
14291429
14301430 captured = capsys .readouterr ()
@@ -1437,7 +1437,12 @@ def test_script_streams_multibyte_unicode(capsys):
14371437 ip = get_ipython ()
14381438 # € in UTF-8 is encoded using 3 bytes
14391439 code = "print('€' * 1000, end='')"
1440- ip .run_cell_magic ("script" , f"{ sys .executable } " , code )
1440+ is_windows = os .name == "nt"
1441+ command = sys .executable
1442+ if is_windows :
1443+ # windows does not use UTF for streams/pipes by default
1444+ command += " -X utf8"
1445+ ip .run_cell_magic ("script" , command , code )
14411446
14421447 captured = capsys .readouterr ()
14431448 assert captured .out == "€" * 1000
You can’t perform that action at this time.
0 commit comments