mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Following an idea by Ron Adam, make sure keys and values in the
environ dict are strings (in particular, not 8-bit strings).
This commit is contained in:
parent
cd16bf6404
commit
67aca9e04e
2 changed files with 14 additions and 7 deletions
|
@ -273,6 +273,13 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
|
|||
value = os.popen("/bin/sh -c 'echo $HELLO'").read().strip()
|
||||
self.assertEquals(value, "World")
|
||||
|
||||
# Verify environ keys and values from the OS are of the
|
||||
# correct str type.
|
||||
def test_keyvalue_types(self):
|
||||
for key, val in os.environ.items():
|
||||
self.assertEquals(type(key), str)
|
||||
self.assertEquals(type(val), str)
|
||||
|
||||
class WalkTests(unittest.TestCase):
|
||||
"""Tests for os.walk()."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue