File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -556,12 +556,21 @@ def adjust_rlimit_nofile():
556
556
557
557
558
558
def display_header ():
559
+ encoding = sys .stdout .encoding
560
+
559
561
# Print basic platform information
560
562
print ("==" , platform .python_implementation (), * sys .version .split ())
561
563
print ("==" , platform .platform (aliased = True ),
562
564
"%s-endian" % sys .byteorder )
563
565
print ("== Python build:" , ' ' .join (get_build_info ()))
564
- print ("== cwd:" , os .getcwd ())
566
+
567
+ cwd = os .getcwd ()
568
+ # gh-109508: support.os_helper.FS_NONASCII, used by get_work_dir(), cannot
569
+ # be encoded to the filesystem encoding on purpose, escape non-encodable
570
+ # characters with backslashreplace error handler.
571
+ formatted_cwd = cwd .encode (encoding , "backslashreplace" ).decode (encoding )
572
+ print ("== cwd:" , formatted_cwd )
573
+
565
574
cpu_count = os .cpu_count ()
566
575
if cpu_count :
567
576
print ("== CPU count:" , cpu_count )
You can’t perform that action at this time.
0 commit comments