mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-109508: Fix libregrtest formatting of getcwd() (#109537)
This commit is contained in:
parent
412f5e85d6
commit
ef659b9616
1 changed files with 10 additions and 1 deletions
|
@ -556,12 +556,21 @@ def adjust_rlimit_nofile():
|
|||
|
||||
|
||||
def display_header():
|
||||
encoding = sys.stdout.encoding
|
||||
|
||||
# Print basic platform information
|
||||
print("==", platform.python_implementation(), *sys.version.split())
|
||||
print("==", platform.platform(aliased=True),
|
||||
"%s-endian" % sys.byteorder)
|
||||
print("== Python build:", ' '.join(get_build_info()))
|
||||
print("== cwd:", os.getcwd())
|
||||
|
||||
cwd = os.getcwd()
|
||||
# gh-109508: support.os_helper.FS_NONASCII, used by get_work_dir(), cannot
|
||||
# be encoded to the filesystem encoding on purpose, escape non-encodable
|
||||
# characters with backslashreplace error handler.
|
||||
formatted_cwd = cwd.encode(encoding, "backslashreplace").decode(encoding)
|
||||
print("== cwd:", formatted_cwd)
|
||||
|
||||
cpu_count = os.cpu_count()
|
||||
if cpu_count:
|
||||
print("== CPU count:", cpu_count)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue