{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/53","repository_url":"https://api.github.com/repos/Azure/azure-documentdb-python","labels_url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/53/comments","events_url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/53/events","html_url":"https://github.com/Azure/azure-documentdb-python/pull/53","id":159528523,"number":53,"title":"Python3 support","user":{"login":"RedCraig","id":1644211,"avatar_url":"https://avatars.githubusercontent.com/u/1644211?v=3","gravatar_id":"","url":"https://api.github.com/users/RedCraig","html_url":"https://github.com/RedCraig","followers_url":"https://api.github.com/users/RedCraig/followers","following_url":"https://api.github.com/users/RedCraig/following{/other_user}","gists_url":"https://api.github.com/users/RedCraig/gists{/gist_id}","starred_url":"https://api.github.com/users/RedCraig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RedCraig/subscriptions","organizations_url":"https://api.github.com/users/RedCraig/orgs","repos_url":"https://api.github.com/users/RedCraig/repos","events_url":"https://api.github.com/users/RedCraig/events{/privacy}","received_events_url":"https://api.github.com/users/RedCraig/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Azure/azure-documentdb-python/labels/cla-not-required","name":"cla-not-required","color":"009800"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-09T23:09:05Z","updated_at":"2016-10-02T04:38:27Z","closed_at":"2016-10-02T04:38:26Z","pull_request":{"url":"https://api.github.com/repos/Azure/azure-documentdb-python/pulls/53","html_url":"https://github.com/Azure/azure-documentdb-python/pull/53","diff_url":"https://github.com/Azure/azure-documentdb-python/pull/53.diff","patch_url":"https://github.com/Azure/azure-documentdb-python/pull/53.patch"},"body":"This PR adds support for python3, while maintaining support for python2.7.\r\n\r\nWhere possible I've used `try`/`except`:\r\n```python\r\ntry:\r\n    python2.7 code\r\nexcept AttributeError:\r\n    python3.5 code\r\n```\r\nIn some cases I had to resort to checking the `sys.version_info` and determining the code path based on that.\r\n\r\nPlease pay extra close attention to the changes I made to `__GetAuthorizationTokenUsingMasterKey` as this is used in all request auth header generation.\r\n\r\nNote: This was branched from the branch in PR #51, and therefore includes the changes made for PR #51.\r\n# Unittests\r\n### master test status:\r\n`crud_tests.py` gives many `429` Request Rate too high errors, so it's difficult to fully test when branching/making changes. See #49.\r\n- test/crud_tests.py\r\n    Ran 72 tests, 33 errors:\r\n  - `test_attachment_crud_self_link`:\r\n      Fails intermittently/randomly. See Issue #52\r\n  - `test_partitioned_collection_path_parser`:\r\n    ```\r\n      FileNotFoundError: [Errno 2] No such file or directory: '/Users/<name>/.net/Microsoft.Azure.Documents.Client.Test/Routing/resources/BaselineTest.PathParser.json\r\n    ```\r\n  - `test_id_validation`:\r\n    ```\r\n    {\"code\":\"Conflict\",\"message\":\"Message: {\\\\\"Errors\\\\\":[\\\\\"Resource with specified id or name already exists\\\\\"\r\n    ```\r\n  - `test_offer_replace`:\r\n      ```pydocumentdb.errors.HTTPFailure: Status code: 400\r\n      b'{\"code\":\"BadRequest\",\"message\":\"Offer type is not supported with Offer version \\'V2\\' and above.\\\\r\\\\nActivityId: f7758066-ddd7-4521-b72d-a220ce6ed37b\"}'\r\n      ```\r\n  - `test_sql_query_crud`\r\n      `HTTPFailure: Status code: 409`\r\n      `{\"code\":\"Conflict\",\"message\":\"Message: {\\\"Errors\\\":[\\\"Resource with specified id or name already exists\\\"]}`\r\n- python test/ttl_tests.py:\r\n    pass\r\n\r\n### python3 branch unittests using `python3.5` & `python2.7`:\r\n- test/crud_tests.py - same as master.\r\n- python test/ttl_tests.py - pass - same as master.\r\n\r\n## HTTP Connection closure\r\nPython3 warns:\r\n```bash\r\n/Projects/azure-documentdb-python/pydocumentdb/synchronized_request.py:179: \r\nResourceWarning: unclosed <ssl.SSLSocket fd=4, \r\nfamily=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, \r\nproto=6, laddr=(<addr ommitted>), raddr=(<addr ommitted>)>\r\n```\r\nthe code now explicitly closes HTTP connections _except in the streaming case_. If the data is streamed then the response is passed back, then this needs some other mechanism for the user/API to close the connection when streaming is complete, as immediate closure won’t work."},"comment":{"url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/comments/250953272","html_url":"https://github.com/Azure/azure-documentdb-python/pull/53#issuecomment-250953272","issue_url":"https://api.github.com/repos/Azure/azure-documentdb-python/issues/53","id":250953272,"user":{"login":"rnagpal","id":13354131,"avatar_url":"https://avatars.githubusercontent.com/u/13354131?v=3","gravatar_id":"","url":"https://api.github.com/users/rnagpal","html_url":"https://github.com/rnagpal","followers_url":"https://api.github.com/users/rnagpal/followers","following_url":"https://api.github.com/users/rnagpal/following{/other_user}","gists_url":"https://api.github.com/users/rnagpal/gists{/gist_id}","starred_url":"https://api.github.com/users/rnagpal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnagpal/subscriptions","organizations_url":"https://api.github.com/users/rnagpal/orgs","repos_url":"https://api.github.com/users/rnagpal/repos","events_url":"https://api.github.com/users/rnagpal/events{/privacy}","received_events_url":"https://api.github.com/users/rnagpal/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T04:38:26Z","updated_at":"2016-10-02T04:38:26Z","body":"@RedCraig We have made lots of product changes and released 2.0.0 version which has the support for Python3, so I'm closing your Pull request. Let us know if you still see any issues running the tests with Python3."}}
{"actor":{"display_login":"rnagpal"}}