summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-06-13 21:51:27 (GMT)
committerGuido van Rossum <guido@python.org>2007-06-13 21:51:27 (GMT)
commit67aca9e04e5360007c46fde3d64debb4dad4d9ff (patch)
treee2ecd4ca63ea1c1d1e42acdb182f532f2b4b7621 /Lib/test/test_os.py
parentcd16bf640405065e4702539632ce577536207d88 (diff)
downloadcpython-67aca9e04e5360007c46fde3d64debb4dad4d9ff.zip
cpython-67aca9e04e5360007c46fde3d64debb4dad4d9ff.tar.gz
cpython-67aca9e04e5360007c46fde3d64debb4dad4d9ff.tar.bz2
Following an idea by Ron Adam, make sure keys and values in the
environ dict are strings (in particular, not 8-bit strings).
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 2ddda8a..1f6499c 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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()."""