Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-41031: Match C and Python code formatting of unprintable exceptio… #28139

Merged
merged 4 commits into from Sep 5, 2021

Conversation

@iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Sep 3, 2021

…ns and exceptions in the main module.

https://bugs.python.org/issue41031

Lib/test/test_sys.py Outdated Show resolved Hide resolved
Lib/test/test_sys.py Outdated Show resolved Hide resolved
Lib/test/test_sys.py Show resolved Hide resolved
Lib/test/test_sys.py Outdated Show resolved Hide resolved
@@ -169,7 +169,7 @@ def _some_str(value):
try:
return str(value)
except:
return '<unprintable %s object>' % type(value).__name__
return '<exception str() failed>'
Copy link
Member

@serhiy-storchaka serhiy-storchaka Sep 5, 2021

The former message contains more information. Would not be better to change other places?

Copy link
Member Author

@iritkatriel iritkatriel Sep 5, 2021

The information is duplicated because the exception is printed separately.

@serhiy-storchaka serhiy-storchaka merged commit 9e31b39 into python:main Sep 5, 2021
12 checks passed
@iritkatriel
Copy link
Member Author

@iritkatriel iritkatriel commented Sep 5, 2021

Thanks @serhiy-storchaka .

@pablogsal @ambv do you want to backport this? It’s a very minor thing, but keeping the code aligned to make other back ports easier may be a consideration.

@ambv
Copy link
Contributor

@ambv ambv commented Sep 8, 2021

Too late for 3.10.0 and so I'm inclined to let those backports go and only include this in 3.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants