| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -72,4 +72,7 @@ def main(): | |
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| main() | ||
| try: | ||
| main() | ||
| except BrokenPipeError as exc: | ||
| sys.exit(exc.errno) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,10 @@ | ||
| import errno | ||
| import os | ||
| import sys | ||
| import textwrap | ||
| import unittest | ||
| import subprocess | ||
|
|
||
| from test import support | ||
| from test.support.script_helper import assert_python_ok | ||
|
|
||
| Expand Down Expand Up | @@ -206,3 +208,14 @@ def test_ensure_ascii_default(self): | |
| # asserting an ascii encoded output file | ||
| expected = [b'{', rb' "key": "\ud83d\udca9"', b"}"] | ||
| self.assertEqual(lines, expected) | ||
|
|
||
| @unittest.skipIf(sys.platform =="win32", "The test is failed with ValueError on Windows") | ||
|
Comment thread
Copy link
Copy Markdown
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThe test is failed with ValueError on Windows isn't grammatically correct. It should be The test failed with ValueError on Windows (minus the is) 🤔
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis PR is now closed. You can write a new PR to enhance the skip message.
Sorry, something went wrong.
bl-ue reacted with thumbs up emoji
All reactions
|
||
| def test_broken_pipe_error(self): | ||
| cmd = [sys.executable, '-m', 'json.tool'] | ||
| proc = subprocess.Popen(cmd, | ||
| stdout=subprocess.PIPE, | ||
| stdin=subprocess.PIPE) | ||
|
Comment thread
corona10 marked this conversation as resolved.
|
||
| # bpo-39828: Closing before json.tool attempts to write into stdout. | ||
| proc.stdout.close() | ||
| proc.communicate(b'"{}"') | ||
| self.assertEqual(proc.returncode, errno.EPIPE) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by Dong-hee Na. |
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityWhere does the ValueError come from?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityhttps://github.com/python/cpython/pull/18779/checks?check_run_id=496883234
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.