diff options
| author | Gregory P. Smith <greg@mad-scientist.com> | 2009-02-11 23:45:25 +0000 |
|---|---|---|
| committer | Gregory P. Smith <greg@mad-scientist.com> | 2009-02-11 23:45:25 +0000 |
| commit | 01f29b32aa09d03c9bbbfaa79f4e8ad3a06f4643 (patch) | |
| tree | 6d58b08e736671d4cdc6b52347d1544678457c9c /Lib/test/test_socket.py | |
| parent | 59102d04e90207a0e3bde8d09cd8b5ade7e53299 (diff) | |
| download | cpython-01f29b32aa09d03c9bbbfaa79f4e8ad3a06f4643.tar.gz | |
Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even
on LP64 platforms (most 64-bit Linux, bsd, unix systems).
Diffstat (limited to 'Lib/test/test_socket.py')
| -rw-r--r-- | Lib/test/test_socket.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 66664b44ed..5c906d776a 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -388,6 +388,14 @@ class GeneralModuleTests(unittest.TestCase): # Check that setting it to an invalid type raises TypeError self.assertRaises(TypeError, socket.setdefaulttimeout, "spam") + def testIPv4_inet_aton_fourbytes(self): + if not hasattr(socket, 'inet_aton'): + return # No inet_aton, nothing to check + # Test that issue1008086 and issue767150 are fixed. + # It must return 4 bytes. + self.assertEquals('\x00'*4, socket.inet_aton('0.0.0.0')) + self.assertEquals('\xff'*4, socket.inet_aton('255.255.255.255')) + def testIPv4toString(self): if not hasattr(socket, 'inet_pton'): return # No inet_pton() on this platform |
