Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_cookielib_compatibility fails with Python 3.7 and 3.8 #119

Closed
sbraz opened this issue Nov 22, 2019 · 2 comments
Closed

test_cookielib_compatibility fails with Python 3.7 and 3.8 #119

sbraz opened this issue Nov 22, 2019 · 2 comments

Comments

@sbraz
Copy link
Contributor

sbraz commented Nov 22, 2019

Hi,
I don't know what causes this but, on my system, test_cookielib_compatibility works with 2.7, 3.5 and 3.6 but not 3.7 or 3.8:

src/geventhttpclient/tests/test_headers.py::test_cookielib_compatibility FAILED                                                                                                                             [100%] 
                                                                                                                                                                                                                   
==================================================================================================== FAILURES =====================================================================================================
__________________________________________________________________________________________ test_cookielib_compatibility ___________________________________________________________________________________________
                                                                                                                                                                                                                   
    def test_cookielib_compatibility():                                                                                                                                                                            
        cj = CookieJar()                                                                                                                                                                                           
        # Set time in order to be still valid in some years, when cookie strings expire                                                                                                                            
        cj._now = cj._policy._now = time.mktime((2012, 1, 1, 0, 0, 0, 0, 0, 0))                                                                                                                                    
                                                                                                                                                                                                                   
        request = Request('http://test.com')                                                                                                                                                                       
        parser = HTTPResponse()
        parser.feed(MULTI_COOKIE_RESPONSE)
        cookies = cj.make_cookies(parser, request)
        # Don't use extract_cookies directly, as time can not be set there manually for testing
        for cookie in cookies:
            if cj._policy.set_ok(cookie, request):
                cj.set_cookie(cookie)
        # Three valid, not expired cookies placed
>       assert len(list(cj)) == 3
E       assert 1 == 3
E         -1
E         +3

src/geventhttpclient/tests/test_headers.py:124: AssertionError

I see that the Travis build works for those versions but I don't know how.

Here are the cookies variable I see with 3.8:

[Cookie(version=0, name='bb_sessionhash', value='abcabcabcabcabcabcabcabcabcabcab', port=None, port_specified=False, domain='test.com', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)]

And with 3.6:

[Cookie(version=0, name='bb_lastvisit', value='1348253375', port=None, port_specified=False, domain='test.com', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=1379789375, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='bb_lastactivity', value='0', port=None, port_specified=False, domain='test.com', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=1379789375, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False), Cookie(version=0, name='bb_sessionhash', value='abcabcabcabcabcabcabcabcabcabcab', port=None, port_specified=False, domain='test.com', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)]
@ml31415
Copy link
Collaborator

ml31415 commented Nov 24, 2019

Thanks for reporting this. Unfortunately you better shouldn't hope for a fast fix, except you write it yourself. There is no active maintenance for this lib right now. Patches welcome, though :)

@ml31415
Copy link
Collaborator

ml31415 commented Apr 9, 2024

This is now fixed in 9c918ae . But at the same time, py3.7 and py3.8 are not supported anymore.

@ml31415 ml31415 closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants