bpo-28180: Fix test_capi.test_forced_io_encoding() (#2155) · python/cpython@eb52ac8 (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit eb52ac8
bpo-28180: Fix test_capi.test_forced_io_encoding() (#2155)
Don't run Python in an empty environment, but copy the current environment and set PYTHONIOENCODING. So the test works also on Python compiled in shared mode (using libpython).
File tree
1 file changed
lines changed
1 file changed
lines changed
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -480,7 +480,7 @@ def test_subinterps_distinct_state(self): | ||
480 | 480 | |
481 | 481 | def test_forced_io_encoding(self): |
482 | 482 | # Checks forced configuration of embedded interpreter IO streams |
483 | -env = {"PYTHONIOENCODING": "utf-8:surrogateescape"} | |
483 | +env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") | |
484 | 484 | out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) |
485 | 485 | if support.verbose > 1: |
486 | 486 | print() |