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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The information is duplicated because the exception is printed separately.

@iritkatriel
Copy link
Member Author

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 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.

@iritkatriel iritkatriel deleted the bpo-41031 branch November 5, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants