diff -r 162743b7f59b Lib/http/cookiejar.py --- a/Lib/http/cookiejar.py Wed Apr 08 11:24:51 2015 +0300 +++ b/Lib/http/cookiejar.py Thu May 07 16:23:14 2015 -0500 @@ -758,7 +758,7 @@ ): if version is not None: version = int(version) - if expires is not None: expires = int(expires) + if expires is not None: expires = int(float(expires)) if port is None and port_specified is True: raise ValueError("if port is None, port_specified must be false") diff -r 162743b7f59b Lib/test/test_http_cookiejar.py --- a/Lib/test/test_http_cookiejar.py Wed Apr 08 11:24:51 2015 +0300 +++ b/Lib/test/test_http_cookiejar.py Thu May 07 16:23:14 2015 -0500 @@ -566,6 +566,16 @@ self.assertEqual(len(c), 1) self.assertIn('spam="bar"', h) + # test if fractional expiry is accepted + cookie = Cookie(0, "name", "value", + None, False, "www.python.org", + True, False, "/", + False, False, "1444312383.018307", + False, None, None, + {}) + self.assertEqual(cookie.expires, 1444312383) + + # XXX RFC 2965 expiry rules (some apply to V0 too) def test_default_path(self):