url
stringlengths
50
53
repository_url
stringclasses
1 value
labels_url
stringlengths
64
67
comments_url
stringlengths
59
62
events_url
stringlengths
57
60
html_url
stringlengths
38
43
id
int64
597k
2.65B
node_id
stringlengths
18
32
number
int64
1
6.83k
title
stringlengths
1
296
user
dict
labels
listlengths
0
5
state
stringclasses
2 values
locked
bool
2 classes
assignee
dict
assignees
listlengths
0
4
milestone
dict
comments
int64
0
211
created_at
stringlengths
20
20
updated_at
stringlengths
20
20
closed_at
stringlengths
20
20
author_association
stringclasses
3 values
active_lock_reason
stringclasses
4 values
body
stringlengths
0
65.6k
closed_by
dict
reactions
dict
timeline_url
stringlengths
59
62
performed_via_github_app
null
state_reason
stringclasses
3 values
draft
bool
2 classes
pull_request
dict
is_pull_request
bool
2 classes
issue_comments
listlengths
0
30
https://api.github.com/repos/psf/requests/issues/928
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/928/labels{/name}
https://api.github.com/repos/psf/requests/issues/928/comments
https://api.github.com/repos/psf/requests/issues/928/events
https://github.com/psf/requests/issues/928
8,198,549
MDU6SXNzdWU4MTk4NTQ5
928
invalid charset
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-11-08T09:25:36Z
2021-09-09T05:00:52Z
2013-01-21T20:44:37Z
NONE
resolved
r=requests.get("http://export.yandex.ru/weather-ng/forecasts/26686.xml") print r.encoding > > ISO-8859-1 > > print r.text.**class** > > <type 'unicode'> cant write to file valid content --- urllib return <type 'str'>, read/write to file dont break text
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/928/reactions" }
https://api.github.com/repos/psf/requests/issues/928/timeline
null
completed
null
null
false
[ "You could call `.encode()` on `r.text`. If there aren't any characters \nthat can be converted to ASCII, try `.encode('utf-8')` and that should write \nwithout a problem to your file, you'll just need to open the file using \n`codecs.open`.\n", "perhaps we should fallback to chardet detection if the provided encoding doesn't exist on the system.\n", "``` pycon\n>>> codecs.lookup('utf-8')\n<codecs.CodecInfo object for encoding utf-8 at 0x100371b48>\n>>> codecs.lookup('utf-fake')\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nLookupError: unknown encoding: utf-89\n```\n", "Should be fairly simple.\n", "Why was this closed?\n", "Not sure why it was closed, but charade has problems with this. Re-ticketing that portion over there sigmavirus24/charade#2.\n", "Excepting the charade problems which are ticketed there, this is resolved. =)\n" ]
https://api.github.com/repos/psf/requests/issues/927
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/927/labels{/name}
https://api.github.com/repos/psf/requests/issues/927/comments
https://api.github.com/repos/psf/requests/issues/927/events
https://github.com/psf/requests/issues/927
8,185,272
MDU6SXNzdWU4MTg1Mjcy
927
requests.post() adds unwanted Authorization: Basic header with anonymous:[email protected]
{ "avatar_url": "https://avatars.githubusercontent.com/u/27057?v=4", "events_url": "https://api.github.com/users/temoto/events{/privacy}", "followers_url": "https://api.github.com/users/temoto/followers", "following_url": "https://api.github.com/users/temoto/following{/other_user}", "gists_url": "https://api.github.com/users/temoto/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/temoto", "id": 27057, "login": "temoto", "node_id": "MDQ6VXNlcjI3MDU3", "organizations_url": "https://api.github.com/users/temoto/orgs", "received_events_url": "https://api.github.com/users/temoto/received_events", "repos_url": "https://api.github.com/users/temoto/repos", "site_admin": false, "starred_url": "https://api.github.com/users/temoto/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/temoto/subscriptions", "type": "User", "url": "https://api.github.com/users/temoto", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-11-07T20:38:39Z
2021-09-09T00:00:56Z
2012-11-24T08:45:39Z
NONE
resolved
``` import requests requests.post("http://localhost:9091/", data="foobar") $ nc -l -p 9091 POST / HTTP/1.1 Host: localhost:9091 Content-Length: 6 Authorization: Basic YW5vbnltb3VzOm5vQG1haWwuZG9t Accept-Encoding: gzip, deflate, compress Accept: */* User-Agent: python-requests/0.14.2 CPython/2.7.3 Linux/3.6.0-1-ARCH foobar^C $ base64 -d YW5vbnltb3VzOm5vQG1haWwuZG9t anonymous:[email protected] ``` WTF this is coming from? So after poking a bit, i found that it's from my .netrc: `default login anonymous password [email protected]` Okay, so i have to disable automatic netrc support somehow. Please, tell me one thing, how does it correspond to #44 where auth is explicitly set, but no header is sent and here no auth is set but header is sent?
{ "avatar_url": "https://avatars.githubusercontent.com/u/27057?v=4", "events_url": "https://api.github.com/users/temoto/events{/privacy}", "followers_url": "https://api.github.com/users/temoto/followers", "following_url": "https://api.github.com/users/temoto/following{/other_user}", "gists_url": "https://api.github.com/users/temoto/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/temoto", "id": 27057, "login": "temoto", "node_id": "MDQ6VXNlcjI3MDU3", "organizations_url": "https://api.github.com/users/temoto/orgs", "received_events_url": "https://api.github.com/users/temoto/received_events", "repos_url": "https://api.github.com/users/temoto/repos", "site_admin": false, "starred_url": "https://api.github.com/users/temoto/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/temoto/subscriptions", "type": "User", "url": "https://api.github.com/users/temoto", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/927/reactions" }
https://api.github.com/repos/psf/requests/issues/927/timeline
null
completed
null
null
false
[ "Interesting. I'd remove that from your `.netrc` immediately, fwiw :)\n\nAlso, there's a config you can set to diasble this: `trust_env=False`\n", "Thank you. I did not touch .netrc in years, i think this line was useful for browsing public FTP.\n\nStill it is not clear why in one case requests does not send explicitly set auth headers on premise that exact algorithm (Basic, Digest, etc) is not known beforehand. Does .netrc somehow imply Basic authorization?\n", "If you think about the Requests API this actually makes sense. Requests special-cases Basic Auth so you can just pass a naked tuple to the `auth` parameter, but otherwise you need to pass a class that implements a few special methods. There's no provision for you to pass anything to the `auth` parameter that means \"Use my .netrc file with this authentication type\". Maybe there should be, but right now, if you haven't told Requests what auth type to use, it will assume you mean Basic Auth, whether you use a tuple or .netrc.\n\nDoes that answer your question?\n", "@Lukasa there shouldn't be such a parameter ;)\n", "You shouldn't have that line in your `.netrc`. If it's extremely common, we can consider special-casing it.\n", "@Lukasa Yes, it does, thank you for thorough answer. And i just tested, the #44 would be satisfied now that requests actually send Basic right away. Everything is consistent now.\n\nThank you.\n" ]
https://api.github.com/repos/psf/requests/issues/926
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/926/labels{/name}
https://api.github.com/repos/psf/requests/issues/926/comments
https://api.github.com/repos/psf/requests/issues/926/events
https://github.com/psf/requests/issues/926
8,148,705
MDU6SXNzdWU4MTQ4NzA1
926
Installation problems on Windows
{ "avatar_url": "https://avatars.githubusercontent.com/u/421098?v=4", "events_url": "https://api.github.com/users/Captain-Sandwich/events{/privacy}", "followers_url": "https://api.github.com/users/Captain-Sandwich/followers", "following_url": "https://api.github.com/users/Captain-Sandwich/following{/other_user}", "gists_url": "https://api.github.com/users/Captain-Sandwich/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Captain-Sandwich", "id": 421098, "login": "Captain-Sandwich", "node_id": "MDQ6VXNlcjQyMTA5OA==", "organizations_url": "https://api.github.com/users/Captain-Sandwich/orgs", "received_events_url": "https://api.github.com/users/Captain-Sandwich/received_events", "repos_url": "https://api.github.com/users/Captain-Sandwich/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Captain-Sandwich/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Captain-Sandwich/subscriptions", "type": "User", "url": "https://api.github.com/users/Captain-Sandwich", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-11-06T18:55:30Z
2021-09-09T05:30:57Z
2012-11-06T18:59:33Z
NONE
resolved
I wanted to install using pip and it gives me the following error: ``` python PS C:\Users\bla> pip install requests Downloading/unpacking requests Real name of requirement requests is requests Downloading requests-0.14.2.tar.gz (361Kb): 361Kb downloaded Running setup.py egg_info for package requests Traceback (most recent call last): File "<string>", line 14, in <module> File "C:\Users\patrick\build\requests\setup.py", line 6, in <module> import requests File "requests\__init__.py", line 52, in <module> from . import utils File "requests\utils.py", line 22, in <module> from .compat import parse_http_list as _parse_list_header File "requests\compat.py", line 112, in <module> from .packages import chardet2 as chardet ImportError: cannot import name chardet2 Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 14, in <module> File "C:\Users\patrick\build\requests\setup.py", line 6, in <module> import requests File "requests\__init__.py", line 52, in <module> from . import utils File "requests\utils.py", line 22, in <module> from .compat import parse_http_list as _parse_list_header File "requests\compat.py", line 112, in <module> from .packages import chardet2 as chardet ImportError: cannot import name chardet2 ---------------------------------------- Command python setup.py egg_info failed with error code 1 ``` I can import chardet as chardet from the interpreter. importing chardet2 fails. i guess this is a dependency that wasn't properly updated. the python version is 3.2.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/421098?v=4", "events_url": "https://api.github.com/users/Captain-Sandwich/events{/privacy}", "followers_url": "https://api.github.com/users/Captain-Sandwich/followers", "following_url": "https://api.github.com/users/Captain-Sandwich/following{/other_user}", "gists_url": "https://api.github.com/users/Captain-Sandwich/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Captain-Sandwich", "id": 421098, "login": "Captain-Sandwich", "node_id": "MDQ6VXNlcjQyMTA5OA==", "organizations_url": "https://api.github.com/users/Captain-Sandwich/orgs", "received_events_url": "https://api.github.com/users/Captain-Sandwich/received_events", "repos_url": "https://api.github.com/users/Captain-Sandwich/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Captain-Sandwich/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Captain-Sandwich/subscriptions", "type": "User", "url": "https://api.github.com/users/Captain-Sandwich", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/926/reactions" }
https://api.github.com/repos/psf/requests/issues/926/timeline
null
completed
null
null
false
[ "Have you searched for `chardet2` in opened issues before raising this? It's a duplicate.\n", "i searched for windows. sorry\n" ]
https://api.github.com/repos/psf/requests/issues/925
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/925/labels{/name}
https://api.github.com/repos/psf/requests/issues/925/comments
https://api.github.com/repos/psf/requests/issues/925/events
https://github.com/psf/requests/pull/925
8,082,508
MDExOlB1bGxSZXF1ZXN0Mjg3NDAxOQ==
925
Fix a bug in _encode_params
{ "avatar_url": "https://avatars.githubusercontent.com/u/551404?v=4", "events_url": "https://api.github.com/users/russelldavis/events{/privacy}", "followers_url": "https://api.github.com/users/russelldavis/followers", "following_url": "https://api.github.com/users/russelldavis/following{/other_user}", "gists_url": "https://api.github.com/users/russelldavis/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/russelldavis", "id": 551404, "login": "russelldavis", "node_id": "MDQ6VXNlcjU1MTQwNA==", "organizations_url": "https://api.github.com/users/russelldavis/orgs", "received_events_url": "https://api.github.com/users/russelldavis/received_events", "repos_url": "https://api.github.com/users/russelldavis/repos", "site_admin": false, "starred_url": "https://api.github.com/users/russelldavis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/russelldavis/subscriptions", "type": "User", "url": "https://api.github.com/users/russelldavis", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-11-03T20:08:12Z
2021-09-08T23:06:00Z
2012-11-15T10:13:30Z
CONTRIBUTOR
resolved
It wasn't utf-8 encoding strings in values that are iterable but not a list.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/925/reactions" }
https://api.github.com/repos/psf/requests/issues/925/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/925.diff", "html_url": "https://github.com/psf/requests/pull/925", "merged_at": "2012-11-15T10:13:30Z", "patch_url": "https://github.com/psf/requests/pull/925.patch", "url": "https://api.github.com/repos/psf/requests/pulls/925" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/924
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/924/labels{/name}
https://api.github.com/repos/psf/requests/issues/924/comments
https://api.github.com/repos/psf/requests/issues/924/events
https://github.com/psf/requests/issues/924
8,063,372
MDU6SXNzdWU4MDYzMzcy
924
Implement a peek method.
{ "avatar_url": "https://avatars.githubusercontent.com/u/67232?v=4", "events_url": "https://api.github.com/users/aleray/events{/privacy}", "followers_url": "https://api.github.com/users/aleray/followers", "following_url": "https://api.github.com/users/aleray/following{/other_user}", "gists_url": "https://api.github.com/users/aleray/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/aleray", "id": 67232, "login": "aleray", "node_id": "MDQ6VXNlcjY3MjMy", "organizations_url": "https://api.github.com/users/aleray/orgs", "received_events_url": "https://api.github.com/users/aleray/received_events", "repos_url": "https://api.github.com/users/aleray/repos", "site_admin": false, "starred_url": "https://api.github.com/users/aleray/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aleray/subscriptions", "type": "User", "url": "https://api.github.com/users/aleray", "user_view_type": "public" }
[]
closed
true
null
[]
null
16
2012-11-02T16:20:18Z
2021-09-09T05:00:42Z
2013-02-10T22:34:10Z
NONE
resolved
From http://stackoverflow.com/questions/13197854/python-requests-fetching-the-head-of-the-response-content-without-consuming-it/ Using python-requests and python-magic, I would like to test the mime-type of a web resource without fetching all its content (especially if this resource happens to be eg. an ogg file or a PDF file). Based on the result, I might decide to fetch it all. However calling the text method after having tested the mime-type only returns what hasn't been consumed yet. How could I test the mime-type without consuming the response content? Below is my current code. ``` import requests import magic r = requests.get("http://www.december.com/html/demo/hello.html", prefetch=False) mime = magic.from_buffer(r.iter_content(256).next(), mime=True) if mime == "text/html": print(r.text) # I'd like r.text to give me the entire response content ``` I've been given the following solution: ``` r = requests.get("http://www.december.com/html/demo/hello.html", prefetch=False) peek = r.iter_content(256).next() mime = magic.from_buffer(peek, mime=True) if mime == "text/html": contents = peek + ''.join(r.iter_content(10 * 1024)) encoding = r.encoding if encoding is None: # detect encoding encoding = chardet.detect(contents)['encoding'] try: textcontent = unicode(contents, encoding, errors='replace') except (LookupError, TypeError): textcontent = unicode(contents, errors='replace') print(textcontent) ``` I was wondering if such a case could be adressed by the api directly, for instance by implementing a peek method, or by making it possible to rewind the iter_content cursor. Thanks
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/924/reactions" }
https://api.github.com/repos/psf/requests/issues/924/timeline
null
completed
null
null
false
[ "Sorry about the delay in getting back to you on this!\n\nIs there any reason you can't do this with the HEAD request? For example, can you do:\n\n``` python\nimport requests\n\nurl = \"http://www.december.com/html/demo/hello.html'\n\nr = requests.head(url)\nif r.headers['Content-Type'] == 'text/html':\n r = requests.get(url)\n # Do stuff\n```\n", "## If I'm not mistaken, not every website supports a request with HEAD. But don't mistake that for support of this issue. I'm +0 on this.\n\nSent from my Android phone with K-9 Mail. Please excuse my brevity.\n", "Yeah, there are some that don't, but if @aleray can handle his particular problem using HEAD then that will work well. =D\n", "Hey,\n\nthanks for your comments. Actually I could use the served content-type but since it is sometimes wrong I wanted to double-check with python-magic, based on the first bytes of the response body... Would there be a way to \"cache\" the content so I could access the full content of the page several times without having to worry about the response content being consumed by my first look at it?\n\nThanks\n", "> Would there be a way to \"cache\" the content so I could access the full content of the page several times without having to worry about the response content being consumed by my first look at it?\n\n`cached_content = reply.content` ?\n", "Yes, except that if I'm facing an 300 Gb ogg video I would rather avoid to download it entirely if the first bytes are enough for what I need to do...\n", "@aleray: you can do that today:\n\n``` pycon\n>>> r = request.get('http://...', prefetch=False)\n>>> r.raw.read(10)\n'xxxxxxxxxx'\n```\n", "On Sat, Nov 24, 2012 at 05:56:36PM -0800, Kenneth Reitz wrote:\n\n> @aleray: you can do that today:\n> \n> ``` pycon\n> >>> r = request.get('http://...', prefetch=False)\n> >>> r.raw.read(10)\n> 'xxxxxxxxxx'\n> \n> ```\n\nI was just thinking of this. With a normal socket (or file-descriptor-like \nAPI), you can seek backward to the beginning of the file, can you do that with \nthe raw socket? If so, the peek method becomes trivial.\n", "I'm unaware. @shazow?\n", "`dir` would imply otherwise. Sorry for getting anyone's hopes up.\n", "Peek normally isn't 100% required. For example, the standard library's `gzip` library has a little-known flag you can pass to the mode that lets it work on streams, without peek.\n", "```\n>>> r = request.get('http://...', prefetch=False)\n>>> r.raw.read(10)\n```\n\n@kennethreitz\nBut this is not peeking what OP askes for but reading which would influence data returned by the api like `.content` etc., right? Is the untold assumption that a client must remember to prepend data read outside of the api to what api returns later?\n\nIt looks like it would be possible to do with slightly modified version of [`tee`](http://docs.python.org/2/library/itertools.html#itertools.tee) from `itertools`. The modification would be to allow for removing given deques so that they would not receive and accumulate further data.\n\nUPDATE\n\nThis is not as straightforward as `iter_content` is a generator not an iterator. Still I think it's doable by making `Response.raw` an iterator and teeing it.\n", "@piotr-dobrogost `raw` is a file-like object, no? Can you not iterate over it? If not, that might be a nifty feature to add to urllib3 (if I remember correctly that raw is a urllib3 object).\n", "> Can you not iterate over it?\n\nSure, you can. I was focused on teeing `iter_content` and for some reason I thought it's not possible as `iter_content` is a generator. However it's possible (http://stackoverflow.com/q/1271320/95735). So the thing to do would be modification of `tee` as described above.\n", "@aleray, did @piotr-dobrogost's solution satisfy your needs?\n", "You could always request a small byte range, determine it's content-type with libmagic, and then re-request it again its entirety if you want. This does involve two requests, but you won't have to slurp down a full 300GB of a movie twice. You also won't have to muck about with raw sockets at all.\n\n```\nr = requests.get(\"http://www.december.com/html/demo/hello.html\", headers={'Range': 'bytes=0-256'})\n```\n" ]
https://api.github.com/repos/psf/requests/issues/923
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/923/labels{/name}
https://api.github.com/repos/psf/requests/issues/923/comments
https://api.github.com/repos/psf/requests/issues/923/events
https://github.com/psf/requests/issues/923
8,043,220
MDU6SXNzdWU4MDQzMjIw
923
cookies problem
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-11-01T21:02:49Z
2021-09-09T05:30:56Z
2012-11-16T22:48:43Z
NONE
resolved
Hi, Iam trying to post a form with cookies. When I post the form and see the page with the results, there is an error in the page, saying that I didnt fill one field right. Iam absolute sure I fill that field right. When I post the data with web browser, its all right. I think it must be cookie problem, becose when I disable the cookies in the browser and post the right data, it shows the exact same error when I send it via Python. There is the code: ``` python # -*- coding: utf-8 -*- import urllib, urllib2 import cookielib import requests adress= 'http://....' param= { 'name' : '....', 'email' : '....', 'phone' : '....', 'message' : '....'}#etc... headers = { 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', 'Connection': 'keep-alive', 'Accept-Language': 'en-us,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' } c=requests.session() requestp = c.get(adress) SSID=requestp.cookies['PHPSESSID'] cookiesp = dict(PHPSESSID=SSID) request = c.post(adress, data=param, headers=headers) print request.headers #headers of the result webpage print request.request.headers #headers posted ``` Output: ``` {'content-length': '6911', 'x-powered-by': 'PHP/5.3.17-1~dotdeb.0', 'expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'server': 'nginx/1.2.4', 'connection': 'keep-alive', 'pragma': 'no-cache', 'cache-control': 'max-age=200', 'date': 'Thu, 01 Nov 2012 19:44:14 GMT', 'content-type': 'application/xhtml+xml; charset=utf-8'} {'Accept-Language': 'en-us,en;q=0.5', 'Accept-Encoding': 'gzip, deflate', 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', 'Cookie': 'PHPSESSID=2des6ks39kouoqvn3u6l425kp6', 'Content-Type': 'application/x-www-form-urlencoded'} ``` If you have same ideas what is wrong, I would so gratefull. Thank you very much and I apologise for my english (: Ok, I solved this with mechanize... can you delete it?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/923/reactions" }
https://api.github.com/repos/psf/requests/issues/923/timeline
null
completed
null
null
false
[ "Resolved by user intervention.\n" ]
https://api.github.com/repos/psf/requests/issues/922
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/922/labels{/name}
https://api.github.com/repos/psf/requests/issues/922/comments
https://api.github.com/repos/psf/requests/issues/922/events
https://github.com/psf/requests/pull/922
7,982,189
MDExOlB1bGxSZXF1ZXN0MjgyNzI5Ng==
922
raise_for_status should raise when status_code is None
{ "avatar_url": "https://avatars.githubusercontent.com/u/165819?v=4", "events_url": "https://api.github.com/users/drmaples/events{/privacy}", "followers_url": "https://api.github.com/users/drmaples/followers", "following_url": "https://api.github.com/users/drmaples/following{/other_user}", "gists_url": "https://api.github.com/users/drmaples/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/drmaples", "id": 165819, "login": "drmaples", "node_id": "MDQ6VXNlcjE2NTgxOQ==", "organizations_url": "https://api.github.com/users/drmaples/orgs", "received_events_url": "https://api.github.com/users/drmaples/received_events", "repos_url": "https://api.github.com/users/drmaples/repos", "site_admin": false, "starred_url": "https://api.github.com/users/drmaples/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/drmaples/subscriptions", "type": "User", "url": "https://api.github.com/users/drmaples", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-10-30T21:22:23Z
2021-09-08T17:05:58Z
2012-11-23T10:05:18Z
NONE
resolved
r.raise_for_status and r.ok should not report success when response has wonky data. this occurs when you use grequests and the greenlet encounters problems (timeout, etc) ``` python import grequests urls = [grequests.get('http://google.com/?q={}'.format(n), timeout=.001) for n in range(3)] responses = grequests.map(urls, size=2) print '# responses={}'.format(len(responses)) for r in responses: print 'status_code={}; ok={}; error={}'.format(r.status_code, r.ok, r.error) r.raise_for_status() ``` ``` Traceback (most recent call last): File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run result = self._run(*self.args, **self.kwargs) File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/requests/models.py", line 631, in send raise ConnectionError(sockerr) ConnectionError: [Errno 65] No route to host <Greenlet at 0x1013f2c30: <bound method Request.send of <Request [GET]>>(prefetch=True)> failed with ConnectionError Traceback (most recent call last): File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run result = self._run(*self.args, **self.kwargs) File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/requests/models.py", line 631, in send raise ConnectionError(sockerr) ConnectionError: [Errno 65] No route to host <Greenlet at 0x1013f2af0: <bound method Request.send of <Request [GET]>>(prefetch=True)> failed with ConnectionError Traceback (most recent call last): File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run result = self._run(*self.args, **self.kwargs) File "/Users/darrell/.virtualenvs/clarence/lib/python2.7/site-packages/requests/models.py", line 631, in send raise ConnectionError(sockerr) ConnectionError: [Errno 65] No route to host <Greenlet at 0x1013f27d0: <bound method Request.send of <Request [GET]>>(prefetch=True)> failed with ConnectionError # responses=3 status_code=None; ok=True; error=None status_code=None; ok=True; error=None status_code=None; ok=True; error=None ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/922/reactions" }
https://api.github.com/repos/psf/requests/issues/922/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/922.diff", "html_url": "https://github.com/psf/requests/pull/922", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/922.patch", "url": "https://api.github.com/repos/psf/requests/pulls/922" }
true
[ "You might want to rebase this pull request to get Travis to test it again. There's really no reason for it to have failed. =)\n", "Close/Repopen to trigger rebuild.\n", "May have to update some of the tests as well ;)\n", "Closing for now. Reopen if you update!\n" ]
https://api.github.com/repos/psf/requests/issues/921
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/921/labels{/name}
https://api.github.com/repos/psf/requests/issues/921/comments
https://api.github.com/repos/psf/requests/issues/921/events
https://github.com/psf/requests/pull/921
7,971,285
MDExOlB1bGxSZXF1ZXN0MjgyMTgzOQ==
921
Added 'zip_safe' flag to 'setup.py' & Fixed typo in 'MANIFEST.in'
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
false
null
[]
null
1
2012-10-30T15:32:53Z
2014-06-23T23:41:09Z
2012-11-08T06:08:33Z
NONE
null
While installing `requests` using the `python setup.py --quiet install` command, I noticed the following warnings: ``` warning: no files found matching 'tests/*.' zip_safe flag not set; analyzing archive contents... requests.certs: module references __file__ ``` After a bit of digging I found out that the first of those had to do with the `tests/*.` (notice the dot) pattern used in `MANIFEST.in`, so that I corrected it in the second of the associated commits. The other two messages (the last of which is the reasoning behind the choice) show that the package is not ["zip-safe"](http://bit.ly/PjdL9X), so that I added the `zip_safe=False` flag to the `setup.py` file in the first of the associated commits.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/921/reactions" }
https://api.github.com/repos/psf/requests/issues/921/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/921.diff", "html_url": "https://github.com/psf/requests/pull/921", "merged_at": "2012-11-08T06:08:33Z", "patch_url": "https://github.com/psf/requests/pull/921.patch", "url": "https://api.github.com/repos/psf/requests/pulls/921" }
true
[ "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/920
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/920/labels{/name}
https://api.github.com/repos/psf/requests/issues/920/comments
https://api.github.com/repos/psf/requests/issues/920/events
https://github.com/psf/requests/issues/920
7,955,629
MDU6SXNzdWU3OTU1NjI5
920
Settings wrong form-data format for params when used with file upload
{ "avatar_url": "https://avatars.githubusercontent.com/u/307597?v=4", "events_url": "https://api.github.com/users/hartator/events{/privacy}", "followers_url": "https://api.github.com/users/hartator/followers", "following_url": "https://api.github.com/users/hartator/following{/other_user}", "gists_url": "https://api.github.com/users/hartator/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hartator", "id": 307597, "login": "hartator", "node_id": "MDQ6VXNlcjMwNzU5Nw==", "organizations_url": "https://api.github.com/users/hartator/orgs", "received_events_url": "https://api.github.com/users/hartator/received_events", "repos_url": "https://api.github.com/users/hartator/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hartator/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hartator/subscriptions", "type": "User", "url": "https://api.github.com/users/hartator", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-30T00:25:44Z
2021-09-09T05:30:55Z
2012-11-16T22:56:14Z
NONE
resolved
Hey to all, and thank you for great library! I might have found an issue with the way of requests handle file POST upload when they are sent with additional params which aren't files. It adds an extra `Content-Type: text/plain` to fields that aren't a file. (according to the W3c and from sniffing my own browsers to be sure) For example, when I run this : ``` requests.post('localhost',files={'file1.txt' : open('file1.txt','rb')},data={'submit-name':'Larry'}) ``` or this (I don't really which one to prefer I guess `data` over `params`) : ``` requests.post('localhost',files={'file1.txt' : open('file1.txt','rb')},params={'submit-name':'Larry'})) ``` requests send this : ``` Content-Type: multipart/form-data; boundary=AaB03x --AaB03x Content-Disposition: form-data; name="submit-name" Content-Type: text/plain Larry --AaB03x Content-Disposition: form-data; name="files"; filename="file1.txt" Content-Type: text/plain ... contents of file1.txt ... --AaB03x-- ``` when it should have sent this : ``` Content-Type: multipart/form-data; boundary=AaB03x --AaB03x Content-Disposition: form-data; name="submit-name" Larry --AaB03x Content-Disposition: form-data; name="files"; filename="file1.txt" Content-Type: text/plain ... contents of file1.txt ... --AaB03x-- ``` I think the issue is more urllib3 related than requests related and I've opened an issue here (https://github.com/shazow/urllib3/issues/111) but maybe I am wrong or maybe you guys would want to know!
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/920/reactions" }
https://api.github.com/repos/psf/requests/issues/920/timeline
null
completed
null
null
false
[ "Looks like your `urllib3` pull request was accepted, so I guess we can consider this resolved.\n\nUseful note: `params` does not do what you think it does. It builds a query string:\n\n``` python\n>>> r = requests.get('http://www.google.co.uk/', params={'key': 'value'})\n>>> r.url\nu'http://www.google.co.uk/?key=value'\n```\n" ]
https://api.github.com/repos/psf/requests/issues/919
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/919/labels{/name}
https://api.github.com/repos/psf/requests/issues/919/comments
https://api.github.com/repos/psf/requests/issues/919/events
https://github.com/psf/requests/issues/919
7,946,460
MDU6SXNzdWU3OTQ2NDYw
919
Add an option to disable netrc parsing
{ "avatar_url": "https://avatars.githubusercontent.com/u/49615?v=4", "events_url": "https://api.github.com/users/tgecho/events{/privacy}", "followers_url": "https://api.github.com/users/tgecho/followers", "following_url": "https://api.github.com/users/tgecho/following{/other_user}", "gists_url": "https://api.github.com/users/tgecho/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tgecho", "id": 49615, "login": "tgecho", "node_id": "MDQ6VXNlcjQ5NjE1", "organizations_url": "https://api.github.com/users/tgecho/orgs", "received_events_url": "https://api.github.com/users/tgecho/received_events", "repos_url": "https://api.github.com/users/tgecho/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tgecho/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tgecho/subscriptions", "type": "User", "url": "https://api.github.com/users/tgecho", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-29T18:19:45Z
2021-09-09T05:30:57Z
2012-10-31T00:24:52Z
NONE
resolved
As suggested here: https://github.com/kennethreitz/requests/pull/446
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/919/reactions" }
https://api.github.com/repos/psf/requests/issues/919/timeline
null
completed
null
null
false
[ "trust_env = False\n" ]
https://api.github.com/repos/psf/requests/issues/918
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/918/labels{/name}
https://api.github.com/repos/psf/requests/issues/918/comments
https://api.github.com/repos/psf/requests/issues/918/events
https://github.com/psf/requests/issues/918
7,930,988
MDU6SXNzdWU3OTMwOTg4
918
Requests 0.14.2 fails with Python 3.2 on Travis.ci
{ "avatar_url": "https://avatars.githubusercontent.com/u/145201?v=4", "events_url": "https://api.github.com/users/swernerx/events{/privacy}", "followers_url": "https://api.github.com/users/swernerx/followers", "following_url": "https://api.github.com/users/swernerx/following{/other_user}", "gists_url": "https://api.github.com/users/swernerx/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/swernerx", "id": 145201, "login": "swernerx", "node_id": "MDQ6VXNlcjE0NTIwMQ==", "organizations_url": "https://api.github.com/users/swernerx/orgs", "received_events_url": "https://api.github.com/users/swernerx/received_events", "repos_url": "https://api.github.com/users/swernerx/repos", "site_admin": false, "starred_url": "https://api.github.com/users/swernerx/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/swernerx/subscriptions", "type": "User", "url": "https://api.github.com/users/swernerx", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-29T10:14:53Z
2021-09-09T05:30:55Z
2012-11-16T23:07:03Z
NONE
resolved
Somehow chardet2 is missing; ``` File "requests/compat.py", line 112, in <module> from .packages import chardet2 as chardet ImportError: cannot import name chardet2 ``` See this log output for details: https://travis-ci.org/#!/zynga/jasy/builds/2972117
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/918/reactions" }
https://api.github.com/repos/psf/requests/issues/918/timeline
null
completed
null
null
false
[ "0.14.1 works fine BTW\n", "Duplicate issue [here](https://github.com/kennethreitz/requests/issues/916).\n", "Closed: duplicate.\n" ]
https://api.github.com/repos/psf/requests/issues/917
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/917/labels{/name}
https://api.github.com/repos/psf/requests/issues/917/comments
https://api.github.com/repos/psf/requests/issues/917/events
https://github.com/psf/requests/issues/917
7,926,839
MDU6SXNzdWU3OTI2ODM5
917
'params' argument does not accept custom query string
{ "avatar_url": "https://avatars.githubusercontent.com/u/813479?v=4", "events_url": "https://api.github.com/users/airnandez/events{/privacy}", "followers_url": "https://api.github.com/users/airnandez/followers", "following_url": "https://api.github.com/users/airnandez/following{/other_user}", "gists_url": "https://api.github.com/users/airnandez/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/airnandez", "id": 813479, "login": "airnandez", "node_id": "MDQ6VXNlcjgxMzQ3OQ==", "organizations_url": "https://api.github.com/users/airnandez/orgs", "received_events_url": "https://api.github.com/users/airnandez/received_events", "repos_url": "https://api.github.com/users/airnandez/repos", "site_admin": false, "starred_url": "https://api.github.com/users/airnandez/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/airnandez/subscriptions", "type": "User", "url": "https://api.github.com/users/airnandez", "user_view_type": "public" }
[]
closed
true
null
[]
null
17
2012-10-29T04:31:55Z
2021-09-09T05:30:47Z
2012-11-26T08:18:17Z
NONE
resolved
Hello, I'm evaluating `requests` as a building block to develop a client that needs to query a third party web service. I like the succinctness of the API so I would like to be able to use it. However, I'm facing the problem below. I need to be able to send requests using URLs of the form below: https://www.example.com/?versioning Please note that the query string of the URL is not of the type 'key=value' but just 'key'. In the `requests` API documentation, it is stated about the `params` argument of the constructor or class `requests.Request`: _params = None_ _Dictionary or **byte** of querystring data to attach to the Request._ However, if I pass a `bytes`argument I get an exception: `ValueError: cannot encode objects that are not 2-tuples` Looking at the source code (file utils.py:134) one can observe that `requests` does not accept bytes (nor string, nor bool, nor int, BTW). So I suspect, there is a bug in the documentation. What is the recommended way for using `requests` for interacting with a web service with a URL which needs a "custom" query string (e.g. not of the form "key=value")? Should I encode the query string in my application and pass it as part of the `url` argument and not as part of `params`argument? [Test context: Python v3.3, MacOS X v10.7.5] Thanks of your help.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/917/reactions" }
https://api.github.com/repos/psf/requests/issues/917/timeline
null
completed
null
null
false
[ "The docs need to be updated, sorry for the trouble. You should be adding the string directly to the URL that you're passing in.\n", "I think this can be closed now. See: https://github.com/kennethreitz/requests/commit/50877717c810d47e90281c85ecce198c08af40a5\n", "Good spot. Resolved by #940.\n", "I think passing params without values should be supported by `params` parameter. Currently setting param's value to `None` in `params` dict makes Requests skip adding the param to a query string. I propose to change this behavior so that in such case param is added without value. @kennethreitz What do you think?\n", "@piotr-dobrogost what about the following case:\n\n``` python\nfrom requests import session\n\n\ns = session(params={'param1': 'default1', 'param2': 'default2'})\n\n# perform requests with the default params\n# but now I don't want param1 set\n\nresponse = s.get(url, params={'param1': None})\nresponse.request.url\n# '...?param2=default2'\n```\n\nWith your proposed change, `response.request.url == '...?param1&param2=default2''`. Perhaps we could use `''` an empty string instead (if in fact we're realistically considering this)?\n", "Right, I forgot about this scenario. Related issue #378\n\n@airnandez\nWould `https://www.example.com/?versioning=` work in your case?\n", "@piotr-dobrogost I meant implement `''` as a special-case that wouldn't add the `=`\n", "According to 4.10.22.5 URL-encoded form data, point 4.10 from HTML5 working draft specification (http://www.w3.org/TR/2012/WD-html5-20120329/) `=` character must be present. Thus special-casing `''` to mean skip `=` is out of question as this is the most natural way to add a form field without value to query string in a conforming way. As you noticed `None` is used as a marker to remove such a field entirely from query string. We would have to introduce some magic token like `SKIP_VALUE` for value to designate skipping value **and** the `=` sign. It's not super nice API so the question still remains how often `key` alone is supported on the server side but `key=`, which is both conforming and supported by Requests is not?\n", "@piotr-dobrogost I love how you seem to find the specifications when they're needed.\n", "Thanks. I guess it comes from the fact this often seems easier than writing code :\\ However in this case HTML specification doesn't help this much as it pertains only to data from html `<form>` element being sent in the query string. Generally query string can be of any form as long as it conforms to constraints laid out in section [3.4 Query](http://tools.ietf.org/html/rfc3986#section-3.4) of URI specification. That's why I would base introduction of support for _free form_ query string based on real world usage of such query strings.\n", "Feels like this discussion is a bit separate from the original issue here (plus it keeps falling off my radar because it's in a closed issue). Want to open a new one for this feature suggestion?\n", "> Feels like this discussion is a bit separate from the original issue (...)\n\nNot even slightly :) We could and should continue here. If you could reopen, please do.\n", "Re-read the original post, you're quite right. =D\n", "But yeah, Requests does conform to the spec (proof for anyone who's wary to believe me and @piotr-dobrogost):\n\n``` python\nimport requests\n\nr = requests.get('http://httpbin.org/', params={'foo': ''})\nassert r.request.full_url == 'http://httpbin.org/?foo='\n```\n", "Hello, OP here,\n\n@piotr-dobrogost: \"Would https://www.example.com/?versioning= work in your case?\"\nUnfortunately not. The REST APIs I need to use requires the query string to have the form `?versioning` or `?acl` (i.e. without '=' and without value). \n\n@piotr-dobrogost: \"That's why I would base introduction of support for free form query string based on real world usage of such query strings.\"\nSee for instance the [Google storage API](https://developers.google.com/storage/docs/reference-methods) or [Amazon S3 REST API](http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGETversioningStatus.html).\nI just tested against Amazon S3 server and can confirm that a query string of the form `?versioning=` is not accepted.\n\nFrom the `Requests` user point of view, it would be nice to be able to express the contents of the query string in the `params` argument. From this exchange, I understand that associating a value of `None` or `''` (empty string) to a key in the params dict is not a viable solution. I would therefore suggest to allow for `Requests` users to provide the pre-formatted query string in the `params` argument. This user-provided query string should be non URL-encoded, for instance:\n\n```\n import requests\n r = requests.get('http://httpbin.org/', params='versioning&response=json')\n assert r.request.full_url == 'http://httpbin.org/?versioning&response=json'\n```\n\nI think this way of doing would be cleaner for the user than to embed the query string in the URL (even if this works in my particular case) and not to use the `params` argument. However, I acknowledge that this is very subjective.\n", "> it would be nice to be able to express the contents of the query string in the `params` argument\n\nTotally agree. It's misleading at best to have to embed query string into url in spite of the fact there's `params` param. Making `params` support pre-formatted query string goes in right direction. However having one parameter for both makes it impossible to have both at the same time. I would suggest adding new parameter `query_string` and combining contents of it with contents of `params` and the query string part of the url itself.\n@kennethreitz Is this ok?\n", "No. The current behavior is proper and was well thought out.\n" ]
https://api.github.com/repos/psf/requests/issues/916
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/916/labels{/name}
https://api.github.com/repos/psf/requests/issues/916/comments
https://api.github.com/repos/psf/requests/issues/916/events
https://github.com/psf/requests/issues/916
7,915,276
MDU6SXNzdWU3OTE1Mjc2
916
requests.packages.chardet2 missing in 0.14.2, preventing installation on Python 3.3
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
true
null
[]
null
19
2012-10-27T23:49:00Z
2021-09-09T05:30:48Z
2012-11-24T11:09:44Z
NONE
resolved
Requests-0.14.1 included requests.packages.chardet2. This module is missing in 0.14.2 but the setup process still attempts to load it for python3 builds. This prevents installing/upgrading to this version with pip3.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/916/reactions" }
https://api.github.com/repos/psf/requests/issues/916/timeline
null
completed
null
null
false
[ "Travis-ci have just say to me this is present with python3.2 too.\n", "I imagine this will present the same problem on any Python3.x platform, but I only tested it locally against 3.3.\n", "I can confirm this happens with Python 3.1, 3.2 and 3.3 while installing from PyPI. As a side note, `pip install requests==0.14.1` works just fine.\n", "It is missing from the 0.14.2 tarball fetched from PyPi.\n\n---\n\nFrom: Piotr Dobrogost [[email protected]]\nSent: October 28, 2012 9:32 AM\nTo: kennethreitz/requests\nCc: Viktor Haag\nSubject: Re: [requests] requests.packages.chardet2 missing in 0.14.2, preventing installation on Python 3.3 (#916)\n\nHow is it missing? I see it's present in https://github.com/kennethreitz/requests/zipball/v0.14.2 for example.\n\n—\nReply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/issues/916#issuecomment-9845781.\n", "@ViktorHaag: Right! Just installed from the GitHub tarballs and everything went smooth.\n", "@bmcustodio PyPI doesn't do the packaging, that's @kennethreitz's job. Something must have changed in `setup.py` between the 0.14.1 and 0.14.2 releases. If you feel like tackling that, be our guest.\n\nAlso the 0.14.2 tarball fetched from GitHub is generated by GitHub and not by @kennethreitz. So that tarball also includes a bunch of extra information that `setup.py` doesn't know what to do with.\n", "This is also affecting me on Python 3.3 with Homebrew on Mac.\n", "Sorry about this guys, looking into it.\n", "I'm not sure if this is related, but I noticed that installing 0.14.1 from PyPI (on Python 3.3) includes oauthlib, chardet, chardet2, and urllib3 in the packages directory, while installing it from the 0.14.1 GitHub tarball only includes chardet2 and urllib3. If you delete setup.cfg, PKG-INFO, and requests.egg-info from the PyPI tarball, it behaves the same as the GitHub tarball. This is using distribute 0.6.30.\n\nIn setup.py, it looks like the intent is to exclude chardet and oauthlib from 3.x installations and exclude chardet2 from 2.x installations (that is, the GitHub tarball behavior):\n\n``` python\nif is_py2:\n packages.extend([\n 'requests.packages.oauthlib',\n 'requests.packages.oauthlib.oauth1',\n 'requests.packages.oauthlib.oauth1.rfc5849',\n 'requests.packages.oauthlib.oauth2',\n 'requests.packages.oauthlib.oauth2.draft25',\n 'requests.packages.chardet',\n ])\nelse:\n packages.append('requests.packages.chardet2')\n```\n", "Could it be because `if is_py2:` is resolved at packaging time and not at installation time, so that if `python setup.py sdist upload` is executed on python2, `chardet2` is not included ?\n", "@madjar: Most certainly. On the other hand, if it had been packagaed under Python 3, the same would happen with the other vendored packages.\n", "@bmcustodio: My diagnosis as well. The tarball on pypi lacks chardet2; it looks like the package was uploaded to pypi using python 2. Cloning directly from GIT installs properly.\n", "Can we get an estimate on when this issue should be resolved? I would like to replace urllib2 with requests in [PRAW](https://github.com/praw-dev/praw) but will not do so until I can confidently give a `>=` request number to depend on.\n", "@bboe: I have issued a PR (#929) some days ago which would resolve this issue. Let's wait for @kennethreitz's approval (or not) of it :-)\n", "@bmcustodio I saw your pull request, however, you didn't address the comment by @sigmavirus24.\n\nAs a more general question, is it even possible to provide python-version specific source distributions? Your PR does not seem to handle that as the source distribution will either be created from python2 or from python3 but as far as I know, one cannot be provided for both.\n", "@bboe: Assuming the PR gets merged, `python setup.py sdist` would create exactly the same output under Python2 and Python3 as dependencies would get resolved at install time rather that at packaging time.\n\nRegarding your question, I don't think that's possible (or even desirable).\n", "@bmcustodio I see. I misunderstood the problem as a need for a variable installation dependency, but just realized that that is not actually a problem with source distributions.\n\nIf means anything, I support not having vendored dependencies, however, I'm sure @kennethreitz decided to do it that way for the exact reason that I'm hoping this issue get resolved. That is, to prevent installation issues of the package in question when its dependencies have installation issues. :-/ \n", "@kennethreitz: Ok, so (I think) I have a solution for this. I'll issue a PR in a minute...\n", "This issue is being discussed in #939 and #951, so we no longer need this issue. Closing for cleanliness, thankyou all for your contributions!\n" ]
https://api.github.com/repos/psf/requests/issues/915
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/915/labels{/name}
https://api.github.com/repos/psf/requests/issues/915/comments
https://api.github.com/repos/psf/requests/issues/915/events
https://github.com/psf/requests/issues/915
7,915,258
MDU6SXNzdWU3OTE1MjU4
915
oauthlib should not use random.getrandbits()
{ "avatar_url": "https://avatars.githubusercontent.com/u/444071?v=4", "events_url": "https://api.github.com/users/tiran/events{/privacy}", "followers_url": "https://api.github.com/users/tiran/followers", "following_url": "https://api.github.com/users/tiran/following{/other_user}", "gists_url": "https://api.github.com/users/tiran/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tiran", "id": 444071, "login": "tiran", "node_id": "MDQ6VXNlcjQ0NDA3MQ==", "organizations_url": "https://api.github.com/users/tiran/orgs", "received_events_url": "https://api.github.com/users/tiran/received_events", "repos_url": "https://api.github.com/users/tiran/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tiran/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tiran/subscriptions", "type": "User", "url": "https://api.github.com/users/tiran", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-27T23:46:23Z
2021-09-09T05:30:54Z
2012-11-16T23:07:37Z
CONTRIBUTOR
resolved
The function generate_nonce() of the module requests.packages.oauthlib.common uses random.getrandbits() to create the nounce. The global mersenne twister PRNG instance should not be used for the task. For example the instance isn't reseeded on fork() which results in a very high probability of collisions in a forking server environment. Python's tempfile module contains an implementation that avoid the issue. I suggest that you use os.urandom() for the job. It's available on all major platforms. The platform's CPRNG makes it inherently secure, too.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/915/reactions" }
https://api.github.com/repos/psf/requests/issues/915/timeline
null
completed
null
null
false
[ "Wrong project. You should open this on idan/oauthlib\n" ]
https://api.github.com/repos/psf/requests/issues/914
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/914/labels{/name}
https://api.github.com/repos/psf/requests/issues/914/comments
https://api.github.com/repos/psf/requests/issues/914/events
https://github.com/psf/requests/issues/914
7,914,660
MDU6SXNzdWU3OTE0NjYw
914
Tests missing in requests-0.14.2.tar.gz
{ "avatar_url": "https://avatars.githubusercontent.com/u/656294?v=4", "events_url": "https://api.github.com/users/Arfrever/events{/privacy}", "followers_url": "https://api.github.com/users/Arfrever/followers", "following_url": "https://api.github.com/users/Arfrever/following{/other_user}", "gists_url": "https://api.github.com/users/Arfrever/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Arfrever", "id": 656294, "login": "Arfrever", "node_id": "MDQ6VXNlcjY1NjI5NA==", "organizations_url": "https://api.github.com/users/Arfrever/orgs", "received_events_url": "https://api.github.com/users/Arfrever/received_events", "repos_url": "https://api.github.com/users/Arfrever/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Arfrever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Arfrever/subscriptions", "type": "User", "url": "https://api.github.com/users/Arfrever", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-27T22:19:28Z
2021-09-09T05:30:54Z
2012-11-16T23:11:53Z
NONE
resolved
`tests` directory is missing in requests-0.14.2.tar.gz (available on PyPI). It was present in requests-0.14.1.tar.gz.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/914/reactions" }
https://api.github.com/repos/psf/requests/issues/914/timeline
null
completed
null
null
false
[ "There are a few problems associated with the packaging of 0.14.2, as you can see [here](https://github.com/kennethreitz/requests/issues/916). These are being resolved as part of #939. For the moment I'm closing this, but if the next patch release of `requests` is still affected, please reopen this issue.\n" ]
https://api.github.com/repos/psf/requests/issues/913
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/913/labels{/name}
https://api.github.com/repos/psf/requests/issues/913/comments
https://api.github.com/repos/psf/requests/issues/913/events
https://github.com/psf/requests/pull/913
7,912,465
MDExOlB1bGxSZXF1ZXN0Mjc5NjkxMw==
913
Fix IRI encoding issue [updated]
{ "avatar_url": "https://avatars.githubusercontent.com/u/579693?v=4", "events_url": "https://api.github.com/users/rrjamie/events{/privacy}", "followers_url": "https://api.github.com/users/rrjamie/followers", "following_url": "https://api.github.com/users/rrjamie/following{/other_user}", "gists_url": "https://api.github.com/users/rrjamie/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rrjamie", "id": 579693, "login": "rrjamie", "node_id": "MDQ6VXNlcjU3OTY5Mw==", "organizations_url": "https://api.github.com/users/rrjamie/orgs", "received_events_url": "https://api.github.com/users/rrjamie/received_events", "repos_url": "https://api.github.com/users/rrjamie/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rrjamie/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rrjamie/subscriptions", "type": "User", "url": "https://api.github.com/users/rrjamie", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-27T16:58:18Z
2021-09-08T17:05:57Z
2012-11-23T10:05:53Z
NONE
resolved
We ran in to this issue where IRIs convert to URIs (through Django's iri_to_uri) would blow up in requests. The issues seems to be when IRIs are converted to URIs they are percent-quote encoded, and when requests processes it with IDNA, it blows up because the URL components exceed 64 characters (since now it's three characters per actual character at least). However, they are valid URLs because they may encode to fewer than 64 characters in IDNA. The solution is to reverse the percent-quote encoding, and then re-encode with IDNA. Update: Solved merge conflict
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/913/reactions" }
https://api.github.com/repos/psf/requests/issues/913/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/913.diff", "html_url": "https://github.com/psf/requests/pull/913", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/913.patch", "url": "https://api.github.com/repos/psf/requests/pulls/913" }
true
[ "Would the `encode_urls` configuration assist you here?\n", "@kennethreitz I don't see `encode_urls` anywhere.\n", "What `encode_urls` are you referring to? Is there a better around this?\n" ]
https://api.github.com/repos/psf/requests/issues/912
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/912/labels{/name}
https://api.github.com/repos/psf/requests/issues/912/comments
https://api.github.com/repos/psf/requests/issues/912/events
https://github.com/psf/requests/pull/912
7,911,271
MDExOlB1bGxSZXF1ZXN0Mjc5NjUwMQ==
912
Make sure that url has fragment removed when using a proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/357333?v=4", "events_url": "https://api.github.com/users/jhalcrow/events{/privacy}", "followers_url": "https://api.github.com/users/jhalcrow/followers", "following_url": "https://api.github.com/users/jhalcrow/following{/other_user}", "gists_url": "https://api.github.com/users/jhalcrow/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jhalcrow", "id": 357333, "login": "jhalcrow", "node_id": "MDQ6VXNlcjM1NzMzMw==", "organizations_url": "https://api.github.com/users/jhalcrow/orgs", "received_events_url": "https://api.github.com/users/jhalcrow/received_events", "repos_url": "https://api.github.com/users/jhalcrow/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jhalcrow/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jhalcrow/subscriptions", "type": "User", "url": "https://api.github.com/users/jhalcrow", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-27T14:03:56Z
2021-09-08T17:05:57Z
2012-10-27T15:01:17Z
CONTRIBUTOR
resolved
When making a request that uses a proxy Request.path_url falls back to Request.full_url. However Request.full_url does not strip the fragment from the url, which is improper and will cause some HTTP servers to respond with a 400 error. This patch modifies Request.path_url to pass full_url through urlparse.urldefrag before returning it when a proxy is being used. It also plumbs urldefrag through the compat module so that I can use it here. The alternative would be to modify full_url to defrag, but it seems to be used in setting the url for the Response object so I figured it would be better done in here.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/912/reactions" }
https://api.github.com/repos/psf/requests/issues/912/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/912.diff", "html_url": "https://github.com/psf/requests/pull/912", "merged_at": "2012-10-27T15:01:17Z", "patch_url": "https://github.com/psf/requests/pull/912.patch", "url": "https://api.github.com/repos/psf/requests/pulls/912" }
true
[ "Looks good, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/911
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/911/labels{/name}
https://api.github.com/repos/psf/requests/issues/911/comments
https://api.github.com/repos/psf/requests/issues/911/events
https://github.com/psf/requests/pull/911
7,905,003
MDExOlB1bGxSZXF1ZXN0Mjc5MzkwNw==
911
Fix IRI encoding issue
{ "avatar_url": "https://avatars.githubusercontent.com/u/579693?v=4", "events_url": "https://api.github.com/users/rrjamie/events{/privacy}", "followers_url": "https://api.github.com/users/rrjamie/followers", "following_url": "https://api.github.com/users/rrjamie/following{/other_user}", "gists_url": "https://api.github.com/users/rrjamie/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rrjamie", "id": 579693, "login": "rrjamie", "node_id": "MDQ6VXNlcjU3OTY5Mw==", "organizations_url": "https://api.github.com/users/rrjamie/orgs", "received_events_url": "https://api.github.com/users/rrjamie/received_events", "repos_url": "https://api.github.com/users/rrjamie/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rrjamie/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rrjamie/subscriptions", "type": "User", "url": "https://api.github.com/users/rrjamie", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-10-26T22:12:18Z
2021-09-08T17:05:56Z
2012-10-27T15:01:58Z
NONE
resolved
We ran in to this issue where IRIs convert to URIs (through Django's `iri_to_uri`) would blow up in requests. The issues seems to be when IRIs are converted to URIs they are percent-quote encoded, and when requests processes it with IDNA, it blows up because the URL components exceed 64 characters (since now it's three characters per actual character at least). However, they are valid URLs because they may encode to fewer than 64 characters in IDNA. The solution is to reverse the percent-quote encoding, and then re-encode with IDNA.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/911/reactions" }
https://api.github.com/repos/psf/requests/issues/911/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/911.diff", "html_url": "https://github.com/psf/requests/pull/911", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/911.patch", "url": "https://api.github.com/repos/psf/requests/pulls/911" }
true
[ "(Rebased)\n", "Can you send another pull request? Merge conflict.\n" ]
https://api.github.com/repos/psf/requests/issues/910
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/910/labels{/name}
https://api.github.com/repos/psf/requests/issues/910/comments
https://api.github.com/repos/psf/requests/issues/910/events
https://github.com/psf/requests/issues/910
7,868,747
MDU6SXNzdWU3ODY4NzQ3
910
POST with json data and oauth auth_header signature_type not working
{ "avatar_url": "https://avatars.githubusercontent.com/u/677604?v=4", "events_url": "https://api.github.com/users/alex-ethier/events{/privacy}", "followers_url": "https://api.github.com/users/alex-ethier/followers", "following_url": "https://api.github.com/users/alex-ethier/following{/other_user}", "gists_url": "https://api.github.com/users/alex-ethier/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alex-ethier", "id": 677604, "login": "alex-ethier", "node_id": "MDQ6VXNlcjY3NzYwNA==", "organizations_url": "https://api.github.com/users/alex-ethier/orgs", "received_events_url": "https://api.github.com/users/alex-ethier/received_events", "repos_url": "https://api.github.com/users/alex-ethier/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alex-ethier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alex-ethier/subscriptions", "type": "User", "url": "https://api.github.com/users/alex-ethier", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
32
2012-10-25T17:29:41Z
2021-09-09T04:00:40Z
2013-04-01T18:40:16Z
NONE
resolved
The following code does not generate an Authorization header. ``` python import requests from requests.auth import OAuth1 import json client_key = u'mykey' client_secret = u'mysecret' headeroauth = OAuth1( client_key, client_secret, None, None, signature_type='auth_header' ) payload = { "type": "command_line", "params": { "command": "sleep 0" } } url = u'http://localhost:8003/test' data = json.dumps(payload, sort_keys=True, indent=4) r = requests.post(url, auth=headeroauth, data=data ) ``` If I replace ``` python data=data ``` by ``` python data={'data':'payload'} ``` I get and Authorization header but that's not what I need... Am I missing anything? This seem to be broken.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/910/reactions" }
https://api.github.com/repos/psf/requests/issues/910/timeline
null
completed
null
null
false
[ "Nowhere in requests does `data` mean `json data` (at least from reading the code). If it's in the documentation then that needs to be corrected, but there is no section I know of where what you expect is promised.\n\nGranted, I would support a separate parameter `json` that would guarantee encoding of the data as json data, but that is likely outside of the scope of requests.\n", "Correct.\n\nSent from my iPhone\n\nOn Oct 25, 2012, at 1:07 PM, Ian Cordasco [email protected] wrote:\n\n> Nowhere in requests does data mean json data (at least from reading the code). If it's in the documentation then that needs to be corrected, but there is no section I know of where what you expect is promised.\n> \n> Granted, I would support a separate parameter json that would guarantee encoding of the data as json data, but that is likely outside of the scope of requests.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n", "from the doc http://docs.python-requests.org/en/latest/user/quickstart/#more-complicated-post-requests\n\n```\nimport json\nurl = 'https://api.github.com/some/endpoint'\npayload = {'some': 'data'}\n\n r = requests.post(url, data=json.dumps(payload))\n```\n\nand http://docs.python-requests.org/en/latest/user/quickstart/#custom-headers it sounds like I should be able to pass json data, right?\n\neven if I specify the content type it still doesn't produce an Authorization header.\n\n```\nheaders = {'content-type': 'application/json'}\nr = requests.post(url, auth=headeroauth, data={'data':'payload'}, headers=headers)\n```\n\nSorry I'm not sure I understand clearly what you mean. Are you saying that I can't post json data?\nor that my request code is incorrect?\n\nThis is the actual code: https://gist.github.com/3955898\n\nThanks.\n", "@alex-ethier you have to also look at the response provided from `'http://httpbin.org/post'` It interprets that as form data. From the same code block you referenced:\n\n``` python\n>>> print r.text\n{\n // ...snip... //\n \"form\": {\n \"key2\": \"value2\",\n \"key1\": \"value1\"\n },\n // ...snip... //\n}\n```\n\nTry it yourself with HTTPbin. You'll be able to see how the server interprets it yourself.\n\nAnd I agree that the docs may seem to be misleading in this sense, but they do say:\n\n> Typically, you want to send some form-encoded data — much like an HTML form. To do this, simply pass a dictionary to the data argument. Your dictionary of data will automatically be form-encoded when the request is made\n\nAlso right below the code block you reference, there's this:\n\n> There are many times that you want to send data that is not form-encoded. If you pass in a string instead of a dict, that data will be posted directly.\n\nAnd the example directly beneath it is for the GitHub API (which I have [experience](/sigmavirus24/github3.py) with) which accepts JSON requests.\n\n---\n\nAnd please delete your gist entirely. You have the client_{key,secret} there and that's a terrible idea.\n", "@sigmavirus24 Thank you for your prompt reply.\n\nI'm realizing that I wasn't clear enough about what I'm trying to accomplish. Sorry about that.\n\nWe are a PaaS provider. I'm writing a client for the public api of our service. ( I left the api key and secret in the gist since they are from a dev server running on my laptop. ) \n\nOne of the call I have to make is a POST to http://localhost:8003/jobs. This call requires a job parameters JSON data in the request body such as:\n\n``` python\n{\n \"opType\": \"command_line\",\n \"params\": {\n \"command\": \"sleep 0\",\n \"callback\": \"localhost:8010\",\n \"name\": \"myJob\"\n }\n}\n```\n\nand also requires a signed oauth header. Our api implement 2-legged oauth with header signature type.\n\nI tried bunch of different variations:\n\n---\n\nif I pass a simple dictionary structure as data such as:\n\n``` python\npayload = {'some': 'data'}\n...\nr = requests.post(url, auth=headeroauth, data=payload)\n```\n\nrequests generate the following request:\n\n``` python\n{'Content-Length': '9', 'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/0.14.1 CPython/2.7.1 Darwin/11.4.2', 'Host': 'localhost:8003', 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'OAuth oauth_nonce=\"114662130218029821421351270615\", oauth_timestamp=\"1351270615\", oauth_version=\"1.0\", oauth_signature_method=\"HMAC-SHA1\", oauth_consumer_key=\"9fac88f8645bdfbd6f8a68f60c5130d082244a8a8787674e82e85f68ff3716b8\", oauth_signature=\"UNOYsMproYbF9t3mOrqkANRo%2Bqk%3D\"'}\nsome=data\n```\n\nIt includes an Authorization header, set the Content-Type to application/x-www-form-urlencoded and some data in the body as I would expect.\n\n---\n\nif I replace the simple dictionary structure above with something more complex, such as:\n\n``` python\npayload = {\n \"opType\": \"command_line\",\n \"params\": {\n \"command\": \"sleep 0\",\n \"callback\": \"localhost:8010\",\n \"name\": \"myJob\"\n }\n}\n...\nr = requests.post(url, auth=headeroauth, data=payload)\n```\n\nrequests generates a traceback:\n\n```\n File \"/Users/alex/.local/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849/utils.py\", line 52, in escape\n raise ValueError('Only unicode objects are escapable.')\nValueError: Only unicode objects are escapable.\n```\n\n---\n\nif i pass JSON encoded string as data such as: \n\n``` python\npayload = {\n \"opType\": \"command_line\",\n \"params\": {\n \"command\": \"sleep 0\",\n \"callback\": \"localhost:8010\",\n \"name\": \"myJob\"\n }\n}\npayload = json.dumps(payload)\n...\nr = requests.post(url, auth=headeroauth, data=payload)\n```\n\nrequests generate the following request:\n\n``` python\n{'Host': 'localhost:8003', 'User-Agent': 'python-requests/0.14.1 CPython/2.7.1 Darwin/11.4.2', 'Content-Length': '107', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate, compress'}\n{\"opType\": \"command_line\", \"params\": {\"callback\": \"localhost:8010\", \"command\": \"sleep 0\", \"name\": \"myJob\"}}\n```\n\nIt contains the JSON data as string but no Authorization header and not content-type\n\n---\n\nif i pass JSON encoded string as data and specify the content type such as: \n\n``` python\npayload = {\n \"opType\": \"command_line\",\n \"params\": {\n \"command\": \"sleep 0\",\n \"callback\": \"localhost:8010\",\n \"name\": \"myJob\"\n }\n}\npayload = json.dumps(payload)\nheaders = {'content-type': 'application/json'}\n...\nr = requests.post(url, auth=headeroauth, data=payload, headers=headers)\n```\n\nrequests generate the following request:\n\n``` python\n{'Content-Length': '127', 'Accept-Encoding': 'gzip, deflate, compress', 'Accept': '*/*', 'User-Agent': 'python-requests/0.14.1 CPython/2.7.1 Darwin/11.4.2', 'Host': 'localhost:8003', 'Content-Type': 'application/json'}\n\"{\\\"opType\\\": \\\"command_line\\\", \\\"params\\\": {\\\"callback\\\": \\\"localhost:8010\\\", \\\"command\\\": \\\"sleep 0\\\", \\\"name\\\": \\\"myJob\\\"}}\"\n```\n\nIt contains JSON data, Content-Type but no Authorization header\n\n---\n\nSo basically the client I'm writing has to be able to send json data and must contain an Authorization header.\nIs this possible using the requests module? \n\nI have successfully built a ruby client that does what I need. I like working with requests and really want to figure this out so I can do the same with requests.\n\nThank you for your time\n", "Yeah, either the docs are wrong (which I just followed) or you and I are doing the same thing wrong. I made a mini flask app to print out the information I thought might be relevant using the following:\n\n``` python\nfrom flask import Flask, request, jsonify\n\napp = Flask(__name__)\n\n\[email protected]('/', methods=['POST'])\ndef index():\n resp = {\n 'Headers': dict(request.headers),\n 'Authorization': request.authorization,\n 'Content-Type': request.content_type,\n 'Data': request.data,\n 'Form': request.form,\n 'Files': request.files,\n }\n return jsonify(**resp)\n\n\nif __name__ == '__main__':\n app.run()\n```\n\nAnd tested it from the interactive interpreter:\n\n``` python\nfrom requests import session\nfrom requests.auth import OAuth1\nfrom json import dumps\n\n\ns = session()\ns.auth = OAuth1('key', 'secret', None, None, 'auth_header')\nlocal = 'http://127.0.0.1:5000/'\nsimple = {'some': 'data'}\ncomplex = {'outer': 'layer', 'inner': simple}\n\nr = s.post(local, data=simple)\n# <Response [200]>\nr.json\n# Returns the response from the flask app with the relevant info being:\n# u'Headers': {u'Content-Length': u'48', u'Accept-Encoding': u'identity, deflate, compress, gzip', u'Accept': u'*/*', u'User-Agent': u'python-requests/0.14.1 CPython/2.6.2 Linux/2.6.30.3', u'Host': u'127.0.0.1:5000', u'Content-Type': u''}\nr = s.post(local, data=complex)\n# Same headers\nr = s.post(local, data=dumps(simple))\nr = s.post(local, data=dumps(complex))\n```\n\nNone of them had any kind of Authorization headers. Also, the `authorization` part of the request in Flask was consistently empty.\n", "Thank you @sigmavirus24.\n\n@kennethreitz, Any thoughts on this? \n\nThanks!\nA\n", "I'm working with Alex on this and made a fix that seems to be working for our purposes. As far as I can tell it's not possible to get requests to generate an OAuth header if content-type is \"application/json\" without something like this fix.\n\nin\n\n``` python\nclass OAuth1(AuthBase):\n```\n\nI added a definition for CONTENT_TYPE_JSON, and changed from this:\n\n``` python\n _oauth_signed = True\n if r.files and contenttype == CONTENT_TYPE_MULTI_PART:\n # Omit body data in the signing and since it will always\n # be empty (cant add paras to body if multipart) and we wish\n # to preserve body.\n r.url, r.headers, _ = self.client.sign(\n unicode(r.full_url), unicode(r.method), None, r.headers)\n elif decoded_body is not None and contenttype in (CONTENT_TYPE_FORM_URLENCODED, ''):\n # Normal signing\n if not contenttype:\n r.headers['Content-Type'] = CONTENT_TYPE_FORM_URLENCODED\n r.url, r.headers, r.data = self.client.sign(\n unicode(r.full_url), unicode(r.method), r.data, r.headers)\n else:\n _oauth_signed = False\n```\n\nto this:\n\n``` python\n _oauth_signed = True\n if r.files and contenttype == CONTENT_TYPE_MULTI_PART:\n # Omit body data in the signing and since it will always\n # be empty (cant add paras to body if multipart) and we wish\n # to preserve body.\n r.url, r.headers, _ = self.client.sign(\n unicode(r.full_url), unicode(r.method), None, r.headers)\n elif decoded_body is not None and contenttype in (CONTENT_TYPE_FORM_URLENCODED, ''):\n # Normal signing\n if not contenttype:\n r.headers['Content-Type'] = CONTENT_TYPE_FORM_URLENCODED\n r.url, r.headers, r.data = self.client.sign(\n unicode(r.full_url), unicode(r.method), r.data, r.headers)\n elif contenttype == CONTENT_TYPE_JSON:\n r.url, r.headers, r.data = self.client.sign(\n unicode(r.full_url), unicode(r.method), r.data, r.headers) \n else:\n _oauth_signed = False\n```\n\nPrettier: https://github.com/tower3/requests/commit/d6817551d0122cef6c86d5f5ca17ef9d475ce62e\n\nIt feels like a hack to special-case JSON, so I haven't made a pull request.\n", "If you're making changes to oauthlib you have to contribute those to idan/oauthlib\n", "You have to forgive me if I get stuff wrong. I took 20 years off from writing software and just started back up a few months ago.\n\nHowever, the change I made is in auth.py, which I'm pretty sure is part of requests.\n", "Ah, no worries. I was reading that from the OctoDroid app. I wasn't sure where it was from, I was just making sure you were aware. And you got nothing wrong. Sorry if I came off confrontational or angry. That certainly wasn't my intent. Thanks for digging into the issue!\n", "I seem to remember this having come up before, though I can't find a good example of this issue.\n\n@idan, you're way more familiar with OAuth than me. Is the principle supposed to be that OAuth doesn't include the body for signing purposes, or is it just specifically not supposed to sign the body for `multipart/form-data`?\n", "Per the [spec (3.4.1.3.1)](http://tools.ietf.org/html/rfc5849#section-3.4.1.3.1), OAuth1 only signs parameters from the request body if it is single-part, encoded according to `x-www-form-urlencoded`, and has the according `Content-Type` header set. If any of these three requirements are not met, the request body is ignored for the purposes of generating a signature, as per the spec.\n", "If this isn't clear, it means that file uploads are never signed according to the OAuth1 spec.\n", "Awesome. So, my understanding of this situation is that JSON data, while encoded correctly, does not have the correct Content-Type header, so we should not be including it in the signing. Correct?\n", "The _only_ kind of data from the POST body which should be included in the signature base string (and thus signed) is form-urlencoded data, and even then only if the correct Content-Type header is set. JSON data is obviously not form-urlencoded, and specifying the Content-Type will not magically make it so. :)\n\nSo yes, JSON data should be (correctly) ignored for the purposes of signing. Put another way, if you include two requests that are otherwise identical but one of which contains JSON body data, the signature should not vary.\n", "Thankyou @idan! I think this means we've got a bug in the OAuth code here. I'll fix it up. Do you mind if I notify you when I've done it so you can take a quick look?\n", "Go for it. Open a ticket on idan/oauthlib :) \n\nOn Saturday, November 24, 2012 at 10:30 PM, Cory Benfield wrote:\n\n> Thankyou @idan (https://github.com/idan)! I think this means we've got a bug in the OAuth code here. I'll fix it up. Do you mind if I notify you when I've done it so you can take a quick look?\n> \n> —\n> Reply to this email directly or view it on GitHub (https://github.com/kennethreitz/requests/issues/910#issuecomment-10683343). \n", "Oh, no, OAuthlib is fine, it's the logic in Requests that's wrong. =)\n", "Any updates on this? I think there were some changes to requests/requests-oauth recently that were important for 0.3. @frankslaughter and @alex-ethier any updates on this? \n", "I think I've just stumbled upon this with PUT requests to the ProjectPlace API. That API expects the the auth to exclude the body. I was tempted to have a local copy and re-order the prepare function in models.py so that prepare_auth is done before prepare_body. Unfortuantely, ignorance of how packaging works (\"ValueError: Attempted relative import in non-package), is currently preventing me from trying this…\n\n``` python\ndef prepare(self):\n \"\"\"Constructs a :class:`PreparedRequest <PreparedRequest>` for transmission and returns it.\"\"\"\n p = PreparedRequest()\n\n p.prepare_method(self.method)\n p.prepare_url(self.url, self.params)\n p.prepare_headers(self.headers)\n p.prepare_cookies(self.cookies)\n # Note that prepare_auth must be last to enable authentication schemes\n # such as OAuth to work on a fully prepared request.\n p.prepare_auth(self.auth)\n\n p.prepare_body(self.data, self.files)\n\n return p\n```\n", "@idan @Lukasa any opinions?\n", "Having conquered my package ignorance - I was thinking too much - I've tried this change to the prepare function, and I'm able to successfully PUT to Project Place. I know that this may not be appropriate for all uses, I don't really understand the protocol.\n\nNote that the donkey work was done by Jon Nylander of ProjectPlace, who kindly sent me a sample script that prepares and signs the headers separately, before using requests to add the body and send (https://gist.github.com/pellepim/74fe738317e1789ccc38). I had the same problem with python-oauth2 and refactored to use requests in the hope that it would solve my problem. It was only by seeing Jon's working version that I could could figure out why requests wasn't working for me.\n", "@daycoder: Goddamn I hate OAuth. Ok, so, `requests-oauthlib` _should_ correctly handle whether or not to include the body data in signing. What kind of data are you sending?\n", "@Lukasa You don't know how happy you've made me by saying \"Goddam I hate OAuth\" :D\n\nhttp://api.projectplace.com/index.php/DocumentUpload is the one that was giving me problems. The body content is just the contents of a file.\n\n```\nresponse = requests.get(…, data=open('A Test Report.xlsx','rb'))\n```\n\n(This works with my local copy `prepare` bodge).\n", "Can you print the content of `response.request.headers` on one of these failed lookups please?\n\n(I wrote a blog post entitled \"OAuth Needs To Die In A Fire\", so I have form when it comes to hating OAuth. =D )\n", "This is what I'd posted to Jon at ProjectPlace earlier this week. Is that what you're after. Happy to reproduce and capture more info if it helps.\n\n```\nurl: u'https://api.projectplace.com/1/document/864880393/upload.json'\n\nheaders: {u'Accept': u'*/*',\nu'Accept-Encoding': u'gzip, deflate, compress',\n'Authorization': 'OAuth oauth_nonce=\"47969000444228248131361304547\",\noauth_timestamp=\"1361304547\",\noauth_version=\"1.0\",\noauth_signature_method=\"HMAC-SHA1\",\noauth_consumer_key=\"dbeb09bfe9a88bfcc1fbf92ffffffff\",\noauth_token=\"44a2beb972ca1598632c3081ffffffff\", \noauth_signature=\"tyzsjgreGxrml9VhV0GIaQu8ffffffff\"',\nu'Content-Length': u'28',\nu'Content-Type': u'application/x-www-form-urlencoded',\nu'User-Agent': u'python-requests/1.1.0 CPython/2.7.2 Darwin/12.2.0'}\n\nbody:u'{\"body\": \"contents of file\"}'\n```\n", "So, my concern is the `Content-Type` header. If you have `x-www-form-urlencoded` data, you are _supposed_ to include the data in the OAuth signature. If you use the 'data' header with a file, it _shouldn't_ set the data type to `x-www-form-urlencoded`, but it appears to be.\n\nHumour a hunch of mine: can you run `oauthlib.common.extract_params()` on the file object and tell me what it returns?\n", "oauthlib.common.extract_params(file('test.txt','rb'))\nNone\n\nalso, just to confirm I'm getting something back…\n\noauthlib.common.extract_params(u'File contents')\n[(u'File contents', u'')]\n\noauthlib.common.extract_params({u'a':u'dictionary'})\n[(u'a', u'dictionary')]\n", "Right, so I bet my left arm that the issue is [L47 of requests-oauthlib.core](https://github.com/requests/requests-oauthlib/blob/master/requests_oauthlib/core.py#L47). I don't think we can use `extract_params()` as a good test of form-urlencoding.\n" ]
https://api.github.com/repos/psf/requests/issues/909
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/909/labels{/name}
https://api.github.com/repos/psf/requests/issues/909/comments
https://api.github.com/repos/psf/requests/issues/909/events
https://github.com/psf/requests/pull/909
7,865,504
MDExOlB1bGxSZXF1ZXN0Mjc3NDA5MQ==
909
Use a JSON-specific encoding detection when no encoding has been specified
{ "avatar_url": "https://avatars.githubusercontent.com/u/46775?v=4", "events_url": "https://api.github.com/users/mjpieters/events{/privacy}", "followers_url": "https://api.github.com/users/mjpieters/followers", "following_url": "https://api.github.com/users/mjpieters/following{/other_user}", "gists_url": "https://api.github.com/users/mjpieters/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mjpieters", "id": 46775, "login": "mjpieters", "node_id": "MDQ6VXNlcjQ2Nzc1", "organizations_url": "https://api.github.com/users/mjpieters/orgs", "received_events_url": "https://api.github.com/users/mjpieters/received_events", "repos_url": "https://api.github.com/users/mjpieters/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mjpieters/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mjpieters/subscriptions", "type": "User", "url": "https://api.github.com/users/mjpieters", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-10-25T15:47:38Z
2021-09-08T23:06:01Z
2012-10-27T15:02:55Z
CONTRIBUTOR
resolved
Here's a proposed fix for issue #765. When requesting JSON data for a response with no encoding specified, detect the encoding from `self.content` using a custom UTF encoding detector that uses knowledge about JSON to make an educated guess as to the encoding used. If no encoding could be determined, decoding fails, or the JSON decoding fails, fall back to `self.text` and `chardet` guessing. Tests included, tested on python 2.6, 2.7, 3.1, 3.2, 3.3. All code PEP-8 and pyflakes clean.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/909/reactions" }
https://api.github.com/repos/psf/requests/issues/909/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/909.diff", "html_url": "https://github.com/psf/requests/pull/909", "merged_at": "2012-10-27T15:02:55Z", "patch_url": "https://github.com/psf/requests/pull/909.patch", "url": "https://api.github.com/repos/psf/requests/pulls/909" }
true
[ "To clarify: if the body is RFC-compliant JSON, determining the UTF encoding is fully deterministic, no guessing required.\n\nIf the body is _not_ RFC compliant, then this method is no worse than the current 'guess-the-characterset' method used. If we cannot find evidence of any of the UTF encodings (no BOM, wrong null count, or the nulls in the wrong places) then it falls back to the old method. If we do decide upon a UTF encoding and the decoding _fails_, then we _also_ fall back to the old method.\n\nSince UTF-8 is pretty much a fail-safe decoding option (thanks to the strict limits built into the multi-byte codepoint system), and the chances that you find a UTF BOM _or_ nulls in the same places for any other non-UTF encoding imaginable, the determination should not interfere with any edge cases that somehow manage to work today.\n\nSuch edge cases only include JSON encoded in a non-RFC compliant encoding, where that encoding is not specified in the Content-Type header. The encoding used should then fool the UTF detection, the actual UTF decoding, _and_ the JSON decoding before resulting in a change of behaviour. I cannot imagine what such data would look like, nor how `chardet` would do a better job in that case.\n", "Perfect timing, I added a UTF-8 only implementation of this a few days ago in the \"adapters\" branch.\n", "Hmm, my approach was to simply add this logic into the `get_encoding_from_headers` function. \n\nUgly commit, but here was the basic idea: https://github.com/kennethreitz/requests/commit/2e7af6d6156125153855675268c3cf8cee7ab447#L2R364\n\nI think it would be better to move your detection logic to that function and have requests use the normal \"encoding\" logic. \n\nThoughts?\n", "My reasoning for putting this in the `.json` property: clearly the caller is expecting the body to be JSON, so whatever the content type might have been, perhaps we should be a little more lenient and flexible.\n\nSo, I prefer the test to be made when the `.json` property is used, just like the encoding is only guessed when the `.text` property is being used.\n", "Someone else found the `charset` issue on JSON ambiguous enough to [ask a Stack Overflow question](http://stackoverflow.com/q/13096259/100297) to ask for clarification. Defaulting to `UTF-8` looks more and more like an incorrect assumption.\n", "I was wondering why I hadn't run into this with github3.py and then I realized that in my request headers I specify UTF-8 only and GitHub honors that. I suppose if I hadn't, I and others already would have run into this.\n", "I'd much rather see this happen based purely on the headers, but I'll merge this since it requires access to the body to work :)\n" ]
https://api.github.com/repos/psf/requests/issues/908
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/908/labels{/name}
https://api.github.com/repos/psf/requests/issues/908/comments
https://api.github.com/repos/psf/requests/issues/908/events
https://github.com/psf/requests/issues/908
7,828,625
MDU6SXNzdWU3ODI4NjI1
908
FR: Include round trip time as a response attribute
{ "avatar_url": "https://avatars.githubusercontent.com/u/1552962?v=4", "events_url": "https://api.github.com/users/bmannix/events{/privacy}", "followers_url": "https://api.github.com/users/bmannix/followers", "following_url": "https://api.github.com/users/bmannix/following{/other_user}", "gists_url": "https://api.github.com/users/bmannix/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bmannix", "id": 1552962, "login": "bmannix", "node_id": "MDQ6VXNlcjE1NTI5NjI=", "organizations_url": "https://api.github.com/users/bmannix/orgs", "received_events_url": "https://api.github.com/users/bmannix/received_events", "repos_url": "https://api.github.com/users/bmannix/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bmannix/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bmannix/subscriptions", "type": "User", "url": "https://api.github.com/users/bmannix", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-10-24T14:18:39Z
2021-09-09T05:30:59Z
2012-10-24T14:32:34Z
NONE
resolved
This is a feature request. It would be very useful if the requests package included a round trip time attribute on responses received. pyCurl includes this functionality via pycurl.TOTAL_TIME. This can be worked around currently with something like this: ``` python gc.disable() start = time.time() request = requests.get('https://github.com/timeline.json') total = time.time() - start gc.enable() request.total_time = total ``` However, it would be nice to have this attribute generally available. I am not sure if the garbage collection disable/enable is really necessary or not.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/908/reactions" }
https://api.github.com/repos/psf/requests/issues/908/timeline
null
completed
null
null
false
[ "This has been considered in the past, but I've turned it down because it's simply out of scope.\n\nIt's quite simple to do this yourself with hooks, however.\n", "@bmannix\nSee issue #361.\n\n@kennethreitz\nHow about contrib module?\n", "No, but thank you for the suggestion.\n\nSent from my iPhone\n\nOn Oct 24, 2012, at 1:26 PM, Piotr Dobrogost [email protected] wrote:\n\n> How about contrib module?\n> \n> —\n> Reply to this email directly or view it on GitHub.\n", "Yup. Hooks look like a very good solution for this problem. The more I learn about requests, the more I like it. Thanks for your work!\n", "They are good as long as you don't want to have specific [timings](http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html) which curl provides. These need to be measured at the socket level at which requests do not operate directly.\n" ]
https://api.github.com/repos/psf/requests/issues/907
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/907/labels{/name}
https://api.github.com/repos/psf/requests/issues/907/comments
https://api.github.com/repos/psf/requests/issues/907/events
https://github.com/psf/requests/pull/907
7,788,648
MDExOlB1bGxSZXF1ZXN0MjczNzgwOA==
907
expunge PYTHONDONTWRITEBYTECODE
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[]
closed
true
null
[]
null
34
2012-10-23T06:23:34Z
2021-09-08T23:07:13Z
2012-10-23T14:26:09Z
CONTRIBUTOR
resolved
See #889 for motivation. My understanding is that this was added in order to fix tests, which were trying to POST `__file__` and failing on the second run, once `__file__` began to refer to a .pyc instead of a .py? It looks like postbin/httpbin no longer choke on .pyc files, so we should be able to omit this. cc @sigmavirus24
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/907/reactions" }
https://api.github.com/repos/psf/requests/issues/907/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/907.diff", "html_url": "https://github.com/psf/requests/pull/907", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/907.patch", "url": "https://api.github.com/repos/psf/requests/pulls/907" }
true
[ "Ah, bad time, the `develop` build is red. Although, I do have a unique error message for this pull request:\n\n```\nExecuting your 3 (export TRAVIS_PYTHON_VERSION=2.6) took longer than 0 minutes and was terminated.\n```\n", "`longer than 0 minutes` sounds almost like eternity...\n", "This wasn't exactly my decision/idea but yeah, I don't think the problem was solely with HTTPbin. I don't remember exactly since it was happening in July/early August, but I was seeing it with Amazon S3 if I remember correctly (I was using it via the GitHub Downloads API). But my memory is too hazy to be 100% certain. _shrug_ It's @kennethreitz's call anyway. I'm swamped with other stuff at the moment (I'm not even working on my own projects).\n", "That has nothing to do with it — this prevents syntax errors upon installation for python 2.\n", "Sorry, could you clarify? Using the branch from this pull request, I can successfully build and install on my 2.7 and 3.2 systems.\n", "bytecode compilation causes warnings at install time.\n", "But `PYTHONDONTWRITEBYTECODE` is about writing already compiled bytecode to disk not about switching compilation on or off, isn't it?\n", "At install time, setuptools goes out of its way to byte-compile code unnecessarily. It skips this if that env var is set.\n\nUgly, I know. but currently necessary.\n", "The line your have to use to adhere to the Arch Linux [Python Package Guidelines](https://wiki.archlinux.org/index.php/Python_Package_Guidelines):\n\n``` bash\npython2 setup.py install --root=\"$pkgdir\" --optimize=1\n```\n\nThe output from this line in the build script:\n\n``` bash\nbyte-compiling /home/etherealite/projects/requests.1.14.2/pkg/usr/lib/python2.7/site-packages/requests/safe_mode.py to safe_mode.pyc\nwriting byte-compilation script '/tmp/tmpfrjizz.py'\n/usr/bin/python2 -O /tmp/tmpfrjizz.py\nTraceback (most recent call last):\n File \"/tmp/tmpfrjizz.py\", line 122, in <module>\n direct=1)\n File \"/usr/lib/python2.7/distutils/util.py\", line 458, in byte_compile\n raise DistutilsByteCompileError('byte-compiling is disabled.')\ndistutils.errors.DistutilsByteCompileError: byte-compiling is disabled.\nerror: command '/usr/bin/python2' failed with exit status 1\n```\n\nI would rather my package manager is able be able to clean up the byte code generated by the library, rather than to have have setup.py run a few seconds faster.\n", "that is not why this was added.\n", "It's not about running faster if I remember correctly\n", "I\"m assuming this is the reason:\n\n> bytecode compilation causes warnings at install time.\n\nIf that's the case, cant you put in some checks so that it only gets invoked where in the environments where it causes problems. I don't get any warnings when installing it without `PYTHONDONTWRITEBYTECODE` flag.\n", "@etherealite do you realize how many different kinds of environments exist right? Do you realize the amount of work:;\n\nA) to find all of them\nB) to support all of them\nC) to track all of them\n\nOn top of that, why are you bothering with Arch's package repository and not using pip? In fact, why does anyone bother with that?\n", "Both the `README` and the docs are very clear on this front: Requests expects to be installed with `pip` and `easy_install`. I strongly, strongly, _strongly_ encourage you not to use or create a Pacman package of Requests. Such a package would not be being maintained by the project and so would at best be out of sync with Requests, and at worst be totally out of date.\n", "@Lukasa ironic you say that given how many people's Arch installs get fubarred because of the rolling release model that has notoriously had all sorts of problems.\n", "I wouldn't advise anyone not to build native system package out of Python package if he wants to do that. If there's problem doing that it means something is wrong with the Python package (assuming other packages don't have the same problems which points to problem with Python package format or similar issues).\n", "@piotr-dobrogost in this case there seems to be one HUGE issue with Arch's python package requirement: **they only support python3** Look at the command they **require** you to use for an Arch package, it explicitly requires python2. What if you want to install under python3? Also, when would a system package every be preferable to using pip, especially across multiple versions?\n- System packages cannot be used under virtualenvs so they're useless there.\n- Arch seems to only support python 2, so much for all the work that goes into compatibility towards python 3\n- Package maintainers occasionally make their own changes without reporting them upstream\n - this begs the question, why should we support a decision we didn't make?\n- Package maintainers are occasionally required to use options, e.g., `--optimize=1`, that put the pressure on us to revert explicit design decisions\n - Following arbitrary guidelines will only lead to insanity, tracking them to further insanity.\n - Why follow arbitrarily decided guidelines when we have a package manager that works perfectly for us?\n", "Let's put this another way.\n\nIf you want to package Requests for anything other than `pip` or `easy_install`, you're essentially forking it. Great, that's brilliant, best of luck to you! However, that means that anything we do here that breaks your fork is totally your problem, not ours.\n\nIn this case, the fix is quite literally one line in the downstream version. You won't even have merge conflicts when you pull in new changes. =D\n", "@Lukasa that's a much better explanation than I wrote. +1 good sir\n", "Personally I am sympathetic towards the creation of \"native\" packages for Requests. On my own machines, I use the Fedora distribution's RPMs of Requests (courtesy of @sagarun), not pip or easy_install.\n\nHowever:\n1. An unavoidable aspect of packaging is maintaining a (hopefully small) set of downstream patches\n2. Requests does not have an obligation to interoperate perfectly with every packaging system; if Requests has become _unusually_ difficult to package (and the issue here doesn't seem to qualify), then we can work with the packagers to improve it\n", "I agree with @slingamn and have a feeling the whole discussion here went in the wrong direction. It's not task of any Python library to set variables such as `PYTHONDONTWRITEBYTECODE` similar to how it's not its task to configure logging. Both are tasks of users of the library. Conclusion, `PYTHONDONTWRITEBYTECODE` should have never been manipulated by Requests. This pull removes manipulation so it fixes the problem. We should merge this and close this issue as fixed.\n", "It was added for a reason. As soon as we get a valid version of chardet that works on both versions of python, this problem will go away. \n\nStop talking about it.\n", "And guess who's working on that over at sigmavirus24/charade :P\n", "@sigmavirus24: I :heart: you\n", "Oh we're vendorizing this, right? I need to change a few things with the imports.\n", "That's the plan. Easy to workaround though.\n", "It isn't a lot of work to change, I just forgot that it would be vendorized.\n", "@sigmavirus24 how close is it to being in a usable state?\n", "Hopefully ~1 week. I haven't changed anything that would change the code, I'm \njust doing the 2to3 work and making it so that flake8 won't kill vim whenever \nI open a file (when possible). Also there's not a single test for this, so \nhaving an easy guide as to it working in python3 won't help.\n\nI'm going to reference that guide from Dive into Python3 though to make sure I \nhaven't missed anything. And be sure, the latter part (pep8-ifying the files) \nis the time consuming part.\nOn Thu, Nov 29, 2012 at 05:55:21AM -0800, Kenneth Reitz wrote:\n\n> @sigmavirus24 how close is it to being in a usable state?\n> \n> ---\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/pull/907#issuecomment-10847816\n", "It may be easier to start with chardet2 and work backwards\n" ]
https://api.github.com/repos/psf/requests/issues/906
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/906/labels{/name}
https://api.github.com/repos/psf/requests/issues/906/comments
https://api.github.com/repos/psf/requests/issues/906/events
https://github.com/psf/requests/pull/906
7,781,135
MDExOlB1bGxSZXF1ZXN0MjczNDY3Ng==
906
quote_plus, unquote_plus added
{ "avatar_url": "https://avatars.githubusercontent.com/u/202696?v=4", "events_url": "https://api.github.com/users/Atheuz/events{/privacy}", "followers_url": "https://api.github.com/users/Atheuz/followers", "following_url": "https://api.github.com/users/Atheuz/following{/other_user}", "gists_url": "https://api.github.com/users/Atheuz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Atheuz", "id": 202696, "login": "Atheuz", "node_id": "MDQ6VXNlcjIwMjY5Ng==", "organizations_url": "https://api.github.com/users/Atheuz/orgs", "received_events_url": "https://api.github.com/users/Atheuz/received_events", "repos_url": "https://api.github.com/users/Atheuz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Atheuz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Atheuz/subscriptions", "type": "User", "url": "https://api.github.com/users/Atheuz", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-22T22:04:01Z
2021-09-08T17:05:56Z
2012-10-22T23:49:15Z
NONE
resolved
compat.py: relevant imports added utils.py: then those imports are imported here. Nothing else was changed, but I saw mentions of quoting later in utils.py but I wasnt sure what to do about that.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/906/reactions" }
https://api.github.com/repos/psf/requests/issues/906/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/906.diff", "html_url": "https://github.com/psf/requests/pull/906", "merged_at": "2012-10-22T23:49:15Z", "patch_url": "https://github.com/psf/requests/pull/906.patch", "url": "https://api.github.com/repos/psf/requests/pulls/906" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/905
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/905/labels{/name}
https://api.github.com/repos/psf/requests/issues/905/comments
https://api.github.com/repos/psf/requests/issues/905/events
https://github.com/psf/requests/issues/905
7,760,113
MDU6SXNzdWU3NzYwMTEz
905
https under proxy doesn't work
{ "avatar_url": "https://avatars.githubusercontent.com/u/2503879?v=4", "events_url": "https://api.github.com/users/Eric-Cui/events{/privacy}", "followers_url": "https://api.github.com/users/Eric-Cui/followers", "following_url": "https://api.github.com/users/Eric-Cui/following{/other_user}", "gists_url": "https://api.github.com/users/Eric-Cui/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Eric-Cui", "id": 2503879, "login": "Eric-Cui", "node_id": "MDQ6VXNlcjI1MDM4Nzk=", "organizations_url": "https://api.github.com/users/Eric-Cui/orgs", "received_events_url": "https://api.github.com/users/Eric-Cui/received_events", "repos_url": "https://api.github.com/users/Eric-Cui/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Eric-Cui/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Eric-Cui/subscriptions", "type": "User", "url": "https://api.github.com/users/Eric-Cui", "user_view_type": "public" }
[]
closed
true
null
[]
null
14
2012-10-22T08:53:07Z
2021-09-09T03:00:24Z
2013-02-10T22:45:33Z
NONE
resolved
The current Requests implementation seems not to work for https request under proxy. I have posted a question on stackoverflow: http://stackoverflow.com/questions/13005301/https-proxy-support-in-python-requests-library
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/905/reactions" }
https://api.github.com/repos/psf/requests/issues/905/timeline
null
completed
null
null
false
[ "This is a repeat of #881. The problem actually exists in urllib3 for which there is a pull request pending and is related to shazow/urllib3#50 and shazow/urllib3#68\n", "Thanks for the reply. So it seems to be resolved in the latest release. But why it still exist in my installation, which is already latest release. My environment is different in that it has 2 levels proxy, one is the ISA server in my corporation, which needs the Windows domain account and password. The other is set by me on my workstation using the free proxy software ntlmaps, which intends to automatically answer the challenges requested the ISA server. Will this cause any difference?\n", "It isn't resolved. #881 was more specifically about non-HTTPS proxies but I noted in there that it applied to HTTPS Proxies indirectly (I'll go edit that comment now). The fix is still being worked on in the two urllib3 issues I mentioned. Once those are merged/resolved (and the next version of urllib3 is vendored into requests) then it will be resolved in requests as well. As for having two proxy layers, someone else will have to answer that.\n", "We are experiencing the same problem. We are writing an application making requests to the RIPE database, which run on SSL. I tried a solution with `urllib2` which is working for now. So we'll be using this until this issue is resolved.\n", "I have read through a ton of links on github about this urllib3 issue, and all i see instead are a lot of references to newly added (or soon to be) socks support (which i don't need). \n\nBut when is THIS ISSUE going to actually be fixed (in urllib3 at least, so i can swap it into requests's 3rd party packages manually if need be). i spent all day coding up some bad ass patch syncer that relies on https (but has to be via a http proxy due to my corp network), only to be thrwarted when it came time to test and all i get are http-400 codes because the proxy isn't reached using CONNECT. quite frustrated right now.. :-\\\n", "@cynikalX - you can use foxx branch of requests - last time I checked, https through proxy worked there (the only trick is that after cloning his repository you have to switch to the branch on which he did the changes).\n\nAnother option is using an old requests branch that works on top of urllib2. Last option is to use some mitm-capable proxy like fiddler, which is aware that is has to communicate with other proxies and does the HTTP CONNECT.\n\nI also agree that HTTPS and SOCKS proxy support could be introduced separately.\n", "@dahpgjgamgan: I looked at the repo, and it seems that foxx's repository is actually far behind of kennethreitz's. If I get the time, I'll test if it works. For now, we have re-written our code to use `urllib2`. So it's not very pressing for us.\n\nAdditionally, one can clone a specific branch with the '-b' flag:\n\n```\ngit clone -b <banch_name> <url>\n```\n\nI suppose the one in question is `develop`?\n", "@dahpgjgamgan Ahh yes i ended up manually applying the patches one by one by hand before i realized i could just clone his branch (i'm a bit of a git newb). It ended up working swimingly and i'm using a local copy of requests bundled with my project. I would really prefer that the support/fixes be merged into requests's master branch and a new release was cut so i can get my org to sign off on that instead of having to incl an extra library to support (like requests is doing with urllib3). I didn't want to go the urllib2 route as i need concurrency/keep alives to use grequests\n", "Can anyone submit a patch to fix this? This is a urllib3 issue. I switched to Requests 0.7.6(the last version to use urllib2), and https requests through proxy work fine. \n", "@machinae two things:\n\nFirst, @kennethreitz is working on a rewrite using transport adapters which should alleviate or fix this issue.\n\nSecond, if you want the patch at shadow/urllib3 to get through so it can be used here, go and work on that issue. It's already known to be am issue that affects plenty of people but complaining won't help anyone. I'm sure @shazow would love help on that pull request but until he gets some, it isn't going anywhere fast.\n", "@sigmavirus24: +1.\n\nThe problem is in urllib3, not Requests. I'm only leaving the issue open to attempt to prevent too many people opening duplicates. Problems in urllib3 should be raised against and resolved in urllib3.\n", "@Lukasa I was under the impression this was already fixed in urllib3 as per https://github.com/shazow/urllib3/pull/68#issuecomment-10127574 and Requests just needs to be updated with the latest version of urllib3.\n", "That's quite wrong but understandable \n\nIlya Lichtenstein [email protected] wrote:\n\n> @Lukasa I was under the impression this was already fixed in urllib3 as\n> per https://github.com/shazow/urllib3/pull/68#issuecomment-10127574 and\n> Requests just needs to be updated with the latest version of urllib3.\n> \n> ---\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/issues/905#issuecomment-10781919\n", "I've just added some details on http://stackoverflow.com/questions/14390605/python-requests-ssl-issue which may be useful. I'm available for testing any fixes against our proxy...\n" ]
https://api.github.com/repos/psf/requests/issues/904
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/904/labels{/name}
https://api.github.com/repos/psf/requests/issues/904/comments
https://api.github.com/repos/psf/requests/issues/904/events
https://github.com/psf/requests/pull/904
7,748,315
MDExOlB1bGxSZXF1ZXN0MjcyMDk1OA==
904
Remove path hacks that break chardet in Python 3. Closes #858.
{ "avatar_url": "https://avatars.githubusercontent.com/u/61678?v=4", "events_url": "https://api.github.com/users/g2p/events{/privacy}", "followers_url": "https://api.github.com/users/g2p/followers", "following_url": "https://api.github.com/users/g2p/following{/other_user}", "gists_url": "https://api.github.com/users/g2p/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/g2p", "id": 61678, "login": "g2p", "node_id": "MDQ6VXNlcjYxNjc4", "organizations_url": "https://api.github.com/users/g2p/orgs", "received_events_url": "https://api.github.com/users/g2p/received_events", "repos_url": "https://api.github.com/users/g2p/repos", "site_admin": false, "starred_url": "https://api.github.com/users/g2p/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/g2p/subscriptions", "type": "User", "url": "https://api.github.com/users/g2p", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-10-21T15:09:19Z
2021-09-08T17:05:55Z
2012-10-21T15:49:39Z
CONTRIBUTOR
resolved
This replaces the sys.path hack with a slightly less objectionable sys.modules hack. Both have the effect of making the vendored lib's absolue imports work as expected when oauthlib isn't installed. The sys.modules hack doesn't insert the rest of the vendored crap in a global path, however.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/904/reactions" }
https://api.github.com/repos/psf/requests/issues/904/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/904.diff", "html_url": "https://github.com/psf/requests/pull/904", "merged_at": "2012-10-21T15:49:38Z", "patch_url": "https://github.com/psf/requests/pull/904.patch", "url": "https://api.github.com/repos/psf/requests/pulls/904" }
true
[ "Wow, I like this a lot better actually. Thanks!\n", "FYI, this sparked some very interesting conversations at PyCarolinas :)\n" ]
https://api.github.com/repos/psf/requests/issues/903
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/903/labels{/name}
https://api.github.com/repos/psf/requests/issues/903/comments
https://api.github.com/repos/psf/requests/issues/903/events
https://github.com/psf/requests/pull/903
7,725,990
MDExOlB1bGxSZXF1ZXN0MjcxMzM3Mg==
903
Issue 901:
{ "avatar_url": "https://avatars.githubusercontent.com/u/875327?v=4", "events_url": "https://api.github.com/users/building39/events{/privacy}", "followers_url": "https://api.github.com/users/building39/followers", "following_url": "https://api.github.com/users/building39/following{/other_user}", "gists_url": "https://api.github.com/users/building39/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/building39", "id": 875327, "login": "building39", "node_id": "MDQ6VXNlcjg3NTMyNw==", "organizations_url": "https://api.github.com/users/building39/orgs", "received_events_url": "https://api.github.com/users/building39/received_events", "repos_url": "https://api.github.com/users/building39/repos", "site_admin": false, "starred_url": "https://api.github.com/users/building39/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/building39/subscriptions", "type": "User", "url": "https://api.github.com/users/building39", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-19T19:18:54Z
2021-09-08T17:05:54Z
2012-10-21T15:52:03Z
NONE
resolved
Make value of Contents-Encoding header case insensitive per RFC 2616.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/903/reactions" }
https://api.github.com/repos/psf/requests/issues/903/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/903.diff", "html_url": "https://github.com/psf/requests/pull/903", "merged_at": "2012-10-21T15:52:03Z", "patch_url": "https://github.com/psf/requests/pull/903.patch", "url": "https://api.github.com/repos/psf/requests/pulls/903" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/902
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/902/labels{/name}
https://api.github.com/repos/psf/requests/issues/902/comments
https://api.github.com/repos/psf/requests/issues/902/events
https://github.com/psf/requests/pull/902
7,725,324
MDExOlB1bGxSZXF1ZXN0MjcxMzA4MA==
902
issue-901
{ "avatar_url": "https://avatars.githubusercontent.com/u/875327?v=4", "events_url": "https://api.github.com/users/building39/events{/privacy}", "followers_url": "https://api.github.com/users/building39/followers", "following_url": "https://api.github.com/users/building39/following{/other_user}", "gists_url": "https://api.github.com/users/building39/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/building39", "id": 875327, "login": "building39", "node_id": "MDQ6VXNlcjg3NTMyNw==", "organizations_url": "https://api.github.com/users/building39/orgs", "received_events_url": "https://api.github.com/users/building39/received_events", "repos_url": "https://api.github.com/users/building39/repos", "site_admin": false, "starred_url": "https://api.github.com/users/building39/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/building39/subscriptions", "type": "User", "url": "https://api.github.com/users/building39", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-10-19T18:56:04Z
2021-09-08T17:05:55Z
2012-10-19T19:13:29Z
NONE
resolved
RFC 2616 says that header values should be case insensitive. This patch fixes Content-Encoding to be case insensitive. This particular header was giving me grief - there may be others that need the same treatment. Pull request has been submitted.
{ "avatar_url": "https://avatars.githubusercontent.com/u/875327?v=4", "events_url": "https://api.github.com/users/building39/events{/privacy}", "followers_url": "https://api.github.com/users/building39/followers", "following_url": "https://api.github.com/users/building39/following{/other_user}", "gists_url": "https://api.github.com/users/building39/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/building39", "id": 875327, "login": "building39", "node_id": "MDQ6VXNlcjg3NTMyNw==", "organizations_url": "https://api.github.com/users/building39/orgs", "received_events_url": "https://api.github.com/users/building39/received_events", "repos_url": "https://api.github.com/users/building39/repos", "site_admin": false, "starred_url": "https://api.github.com/users/building39/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/building39/subscriptions", "type": "User", "url": "https://api.github.com/users/building39", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/902/reactions" }
https://api.github.com/repos/psf/requests/issues/902/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/902.diff", "html_url": "https://github.com/psf/requests/pull/902", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/902.patch", "url": "https://api.github.com/repos/psf/requests/pulls/902" }
true
[ "Changes to urllib3 should be submitted there, not here. Once that's accepted \nyou can make the pull here for your changes to utils unless they're \nindependent of each other.\nOn Fri, Oct 19, 2012 at 11:56:22AM -0700, Michael wrote:\n\n> RFC 2616 says that header values should be case insensitive. This patch fixes Content-Encoding to be case insensitive. This particular header was giving me grief - there may be others that need the same treatment.\n> \n> You can merge this Pull Request by running:\n> \n> git pull https://github.com/building39/requests issue-901\n> \n> Or you can view, comment on it, or merge it online at:\n> \n> https://github.com/kennethreitz/requests/pull/902\n> \n> -- Commit Summary --\n> - issue-901\n> \n> -- File Changes --\n> \n> M requests/packages/urllib3/response.py (2)\n> M requests/utils.py (5)\n> \n> -- Patch Links --\n> \n> https://github.com/kennethreitz/requests/pull/902.patch\n> https://github.com/kennethreitz/requests/pull/902.diff\n> \n> ---\n> \n> Reply to this email directly or view it on GitHub:\n> https://github.com/kennethreitz/requests/pull/902\n", "OK, cool. I'll get that done.\n\nOn 10/19/2012 02:00 PM, Ian Cordasco wrote:\n\n> Changes to urllib3 should be submitted there, not here. Once that's \n> accepted\n> you can make the pull here for your changes to utils unless they're\n> independent of each other.\n> On Fri, Oct 19, 2012 at 11:56:22AM -0700, Michael wrote:\n> \n> > RFC 2616 says that header values should be case insensitive. This \n> > patch fixes Content-Encoding to be case insensitive. This particular \n> > header was giving me grief - there may be others that need the same \n> > treatment.\n> > \n> > You can merge this Pull Request by running:\n> > \n> > git pull https://github.com/building39/requests issue-901\n> > \n> > Or you can view, comment on it, or merge it online at:\n> > \n> > https://github.com/kennethreitz/requests/pull/902\n> > \n> > -- Commit Summary --\n> > - issue-901\n> > \n> > -- File Changes --\n> > \n> > M requests/packages/urllib3/response.py (2)\n> > M requests/utils.py (5)\n> > \n> > -- Patch Links --\n> > \n> > https://github.com/kennethreitz/requests/pull/902.patch\n> > https://github.com/kennethreitz/requests/pull/902.diff\n> > \n> > ---\n> > \n> > Reply to this email directly or view it on GitHub:\n> > https://github.com/kennethreitz/requests/pull/902\n> \n> —\n> Reply to this email directly or view it on GitHub \n> https://github.com/kennethreitz/requests/pull/902#issuecomment-9613705.\n", "Closing, and will resubmit without the urllib3 change.\n", "Sounds good.\n" ]
https://api.github.com/repos/psf/requests/issues/901
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/901/labels{/name}
https://api.github.com/repos/psf/requests/issues/901/comments
https://api.github.com/repos/psf/requests/issues/901/events
https://github.com/psf/requests/issues/901
7,724,871
MDU6SXNzdWU3NzI0ODcx
901
Content-Encoding expects values to always be lower case
{ "avatar_url": "https://avatars.githubusercontent.com/u/875327?v=4", "events_url": "https://api.github.com/users/building39/events{/privacy}", "followers_url": "https://api.github.com/users/building39/followers", "following_url": "https://api.github.com/users/building39/following{/other_user}", "gists_url": "https://api.github.com/users/building39/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/building39", "id": 875327, "login": "building39", "node_id": "MDQ6VXNlcjg3NTMyNw==", "organizations_url": "https://api.github.com/users/building39/orgs", "received_events_url": "https://api.github.com/users/building39/received_events", "repos_url": "https://api.github.com/users/building39/repos", "site_admin": false, "starred_url": "https://api.github.com/users/building39/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/building39/subscriptions", "type": "User", "url": "https://api.github.com/users/building39", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-19T18:46:45Z
2021-09-09T05:30:59Z
2012-10-26T18:16:20Z
NONE
resolved
RFC 2616 says that header values should be case insensitive. This patch fixes Content-Encoding to be case insensitive. This particular header was giving me grief - there may be others that need the same treatment.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/901/reactions" }
https://api.github.com/repos/psf/requests/issues/901/timeline
null
completed
null
null
false
[ "Was this supposed to be a pull request?\n", "I just now submitted the pull request.\n\nOn 10/19/2012 01:49 PM, Ian Cordasco wrote:\n\n> Was this supposed to be a pull request?\n> \n> —\n> Reply to this email directly or view it on GitHub \n> https://github.com/kennethreitz/requests/issues/901#issuecomment-9612456. \n", "Resolved in #903.\n" ]
https://api.github.com/repos/psf/requests/issues/900
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/900/labels{/name}
https://api.github.com/repos/psf/requests/issues/900/comments
https://api.github.com/repos/psf/requests/issues/900/events
https://github.com/psf/requests/pull/900
7,723,448
MDExOlB1bGxSZXF1ZXN0MjcxMjMwMA==
900
Added ability to choose SSL version
{ "avatar_url": "https://avatars.githubusercontent.com/u/181952?v=4", "events_url": "https://api.github.com/users/dandrzejewski/events{/privacy}", "followers_url": "https://api.github.com/users/dandrzejewski/followers", "following_url": "https://api.github.com/users/dandrzejewski/following{/other_user}", "gists_url": "https://api.github.com/users/dandrzejewski/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/dandrzejewski", "id": 181952, "login": "dandrzejewski", "node_id": "MDQ6VXNlcjE4MTk1Mg==", "organizations_url": "https://api.github.com/users/dandrzejewski/orgs", "received_events_url": "https://api.github.com/users/dandrzejewski/received_events", "repos_url": "https://api.github.com/users/dandrzejewski/repos", "site_admin": false, "starred_url": "https://api.github.com/users/dandrzejewski/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dandrzejewski/subscriptions", "type": "User", "url": "https://api.github.com/users/dandrzejewski", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-10-19T18:01:07Z
2021-09-08T23:08:27Z
2012-10-23T14:30:11Z
NONE
resolved
This also acts as a workaround for #827, which in some cases, if you are connecting to an SSL server that does not support SSLv2 or SSLv3 (and, for exapmle, only supports TLSv1), would cause an illegal EOL SSL error. If you select the right SSL protocol version, you won't see this error. Kenneth, it looks like you tried to fix this in a previous revision by hard-coding the SSL version, and then you rolled it back. This makes it configurable via parameter to requests.requesttype()
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/900/reactions" }
https://api.github.com/repos/psf/requests/issues/900/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/900.diff", "html_url": "https://github.com/psf/requests/pull/900", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/900.patch", "url": "https://api.github.com/repos/psf/requests/pulls/900" }
true
[ "I made one last change to correct an issue where you could have a crash if Python was built without SSL support.\n\nAlso, I've submitted all of these changes to the urllib3 project, and it looks like @shazow is interested in merging, so you should be good there.\n", "Interesting - build 802 failed because it timed out after 15 minutes. 803 succeeded, but it finished before 802. So, this pull request is being reported as a failure when it shouldn't be...\n", "I won't be merging this at this time. Requests should be able to automatically fall back, just like the web browser.\n\nI'll be adding TransportAdapters soon, and you'll be able to specify advanced options like this.\n", "That's the problem. In my environment, on Windows (but not Linux), when I'm connecting to to an HTTPS server that only supports TLSv1/2/3, but NOT SSLv2/3, I get the same error that's reported in #827:\n\n`requests.exceptions.SSLError: [Errno 8] _ssl.c:504: EOF occurred in violation of protocol`\n\nThat's why I submitted this as a workaround.\n", "I'll be adding TransportAdapters soon, and you'll be able to specify advanced options like this.\n" ]
https://api.github.com/repos/psf/requests/issues/899
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/899/labels{/name}
https://api.github.com/repos/psf/requests/issues/899/comments
https://api.github.com/repos/psf/requests/issues/899/events
https://github.com/psf/requests/issues/899
7,717,227
MDU6SXNzdWU3NzE3MjI3
899
Chunked Transfer Encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/374677?v=4", "events_url": "https://api.github.com/users/Kontakter/events{/privacy}", "followers_url": "https://api.github.com/users/Kontakter/followers", "following_url": "https://api.github.com/users/Kontakter/following{/other_user}", "gists_url": "https://api.github.com/users/Kontakter/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Kontakter", "id": 374677, "login": "Kontakter", "node_id": "MDQ6VXNlcjM3NDY3Nw==", "organizations_url": "https://api.github.com/users/Kontakter/orgs", "received_events_url": "https://api.github.com/users/Kontakter/received_events", "repos_url": "https://api.github.com/users/Kontakter/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Kontakter/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Kontakter/subscriptions", "type": "User", "url": "https://api.github.com/users/Kontakter", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-19T14:25:49Z
2021-09-09T05:31:00Z
2012-10-20T12:35:50Z
NONE
resolved
Thank you for this amazing library. But, I have not found support of the chunked transfer encoding (for outcomings messages, of course). Do you planning to implement it? And is it proper solution to implement it inside requests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/899/reactions" }
https://api.github.com/repos/psf/requests/issues/899/timeline
null
completed
null
null
false
[ "#295\n" ]
https://api.github.com/repos/psf/requests/issues/898
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/898/labels{/name}
https://api.github.com/repos/psf/requests/issues/898/comments
https://api.github.com/repos/psf/requests/issues/898/events
https://github.com/psf/requests/pull/898
7,697,136
MDExOlB1bGxSZXF1ZXN0MjY5OTY3OA==
898
Replace assert statements with unittest's self.assert*
{ "avatar_url": "https://avatars.githubusercontent.com/u/156810?v=4", "events_url": "https://api.github.com/users/rvoicilas/events{/privacy}", "followers_url": "https://api.github.com/users/rvoicilas/followers", "following_url": "https://api.github.com/users/rvoicilas/following{/other_user}", "gists_url": "https://api.github.com/users/rvoicilas/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rvoicilas", "id": 156810, "login": "rvoicilas", "node_id": "MDQ6VXNlcjE1NjgxMA==", "organizations_url": "https://api.github.com/users/rvoicilas/orgs", "received_events_url": "https://api.github.com/users/rvoicilas/received_events", "repos_url": "https://api.github.com/users/rvoicilas/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rvoicilas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rvoicilas/subscriptions", "type": "User", "url": "https://api.github.com/users/rvoicilas", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-18T19:28:07Z
2021-09-08T17:05:54Z
2012-10-20T12:37:57Z
CONTRIBUTOR
resolved
-- the incetive for this being that with self.assertEqual you get an error message if the test fails
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/898/reactions" }
https://api.github.com/repos/psf/requests/issues/898/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/898.diff", "html_url": "https://github.com/psf/requests/pull/898", "merged_at": "2012-10-20T12:37:57Z", "patch_url": "https://github.com/psf/requests/pull/898.patch", "url": "https://api.github.com/repos/psf/requests/pulls/898" }
true
[ "Why not :)\n" ]
https://api.github.com/repos/psf/requests/issues/897
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/897/labels{/name}
https://api.github.com/repos/psf/requests/issues/897/comments
https://api.github.com/repos/psf/requests/issues/897/events
https://github.com/psf/requests/pull/897
7,655,721
MDExOlB1bGxSZXF1ZXN0MjY3OTIyOQ==
897
Fix the cheeseshop mirror url from pip.kennethreitz to crate.io
{ "avatar_url": "https://avatars.githubusercontent.com/u/67073?v=4", "events_url": "https://api.github.com/users/almet/events{/privacy}", "followers_url": "https://api.github.com/users/almet/followers", "following_url": "https://api.github.com/users/almet/following{/other_user}", "gists_url": "https://api.github.com/users/almet/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/almet", "id": 67073, "login": "almet", "node_id": "MDQ6VXNlcjY3MDcz", "organizations_url": "https://api.github.com/users/almet/orgs", "received_events_url": "https://api.github.com/users/almet/received_events", "repos_url": "https://api.github.com/users/almet/repos", "site_admin": false, "starred_url": "https://api.github.com/users/almet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/almet/subscriptions", "type": "User", "url": "https://api.github.com/users/almet", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-17T13:32:56Z
2021-09-08T17:05:53Z
2012-10-17T13:37:27Z
CONTRIBUTOR
resolved
The former doesn't work anymore it seems (due to ep.io closing some time ago, if I'm not mistaken)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/897/reactions" }
https://api.github.com/repos/psf/requests/issues/897/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/897.diff", "html_url": "https://github.com/psf/requests/pull/897", "merged_at": "2012-10-17T13:37:26Z", "patch_url": "https://github.com/psf/requests/pull/897.patch", "url": "https://api.github.com/repos/psf/requests/pulls/897" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/896
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/896/labels{/name}
https://api.github.com/repos/psf/requests/issues/896/comments
https://api.github.com/repos/psf/requests/issues/896/events
https://github.com/psf/requests/issues/896
7,639,701
MDU6SXNzdWU3NjM5NzAx
896
POSTing file while passing data as well using OAuth
{ "avatar_url": "https://avatars.githubusercontent.com/u/352270?v=4", "events_url": "https://api.github.com/users/michaelhelmick/events{/privacy}", "followers_url": "https://api.github.com/users/michaelhelmick/followers", "following_url": "https://api.github.com/users/michaelhelmick/following{/other_user}", "gists_url": "https://api.github.com/users/michaelhelmick/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/michaelhelmick", "id": 352270, "login": "michaelhelmick", "node_id": "MDQ6VXNlcjM1MjI3MA==", "organizations_url": "https://api.github.com/users/michaelhelmick/orgs", "received_events_url": "https://api.github.com/users/michaelhelmick/received_events", "repos_url": "https://api.github.com/users/michaelhelmick/repos", "site_admin": false, "starred_url": "https://api.github.com/users/michaelhelmick/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/michaelhelmick/subscriptions", "type": "User", "url": "https://api.github.com/users/michaelhelmick", "user_view_type": "public" }
[]
closed
true
null
[]
null
11
2012-10-16T21:23:54Z
2021-09-09T05:00:44Z
2013-02-09T23:10:59Z
NONE
resolved
Alright, So, in 0.14.1, I've ran into the problem with using OAuth and posting a file and data (specifically with Twitter, updating a status with media (passing the media file and parameter `status`) or updating background image (passing image file and parameter `tile`). ``` python auth = OAuth1(self.app_key, self.app_secret, self.oauth_token, self.oauth_token_secret, signature_type='auth_header') client = requests.session(auth=self.auth) url = 'https://api.twitter.com/1/account/update_profile_background_image.json' file_ = '/Users/mikehelmick/Dropbox/Avatars/avvy1004112.jpg' client.post(url, data={'tile': 'True'}, files={'image': (file_, open(file_, 'rb'))}) ``` If auth signature_type is `auth_header` I get this error (I realize this is throws a TwythonError but this method worked in versions of `requests` as late as `0.14.0`: ``` Traceback (most recent call last): File "twython.py", line 571, in <module> print t.updateProfileBackgroundImage(file) File "twython.py", line 425, in updateProfileBackgroundImage **{'tile': tile}) File "twython.py", line 464, in _media_update return self.post(url, params=params, files=file_) File "twython.py", line 249, in post return self.request(endpoint, 'POST', params=params, files=files, version=version) File "twython.py", line 241, in request content = self._request(url, method=method, params=params, files=files, api_call=url) File "twython.py", line 218, in _request retry_after=response.headers.get('retry-after')) __main__.TwythonError: u'Unauthorized: Authentication credentials were missing or incorrect. -- Could not authenticate with OAuth.' ``` (^^ That is thrown when a status code is greater than 304) Anyways, I'm looking into this, but it'd be appreciated if anyone else would like to take a look into this as well. :smile_cat:
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/896/reactions" }
https://api.github.com/repos/psf/requests/issues/896/timeline
null
completed
null
null
false
[ "Sorry for taking so long to get around to this, I've been getting settled in to a new job. Totally my bad.\n\nTwo questions: first, is this still a problem for you? Second: if it does, does it look anything like #910?\n", "M'kay, I'm closing this for inactivity. Please feel free to reopen it if this is still a problem for you.\n\nThanks for the report! =)\n", "As of 0.14.2 it was. Was there a new version released? I didn't hear of one released?\n\nSent from my iPhone\n\nOn Nov 24, 2012, at 6:29 AM, Cory Benfield [email protected] wrote:\n\n> M'kay, I'm closing this for inactivity. Please feel free to reopen it if this is still a problem for you.\n> \n> Thanks for the report! =)\n> \n> —\n> Reply to this email directly or view it on GitHub.\n", "## Nope, no new release.\n\nSent from my Android phone with K-9 Mail. Please excuse my brevity.\n", "Awesome, can you answer the two questions I asked in my previous comment?\n", "Sorry, I must have read the email and forgot to respond to those questions.\n1.) Yes.\n2.) No. My issue is posting a file and posting params with OAuth. Posting JUST params or posting JUST a file is fine. But when I try to combine the two (since 0.14.0 .. worked in that version) it has been broken. I think it's not signing something correctly now.\n", "Sorry, I had an indepth trace of what was going on and I restarted my computer and iTerm closed :P haha\n", "@michaelhelmick any updates?\n", "@slingamn I've been super busy, but I guess the fixes are currently in requests but we're waiting on requests_oauthlib 0.3.0 to be released? I think..\n", "@michaelhelmick since the fixes are currently in Requests and you're just waiting on requests_oauthlib, I'm going to close this, especially since it doesn't seem to affect 1.1.0. If you guys experience still experience it, let us know. Thanks.\n", "Also, @michaelhelmick, I just checked and 0.3.0 was [released](https://crate.io/packages/requests-oauthlib/).\n" ]
https://api.github.com/repos/psf/requests/issues/895
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/895/labels{/name}
https://api.github.com/repos/psf/requests/issues/895/comments
https://api.github.com/repos/psf/requests/issues/895/events
https://github.com/psf/requests/pull/895
7,638,113
MDExOlB1bGxSZXF1ZXN0MjY3MDg3Mw==
895
Transport Adapters
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
[ { "color": "e102d8", "default": false, "description": null, "id": 117745, "name": "Planned", "node_id": "MDU6TGFiZWwxMTc3NDU=", "url": "https://api.github.com/repos/psf/requests/labels/Planned" } ]
closed
true
null
[]
{ "closed_at": "2013-05-29T07:59:12Z", "closed_issues": 12, "created_at": "2012-11-27T18:41:46Z", "creator": { "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }, "description": ":sparkles: :cake: :sparkles:", "due_on": null, "html_url": "https://github.com/psf/requests/milestone/18", "id": 219754, "labels_url": "https://api.github.com/repos/psf/requests/milestones/18/labels", "node_id": "MDk6TWlsZXN0b25lMjE5NzU0", "number": 18, "open_issues": 0, "state": "closed", "title": "v1.0.0", "updated_at": "2013-05-29T07:59:12Z", "url": "https://api.github.com/repos/psf/requests/milestones/18" }
17
2012-10-16T20:32:47Z
2021-09-08T23:10:58Z
2012-11-27T18:32:58Z
CONTRIBUTOR
resolved
Let's not wait for urllib3 for this. http://kennethreitz.com/the-future-of-python-http.html - Requests would ship with HTTP and HTTPS TransportAdapters. - Take the current urllib3 integration and move it into said adapters. As far as I can tell, we'd need two types of Adapters: - Connections - Requests/Responses Perhaps we could just have a connection adapter, which is akin to a Requests' Session.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/895/reactions" }
https://api.github.com/repos/psf/requests/issues/895/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/895.diff", "html_url": "https://github.com/psf/requests/pull/895", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/895.patch", "url": "https://api.github.com/repos/psf/requests/pulls/895" }
true
[ "Can you point towards the current urllib3 integration?\n", "Everything in Request.send :)\n", "Hmm, I think the example in the post may work well:\n\n```\nclass DistributedAdapter(BaseAdapter):\n def __init__(self):\n self.connect_pool = …\n\n def send(self, request):\n \"\"\"Takes a Request object, returns a Response object.\"\"\"\n # Whatever needs to happen here.\n …\n\n```\n", "Ah thanks.\n", "Started branch 'adapters'\n", "Converted to a pull request.\n", "Let's add a new attribute to sessions, `adapters`.\n\nAlso a new method, `Session.mount`:\n\n``` python\ns = requests.session()\ns.mount('null:', DevNullAdapter())\ns.mount('http://haystack', WsgiAdapter(app=haystack))\n```\n", ":D\n", "``` pycon\n>>> s = requests.session()\n>>> s.adapters\n{'http://': <HTTPAdapter>, 'https//': <HTTPSAdapter>}\n\n# Register a new adapter.\n>>> s.mount('http://haystack', FakeAdapter(app=haystack))\n>>> s.adapters\n{'http://': <HTTPAdapter>, 'https://': <HTTPSAdapter>, 'http://haystack': <FakeAdapter>}\n\n```\n", "Ad-hoc request logic:\n\n```\ns = requests.session()\ns.get('http://...')\n# request = Request(...)\n# s.adapters['http://'].send(request, prefetch=True)\n```\n", "Need to figure out config propagation. \n", "The release of this may be v1.0.0, possibly.\n", "Going to refactor a bunch of stuff for this. Simplify all the things. Remove ad-hoc configuration, verbose mode (use real logging), session arguments, etc.\n", "Replace `prefetch` with `stream` everywhere.\n", "@kennethreitz don't forget to reopen this one too ;)\n", "development will continue in the master branch.\n", "#969\n" ]
https://api.github.com/repos/psf/requests/issues/894
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/894/labels{/name}
https://api.github.com/repos/psf/requests/issues/894/comments
https://api.github.com/repos/psf/requests/issues/894/events
https://github.com/psf/requests/pull/894
7,636,518
MDExOlB1bGxSZXF1ZXN0MjY2OTU1Mw==
894
Allowing iter_content() to have a value for len()
{ "avatar_url": "https://avatars.githubusercontent.com/u/65021?v=4", "events_url": "https://api.github.com/users/radiosilence/events{/privacy}", "followers_url": "https://api.github.com/users/radiosilence/followers", "following_url": "https://api.github.com/users/radiosilence/following{/other_user}", "gists_url": "https://api.github.com/users/radiosilence/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/radiosilence", "id": 65021, "login": "radiosilence", "node_id": "MDQ6VXNlcjY1MDIx", "organizations_url": "https://api.github.com/users/radiosilence/orgs", "received_events_url": "https://api.github.com/users/radiosilence/received_events", "repos_url": "https://api.github.com/users/radiosilence/repos", "site_admin": false, "starred_url": "https://api.github.com/users/radiosilence/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/radiosilence/subscriptions", "type": "User", "url": "https://api.github.com/users/radiosilence", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-16T19:39:10Z
2021-09-08T17:05:52Z
2012-10-17T14:19:22Z
NONE
resolved
Based on content-length divided by chunk_size. Kind of a rough commit, more for the idea or anything else. Other options would be to make a new release of clint, or create a generator class to wrap iter_content in application code.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/894/reactions" }
https://api.github.com/repos/psf/requests/issues/894/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/894.diff", "html_url": "https://github.com/psf/requests/pull/894", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/894.patch", "url": "https://api.github.com/repos/psf/requests/pulls/894" }
true
[ "See #855 :)\n" ]
https://api.github.com/repos/psf/requests/issues/893
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/893/labels{/name}
https://api.github.com/repos/psf/requests/issues/893/comments
https://api.github.com/repos/psf/requests/issues/893/events
https://github.com/psf/requests/pull/893
7,601,285
MDExOlB1bGxSZXF1ZXN0MjY1MzI2NA==
893
Add EditorConfig file
{ "avatar_url": "https://avatars.githubusercontent.com/u/285352?v=4", "events_url": "https://api.github.com/users/treyhunner/events{/privacy}", "followers_url": "https://api.github.com/users/treyhunner/followers", "following_url": "https://api.github.com/users/treyhunner/following{/other_user}", "gists_url": "https://api.github.com/users/treyhunner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/treyhunner", "id": 285352, "login": "treyhunner", "node_id": "MDQ6VXNlcjI4NTM1Mg==", "organizations_url": "https://api.github.com/users/treyhunner/orgs", "received_events_url": "https://api.github.com/users/treyhunner/received_events", "repos_url": "https://api.github.com/users/treyhunner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/treyhunner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/treyhunner/subscriptions", "type": "User", "url": "https://api.github.com/users/treyhunner", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-15T18:30:47Z
2021-09-08T17:05:53Z
2012-10-15T20:07:15Z
MEMBER
resolved
This adds an [EditorConfig file](http://editorconfig.org) to denote code style for `*.py` and `*.rst` files. This EditorConfig file is a human and machine readable code style guide. Currently EditorConfig files can be read by various text editors/IDEs using plugins. This EditorConfig file correctly reflects your code style except for the following errors which were revealed by an EditorConfig checker [I'm developing](https://github.com/treyhunner/editorconfig-tools): ``` docs/community/support.rst: No final newline found docs/dev/authors.rst: No final newline found docs/_themes/README.rst: Tab indentation found docs/conf.py: No final newline found requests/packages/oauthlib/common.py: Trailing whitespace found requests/packages/oauthlib/oauth1/rfc5849/signature.py: Trailing whitespace found ``` All of the above errors except for the last two (in `requests/packages`) would be resolved by #892.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/893/reactions" }
https://api.github.com/repos/psf/requests/issues/893/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/893.diff", "html_url": "https://github.com/psf/requests/pull/893", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/893.patch", "url": "https://api.github.com/repos/psf/requests/pulls/893" }
true
[ "Hmm, I think this is a bit out of scope for now. I'll definitely consider it in the future though. Trying to keep things minimal :)\n\nThanks!\n" ]
https://api.github.com/repos/psf/requests/issues/892
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/892/labels{/name}
https://api.github.com/repos/psf/requests/issues/892/comments
https://api.github.com/repos/psf/requests/issues/892/events
https://github.com/psf/requests/pull/892
7,601,126
MDExOlB1bGxSZXF1ZXN0MjY1MzE5MA==
892
Fix multiple code style (whitespace) in docs/
{ "avatar_url": "https://avatars.githubusercontent.com/u/285352?v=4", "events_url": "https://api.github.com/users/treyhunner/events{/privacy}", "followers_url": "https://api.github.com/users/treyhunner/followers", "following_url": "https://api.github.com/users/treyhunner/following{/other_user}", "gists_url": "https://api.github.com/users/treyhunner/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/treyhunner", "id": 285352, "login": "treyhunner", "node_id": "MDQ6VXNlcjI4NTM1Mg==", "organizations_url": "https://api.github.com/users/treyhunner/orgs", "received_events_url": "https://api.github.com/users/treyhunner/received_events", "repos_url": "https://api.github.com/users/treyhunner/repos", "site_admin": false, "starred_url": "https://api.github.com/users/treyhunner/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/treyhunner/subscriptions", "type": "User", "url": "https://api.github.com/users/treyhunner", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-15T18:25:24Z
2021-09-08T08:00:51Z
2012-10-15T19:55:51Z
MEMBER
resolved
This fixes the following code style issues in all `*.rst` and `*.py` files outside of `requests/packages`: - use 4 spaces for indentation (not tabs) - trim trailing whitespace from the ends of lines - insert a final newline in every file (except for completely empty ones)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/892/reactions" }
https://api.github.com/repos/psf/requests/issues/892/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/892.diff", "html_url": "https://github.com/psf/requests/pull/892", "merged_at": "2012-10-15T19:55:51Z", "patch_url": "https://github.com/psf/requests/pull/892.patch", "url": "https://api.github.com/repos/psf/requests/pulls/892" }
true
[ "Excellent, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/891
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/891/labels{/name}
https://api.github.com/repos/psf/requests/issues/891/comments
https://api.github.com/repos/psf/requests/issues/891/events
https://github.com/psf/requests/issues/891
7,557,860
MDU6SXNzdWU3NTU3ODYw
891
error when trying to use oauth
{ "avatar_url": "https://avatars.githubusercontent.com/u/4378?v=4", "events_url": "https://api.github.com/users/chrisdrackett/events{/privacy}", "followers_url": "https://api.github.com/users/chrisdrackett/followers", "following_url": "https://api.github.com/users/chrisdrackett/following{/other_user}", "gists_url": "https://api.github.com/users/chrisdrackett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chrisdrackett", "id": 4378, "login": "chrisdrackett", "node_id": "MDQ6VXNlcjQzNzg=", "organizations_url": "https://api.github.com/users/chrisdrackett/orgs", "received_events_url": "https://api.github.com/users/chrisdrackett/received_events", "repos_url": "https://api.github.com/users/chrisdrackett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chrisdrackett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chrisdrackett/subscriptions", "type": "User", "url": "https://api.github.com/users/chrisdrackett", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-10-13T00:46:48Z
2021-09-09T05:31:01Z
2012-10-13T16:52:41Z
NONE
resolved
So I've been porting my code from using requests-oauth to the built in requests oauth. So far I haven't had any luck. Here is what I'm doing: https://github.com/shelfworthy/flixpy/blob/requests_oauth/flixpy/client.py#L41 vs. before with requests-oauth: https://github.com/shelfworthy/flixpy/blob/master/flixpy/client.py#L20 any guidance?
{ "avatar_url": "https://avatars.githubusercontent.com/u/4378?v=4", "events_url": "https://api.github.com/users/chrisdrackett/events{/privacy}", "followers_url": "https://api.github.com/users/chrisdrackett/followers", "following_url": "https://api.github.com/users/chrisdrackett/following{/other_user}", "gists_url": "https://api.github.com/users/chrisdrackett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chrisdrackett", "id": 4378, "login": "chrisdrackett", "node_id": "MDQ6VXNlcjQzNzg=", "organizations_url": "https://api.github.com/users/chrisdrackett/orgs", "received_events_url": "https://api.github.com/users/chrisdrackett/received_events", "repos_url": "https://api.github.com/users/chrisdrackett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chrisdrackett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chrisdrackett/subscriptions", "type": "User", "url": "https://api.github.com/users/chrisdrackett", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/891/reactions" }
https://api.github.com/repos/psf/requests/issues/891/timeline
null
completed
null
null
false
[ "I've spent some more time on this and think I know what is causing the error. The url I get from requests looks like this:\n\n```\nhttp://api-public.netflix.com/catalog/titles?term=thor&oauth_nonce=38117121406491052691350135419&oauth_timestamp=1350135419&oauth_consumer_key=k3cuh3wwvdfe434rc8pzyng&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&v=2.0&output=json&oauth_token=None&oauth_signature=yTNhyB%2FtfMNUa3bGiWWPHtcnPjQ%3D\n```\n\nvs the one I get with my old method:\n\n```\nhttp://api-public.netflix.com/catalog/titles?term=thor&oauth_nonce=30581223&oauth_timestamp=1350135535&oauth_consumer_key=k3cuh3wwvdfe434rc8pzyng&oauth_signature_method=HMAC-SHA1&oauth_version=1.0&v=2.0&output=json&oauth_signature=0hx3wJoc4235hPHvKEFz63x5%2Bs%3D\n```\n\nI'm guessing the issue is the `oauth_token=None` in the requests version.\n", "looks like the issue here is that I need to convert all strings to unicode before sending them in. I need to add some logic so that the values that are `None` don't get converted to `u'None'` and in theory I should be good.\n", "ok, so this did come down to unicode. Once everything is unicode encoded stuff works without issue.\n", "Yeah, unfortunately we are sensitive to encoding, so our two options were\nto require you specify an encoding, or require Unicode for all parameters.\nWe went with the latter, sorry for lack of docs. :(\n\nOn Oct 13, 2012, at 16:02, Chris Drackett [email protected] wrote:\n\nlooks like the issue here is that I need to convert all strings to unicode\nbefore sending them in. I need to add some logic so that the values that\nare None don't get converted to u'None' and in theory I should be good.\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/issues/891#issuecomment-9404391.\n", "why not convert to unicode in requests, just to make sure?\n", "How will we know what we're converting from?\n\nOn Oct 13, 2012, at 19:17, Chris Drackett [email protected] wrote:\n\nwhy not convert to unicode in requests, just to make sure?\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/issues/891#issuecomment-9406485.\n", "IOW, either we require that you specify an encoding or we require Unicode.\nMight as well do the latter. The broken part is the lack of docs.\n\nOn Oct 13, 2012, at 19:17, Chris Drackett [email protected] wrote:\n\nwhy not convert to unicode in requests, just to make sure?\n\n—\nReply to this email directly or view it on\nGitHubhttps://github.com/kennethreitz/requests/issues/891#issuecomment-9406485.\n" ]
https://api.github.com/repos/psf/requests/issues/890
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/890/labels{/name}
https://api.github.com/repos/psf/requests/issues/890/comments
https://api.github.com/repos/psf/requests/issues/890/events
https://github.com/psf/requests/issues/890
7,547,405
MDU6SXNzdWU3NTQ3NDA1
890
correct url getting 400 status with requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/4378?v=4", "events_url": "https://api.github.com/users/chrisdrackett/events{/privacy}", "followers_url": "https://api.github.com/users/chrisdrackett/followers", "following_url": "https://api.github.com/users/chrisdrackett/following{/other_user}", "gists_url": "https://api.github.com/users/chrisdrackett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chrisdrackett", "id": 4378, "login": "chrisdrackett", "node_id": "MDQ6VXNlcjQzNzg=", "organizations_url": "https://api.github.com/users/chrisdrackett/orgs", "received_events_url": "https://api.github.com/users/chrisdrackett/received_events", "repos_url": "https://api.github.com/users/chrisdrackett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chrisdrackett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chrisdrackett/subscriptions", "type": "User", "url": "https://api.github.com/users/chrisdrackett", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-12T16:25:25Z
2021-09-09T05:31:01Z
2012-10-13T00:44:02Z
NONE
resolved
I'm not sure if this is a requests or requests-oauth issue, so I've opened it both places: https://github.com/maraujop/requests-oauth/issues/40 basically I'm sending a request that gets a 400 status from requests. However, if I take response.url and request it again, I get the correct response. Odd? ``` python response = self.client.request(method, url, data=request_params, allow_redirects=True) response.raise_for_status() >> 400 response = self.client.request(method, url, data=request_params, allow_redirects=True) response = requests.get(response.url) response.raise_for_status() print response >> correct response json ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/4378?v=4", "events_url": "https://api.github.com/users/chrisdrackett/events{/privacy}", "followers_url": "https://api.github.com/users/chrisdrackett/followers", "following_url": "https://api.github.com/users/chrisdrackett/following{/other_user}", "gists_url": "https://api.github.com/users/chrisdrackett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/chrisdrackett", "id": 4378, "login": "chrisdrackett", "node_id": "MDQ6VXNlcjQzNzg=", "organizations_url": "https://api.github.com/users/chrisdrackett/orgs", "received_events_url": "https://api.github.com/users/chrisdrackett/received_events", "repos_url": "https://api.github.com/users/chrisdrackett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/chrisdrackett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/chrisdrackett/subscriptions", "type": "User", "url": "https://api.github.com/users/chrisdrackett", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/890/reactions" }
https://api.github.com/repos/psf/requests/issues/890/timeline
null
completed
null
null
false
[ "Why are you using requests-oauth, and not the built in oauth support?\n", "because I was reading your docs ;)\n\nhttp://docs.python-requests.org/en/latest/user/quickstart/#oauth-authentication\n", "@chrisdrackett _cough_ check again ;)\n" ]
https://api.github.com/repos/psf/requests/issues/889
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/889/labels{/name}
https://api.github.com/repos/psf/requests/issues/889/comments
https://api.github.com/repos/psf/requests/issues/889/events
https://github.com/psf/requests/issues/889
7,463,211
MDU6SXNzdWU3NDYzMjEx
889
python setup.py bdist_rpm fails
{ "avatar_url": "https://avatars.githubusercontent.com/u/87697?v=4", "events_url": "https://api.github.com/users/tebeka/events{/privacy}", "followers_url": "https://api.github.com/users/tebeka/followers", "following_url": "https://api.github.com/users/tebeka/following{/other_user}", "gists_url": "https://api.github.com/users/tebeka/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tebeka", "id": 87697, "login": "tebeka", "node_id": "MDQ6VXNlcjg3Njk3", "organizations_url": "https://api.github.com/users/tebeka/orgs", "received_events_url": "https://api.github.com/users/tebeka/received_events", "repos_url": "https://api.github.com/users/tebeka/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tebeka/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tebeka/subscriptions", "type": "User", "url": "https://api.github.com/users/tebeka", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-10-09T21:06:09Z
2021-09-09T05:31:00Z
2012-10-23T14:28:19Z
NONE
resolved
I fixed that by: - Removing all but the 1'st line in LICENSE - Deleting the two lines containing PYTHONDONTWRITEBYTECODE in setup.py Python 2.7, Ubuntu 12.04 amd64
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/889/reactions" }
https://api.github.com/repos/psf/requests/issues/889/timeline
null
completed
null
null
false
[ "It requires there to be no license?\n\n---\n\nI've never even heard of this command before :)\n", "If you're packaging this for a repository, I'm fairly certain that you're going to introduce a bug by removing `PYTHONDONTWRITEBYTECODE`. That was a specific bug fix for posting files. As for the LICENSE, why does that have to be truncated?\n", "I had the same problem a while back. I think the issue was that entire text of the license gets included, and the linebreaks cause each line of the license to be interpreted as config (somewhere within RPM packaging, .spec file maybe?). I'm guessing it expects the license to be a single line of text.\n", "LICENSE is included \"as is\" in the .spec file and this causes a parse error.\n\nAs for `PYTHONDONTWRITEBYTECODE` - I'm not an expert in RPM building but the bdist_rpm does byte compile everything and if it doesn't - it's an error. Maybe there's a flag to suppress that, but I can't find it. Maybe a post install script that does `find INSTALL_DIR -name *.py[co] -exec rm {} \\;` will do the trick?\n", "@sagarun might know about dist_rpm and the LICENSE issue.\n\nDid we set PYTHONDONTWRITEBYTECODE in order to fix a test that was trying to upload `__file__`? I can submit a pull request that posts a normal text file instead, or works out a relative path to the original Python source file.\n", "I just did a quick google search: http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html explains that anything starting with a field-name has to be one line, e.g.,\n\n```\nAuthor: Kenneth Reitz\nCopyright: ISC/BSD/etc.\n```\n\nBut things like the description can be multi-line, e.g.,\n\n```\n%description:\n Foo\n Bar\n Bogus\n```\n\nMaybe there's a way to move the terms of the license into the `%description` tag then?\n", "This is a bug in setuptools.\n" ]
https://api.github.com/repos/psf/requests/issues/888
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/888/labels{/name}
https://api.github.com/repos/psf/requests/issues/888/comments
https://api.github.com/repos/psf/requests/issues/888/events
https://github.com/psf/requests/issues/888
7,438,927
MDU6SXNzdWU3NDM4OTI3
888
safe_mode not catching error on session.get
{ "avatar_url": "https://avatars.githubusercontent.com/u/488202?v=4", "events_url": "https://api.github.com/users/flytwokites/events{/privacy}", "followers_url": "https://api.github.com/users/flytwokites/followers", "following_url": "https://api.github.com/users/flytwokites/following{/other_user}", "gists_url": "https://api.github.com/users/flytwokites/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/flytwokites", "id": 488202, "login": "flytwokites", "node_id": "MDQ6VXNlcjQ4ODIwMg==", "organizations_url": "https://api.github.com/users/flytwokites/orgs", "received_events_url": "https://api.github.com/users/flytwokites/received_events", "repos_url": "https://api.github.com/users/flytwokites/repos", "site_admin": false, "starred_url": "https://api.github.com/users/flytwokites/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flytwokites/subscriptions", "type": "User", "url": "https://api.github.com/users/flytwokites", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-10-09T06:01:45Z
2021-09-09T05:30:48Z
2012-11-24T11:10:38Z
NONE
resolved
for this code ``` python import requests config = {'safe_mode': True} # this url will get a connection reset url = 'http://www.dapenti.com' ``` when set safe mode on requests.get, it worked: ``` python r = requests.get(url, config=config) print r.error # ==> requests.exceptions.ConnectionError(socket.error(104, 'Connection reset by peer')) ``` but set it on session will raise a exception: ``` python s = requests.session(config=config) r = s.get(url) # raise ConnectionError: [Errno 104] Connection reset by peer ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/888/reactions" }
https://api.github.com/repos/psf/requests/issues/888/timeline
null
completed
null
null
false
[ "Good catch. It looks like it's due to issue #639. I fixed this but my patch hasn't been merged, yet.\n", "As shown above we actually have two open pull requests to resolve this issue, so I'm going to direct any discussion that way. Thanks for the report @flytwokites!\n" ]
https://api.github.com/repos/psf/requests/issues/887
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/887/labels{/name}
https://api.github.com/repos/psf/requests/issues/887/comments
https://api.github.com/repos/psf/requests/issues/887/events
https://github.com/psf/requests/pull/887
7,432,346
MDExOlB1bGxSZXF1ZXN0MjU3OTQwNQ==
887
Small changes to make the code more PEP8 compliant
{ "avatar_url": "https://avatars.githubusercontent.com/u/156810?v=4", "events_url": "https://api.github.com/users/rvoicilas/events{/privacy}", "followers_url": "https://api.github.com/users/rvoicilas/followers", "following_url": "https://api.github.com/users/rvoicilas/following{/other_user}", "gists_url": "https://api.github.com/users/rvoicilas/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rvoicilas", "id": 156810, "login": "rvoicilas", "node_id": "MDQ6VXNlcjE1NjgxMA==", "organizations_url": "https://api.github.com/users/rvoicilas/orgs", "received_events_url": "https://api.github.com/users/rvoicilas/received_events", "repos_url": "https://api.github.com/users/rvoicilas/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rvoicilas/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rvoicilas/subscriptions", "type": "User", "url": "https://api.github.com/users/rvoicilas", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-08T21:44:44Z
2021-09-08T17:05:52Z
2012-10-17T14:20:55Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/887/reactions" }
https://api.github.com/repos/psf/requests/issues/887/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/887.diff", "html_url": "https://github.com/psf/requests/pull/887", "merged_at": "2012-10-17T14:20:55Z", "patch_url": "https://github.com/psf/requests/pull/887.patch", "url": "https://api.github.com/repos/psf/requests/pulls/887" }
true
[ "Agreed on all fronts. Thanks so much!\n\n:sparkles: :cake: :sparkles:\n" ]
https://api.github.com/repos/psf/requests/issues/886
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/886/labels{/name}
https://api.github.com/repos/psf/requests/issues/886/comments
https://api.github.com/repos/psf/requests/issues/886/events
https://github.com/psf/requests/issues/886
7,427,370
MDU6SXNzdWU3NDI3Mzcw
886
Return server's SSL certificate in Response or Session
{ "avatar_url": "https://avatars.githubusercontent.com/u/616047?v=4", "events_url": "https://api.github.com/users/kravietz/events{/privacy}", "followers_url": "https://api.github.com/users/kravietz/followers", "following_url": "https://api.github.com/users/kravietz/following{/other_user}", "gists_url": "https://api.github.com/users/kravietz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kravietz", "id": 616047, "login": "kravietz", "node_id": "MDQ6VXNlcjYxNjA0Nw==", "organizations_url": "https://api.github.com/users/kravietz/orgs", "received_events_url": "https://api.github.com/users/kravietz/received_events", "repos_url": "https://api.github.com/users/kravietz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kravietz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kravietz/subscriptions", "type": "User", "url": "https://api.github.com/users/kravietz", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-10-08T18:18:02Z
2021-09-08T22:00:52Z
2012-11-16T23:35:50Z
NONE
resolved
It's sometimes necessary to see not only boolean SSL certificate validation status but also SSL certificate contents. It would be nice to have a way to access the SSL cert as dict() available from Response or Session objects. P.S. I can add that as I've written a module to do exactly that http://ipsec.pl/node/1068
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/886/reactions" }
https://api.github.com/repos/psf/requests/issues/886/timeline
null
completed
null
null
false
[ "`requests` is going through a pretty major refactoring right now. If you'd like to make a pull request with this change, I'm sure Kenneth will consider it. In the meantime, I'm going to close this issue. =)\n", "What has the refactoring got to do with a feature request?\n", "I'm sorry, that was a lousy explanation, I was pretty tired when I wrote it. =)\n\nThe long answer is that Kenneth is refactoring `requests` along [these lines](http://kennethreitz.com/the-future-of-python-http.html), which you can see in #895. This means that Kenneth is pretty unlikely to get to this any time soon (this issue is already a month old and I only just got to it, and I've got way more free time than he does). So Kenneth won't be adding this himself, at least, not for a while.\n\nI also won't be making this change, partly because I suck at API design and partly because this looks to me like a 20 percent feature: the vast majority of people will never use it, and those that want it are plenty competent enough to make the change themselves. Obviously, Kenneth might think differently, but I doubt he'll look at this issue for a while.\n\nFor that reason, I suggested to @kravietz that he write the change himself and submit a Pull Request. The worst case scenario there is that Kenneth decides he doesn't want to change the API for this feature, and so @kravietz ends up maintaining a fork; best case, he likes it and merges it.\n\nIf you want a second opinion, please let me know and I'll nudge someone else to take a look at this issue. =)\n\n**tl;dr:** No-one in the last month expressed any interest in making this change, Kenneth won't look at this for ages, and I have no plans to make this change, so I judged this issue as dead.\n", "No need for a second opinion, I was just curious about the rationale. Thanks.\n", "Has this been addressed in the last 3 years?\n", "@jayfk I'm certain there's no other information about this other than what's in the issue.\n" ]
https://api.github.com/repos/psf/requests/issues/885
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/885/labels{/name}
https://api.github.com/repos/psf/requests/issues/885/comments
https://api.github.com/repos/psf/requests/issues/885/events
https://github.com/psf/requests/issues/885
7,418,207
MDU6SXNzdWU3NDE4MjA3
885
Function like urllib.urlretrieve for downloading files
{ "avatar_url": "https://avatars.githubusercontent.com/u/201930?v=4", "events_url": "https://api.github.com/users/matrixik/events{/privacy}", "followers_url": "https://api.github.com/users/matrixik/followers", "following_url": "https://api.github.com/users/matrixik/following{/other_user}", "gists_url": "https://api.github.com/users/matrixik/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/matrixik", "id": 201930, "login": "matrixik", "node_id": "MDQ6VXNlcjIwMTkzMA==", "organizations_url": "https://api.github.com/users/matrixik/orgs", "received_events_url": "https://api.github.com/users/matrixik/received_events", "repos_url": "https://api.github.com/users/matrixik/repos", "site_admin": false, "starred_url": "https://api.github.com/users/matrixik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/matrixik/subscriptions", "type": "User", "url": "https://api.github.com/users/matrixik", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-10-08T12:00:50Z
2021-09-08T18:00:47Z
2012-10-08T15:04:36Z
NONE
resolved
Hello, I would like to request function for downloading files. Something like: `r = requests.get_file('https://example.com/big_file.zip', 'path_to_file')` I'm looking for it mainly for downloading big files (over 1GB), without fully loading them to memory. Best regards
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/885/reactions" }
https://api.github.com/repos/psf/requests/issues/885/timeline
null
completed
null
null
false
[ "You can write a file without loading it into memory currently:\n\n```\nr = requests.get('https://example.com/big_file.zip'', prefetch=False)\n\nwith open('file', 'w') as f:\n for chunk in r.iter_chunks():\n f.write(chunk)\n```\n", "Nice to know but still I would prefer short one-liner over 4 lines.\nP.S. You probably should update you example from `requests.get_file` to `requests.get`\n", "This isn't about lines of code — it's about concise, succinct code. There is little value and many disadvantages of having a library write to files directly on your behalf.\n", "Thank you for reply. I'll leave this to more experienced than me and use your code.\n\n`iter_chunks` not exist, I need to use `iter_lines` or `iter_content` with big `chunk_size`\n\nBest regards\n", "Sorry, I hadn't had any coffee yet :)\n", "For latest version(Edit: v2+) of requests:\n\n```\nr = requests.get('https://example.com/big_file.zip'', stream=True)\n\nwith open('file', 'wb') as f:\n for chunk in r.iter_content():\n f.write(chunk)\n```\n", "@amitt001 That should work in the current version v2.10.0, and indeed in all of the v2.X.X series release.\n" ]
https://api.github.com/repos/psf/requests/issues/884
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/884/labels{/name}
https://api.github.com/repos/psf/requests/issues/884/comments
https://api.github.com/repos/psf/requests/issues/884/events
https://github.com/psf/requests/pull/884
7,415,124
MDExOlB1bGxSZXF1ZXN0MjU3MTE5Mw==
884
Support CJK parameters when post files
{ "avatar_url": "https://avatars.githubusercontent.com/u/142570?v=4", "events_url": "https://api.github.com/users/everbird/events{/privacy}", "followers_url": "https://api.github.com/users/everbird/followers", "following_url": "https://api.github.com/users/everbird/following{/other_user}", "gists_url": "https://api.github.com/users/everbird/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/everbird", "id": 142570, "login": "everbird", "node_id": "MDQ6VXNlcjE0MjU3MA==", "organizations_url": "https://api.github.com/users/everbird/orgs", "received_events_url": "https://api.github.com/users/everbird/received_events", "repos_url": "https://api.github.com/users/everbird/repos", "site_admin": false, "starred_url": "https://api.github.com/users/everbird/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/everbird/subscriptions", "type": "User", "url": "https://api.github.com/users/everbird", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-08T09:21:19Z
2021-09-08T17:05:51Z
2012-10-17T14:21:40Z
CONTRIBUTOR
resolved
When I post files with CJK parameters I got this exception: ``` Traceback (most recent call last): File "/home/everbird/code/requests/tests/test_requests.py", line 358, in test_POSTBIN_GET_POST_FILES_WITH_CJK_PARAMS data={'some': '中文'}) File "/home/everbird/code/requests/requests/api.py", line 98, in post return request('post', url, data=data, **kwargs) File "/home/everbird/code/requests/requests/safe_mode.py", line 39, in wrapped return function(method, url, **kwargs) File "/home/everbird/code/requests/requests/api.py", line 51, in request return session.request(method=method, url=url, **kwargs) File "/home/everbird/code/requests/requests/sessions.py", line 241, in request r.send(prefetch=prefetch) File "/home/everbird/code/requests/requests/models.py", line 529, in send (body, content_type) = self._encode_files(self.files) File "/home/everbird/code/requests/requests/models.py", line 365, in _encode_files new_fields.append((field, str(val))) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128) ``` For py2, `str` is actually `unicode` according to `requests/compat.py`. It is OK like this: ``` python In [1]: str('a') Out[1]: 'a' In [2]: unicode('a') Out[2]: u'a' ``` but it failed as below: ``` python In [3]: str('中文') Out[3]: '\xe4\xb8\xad\xe6\x96\x87' In [4]: unicode('中文') --------------------------------------------------------------------------- UnicodeDecodeError Traceback (most recent call last) <ipython-input-4-a7400b671605> in <module>() ----> 1 unicode('中文') UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 0: ordinal not in range(128) ``` In `requests/models.py` at line 363-365 the `str()` seems should be the builtin `str`, not `unicode`. So I wrote a test named `test_POSTBIN_GET_POST_FILES_WITH_CJK_PARAMS` and fixed it. Hope it helps.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/884/reactions" }
https://api.github.com/repos/psf/requests/issues/884/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/884.diff", "html_url": "https://github.com/psf/requests/pull/884", "merged_at": "2012-10-17T14:21:40Z", "patch_url": "https://github.com/psf/requests/pull/884.patch", "url": "https://api.github.com/repos/psf/requests/pulls/884" }
true
[ "What does CJK mean?\n", "@piotr-dobrogost `CJK` is a collective term for `Chinese`, `Japanese`, and `Korean`. You can find more details [here](http://en.wikipedia.org/wiki/CJK_characters).\n", "Thanks for the fix!\n" ]
https://api.github.com/repos/psf/requests/issues/883
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/883/labels{/name}
https://api.github.com/repos/psf/requests/issues/883/comments
https://api.github.com/repos/psf/requests/issues/883/events
https://github.com/psf/requests/issues/883
7,392,216
MDU6SXNzdWU3MzkyMjE2
883
Incompatibility with Python 3.3
{ "avatar_url": "https://avatars.githubusercontent.com/u/656294?v=4", "events_url": "https://api.github.com/users/Arfrever/events{/privacy}", "followers_url": "https://api.github.com/users/Arfrever/followers", "following_url": "https://api.github.com/users/Arfrever/following{/other_user}", "gists_url": "https://api.github.com/users/Arfrever/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Arfrever", "id": 656294, "login": "Arfrever", "node_id": "MDQ6VXNlcjY1NjI5NA==", "organizations_url": "https://api.github.com/users/Arfrever/orgs", "received_events_url": "https://api.github.com/users/Arfrever/received_events", "repos_url": "https://api.github.com/users/Arfrever/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Arfrever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Arfrever/subscriptions", "type": "User", "url": "https://api.github.com/users/Arfrever", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-10-05T23:13:00Z
2021-09-09T05:30:50Z
2012-11-23T10:05:31Z
NONE
resolved
Test results from git head: ``` $ PYTHONPATH="$(pwd)" python3.3 tests/test_cookies.py -v test_convert_jar_to_dict (__main__.CookieTests) Test that keys, values, and items are defined and that we can convert ... ok test_cookies_from_response (__main__.CookieTests) Basic test that we correctly parse received cookies in the Response object. ... ok test_crossdomain_cookies (__main__.CookieTests) Cookies should not be sent to domains they didn't originate from. ... ok test_disabled_cookie_persistence (__main__.CookieTests) Test that cookies are not persisted when configured accordingly. ... /usr/lib64/python3.3/collections/__init__.py:55: ResourceWarning: unclosed <socket.socket object, fd=4, family=2, type=1, proto=6> self.__map = {} ok test_jar_utility_functions (__main__.CookieTests) Test utility functions such as list_domains, list_paths, multiple_domains. ... ok test_none_cookie (__main__.CookieTests) Regression test: don't send a Cookie header with a string value of 'None'! ... /tmp/requests/requests/structures.py:21: ResourceWarning: unclosed <socket.socket object, fd=3, family=2, type=1, proto=6> self._lower_keys = dict((k.lower(), k) for k in list(self.keys())) ok test_overwrite (__main__.CookieTests) Cookies should get overwritten when appropriate. ... ok test_redirects (__main__.CookieTests) Test that cookies set by a 302 page are correctly processed. ... ok test_secure_cookies (__main__.CookieTests) Test that secure cookies can only be sent via https. ... ERROR test_cookiejar_persistence (__main__.LWPCookieJarTest) Test that we can save cookies to a FileCookieJar. ... ok test_crossdomain (__main__.LWPCookieJarTest) Test persistence of the domains associated with the cookies. ... ok test_persistent_cookies (__main__.LWPCookieJarTest) Test that we correctly interpret persistent cookies. ... ok test_cookiejar_persistence (__main__.MozCookieJarTest) Test that we can save cookies to a FileCookieJar. ... ok test_crossdomain (__main__.MozCookieJarTest) Test persistence of the domains associated with the cookies. ... ok test_persistent_cookies (__main__.MozCookieJarTest) Test that we correctly interpret persistent cookies. ... ok ====================================================================== ERROR: test_secure_cookies (__main__.CookieTests) Test that secure cookies can only be sent via https. ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_cookies.py", line 99, in test_secure_cookies secure_resp = requests.get('https://httpbin.org/cookies', cookies=cookies, verify=False) File "/tmp/requests/requests/api.py", line 65, in get return request('get', url, **kwargs) File "/tmp/requests/requests/safe_mode.py", line 39, in wrapped return function(method, url, **kwargs) File "/tmp/requests/requests/api.py", line 51, in request return session.request(method=method, url=url, **kwargs) File "/tmp/requests/requests/sessions.py", line 241, in request r.send(prefetch=prefetch) File "/tmp/requests/requests/models.py", line 605, in send cookie_header = get_cookie_header(self.cookies, self) File "/tmp/requests/requests/cookies.py", line 115, in get_cookie_header jar.add_cookie_header(r) File "/usr/lib64/python3.3/http/cookiejar.py", line 1328, in add_cookie_header cookies = self._cookies_for_request(request) File "/usr/lib64/python3.3/http/cookiejar.py", line 1254, in _cookies_for_request cookies.extend(self._cookies_for_domain(domain, request)) File "/usr/lib64/python3.3/http/cookiejar.py", line 1243, in _cookies_for_domain if not self._policy.return_ok(cookie, request): File "/usr/lib64/python3.3/http/cookiejar.py", line 1077, in return_ok if not fn(cookie, request): File "/usr/lib64/python3.3/http/cookiejar.py", line 1103, in return_ok_secure if cookie.secure and request.type != "https": AttributeError: 'MockRequest' object has no attribute 'type' ---------------------------------------------------------------------- Ran 15 tests in 21.789s FAILED (errors=1) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/883/reactions" }
https://api.github.com/repos/psf/requests/issues/883/timeline
null
completed
null
null
false
[ "Closing for #882\n", "This issue is about incompatibility with Python 3.3, not 3.1. Python 3.3 has `callable`, so the fix will be certainly different.\n", "Woops, didn't read closely enough :)\n", "Resolved by #942.\n" ]
https://api.github.com/repos/psf/requests/issues/882
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/882/labels{/name}
https://api.github.com/repos/psf/requests/issues/882/comments
https://api.github.com/repos/psf/requests/issues/882/events
https://github.com/psf/requests/issues/882
7,391,424
MDU6SXNzdWU3MzkxNDI0
882
Incompatibility with Python 3.1
{ "avatar_url": "https://avatars.githubusercontent.com/u/656294?v=4", "events_url": "https://api.github.com/users/Arfrever/events{/privacy}", "followers_url": "https://api.github.com/users/Arfrever/followers", "following_url": "https://api.github.com/users/Arfrever/following{/other_user}", "gists_url": "https://api.github.com/users/Arfrever/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Arfrever", "id": 656294, "login": "Arfrever", "node_id": "MDQ6VXNlcjY1NjI5NA==", "organizations_url": "https://api.github.com/users/Arfrever/orgs", "received_events_url": "https://api.github.com/users/Arfrever/received_events", "repos_url": "https://api.github.com/users/Arfrever/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Arfrever/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Arfrever/subscriptions", "type": "User", "url": "https://api.github.com/users/Arfrever", "user_view_type": "public" }
[]
closed
true
null
[]
null
23
2012-10-05T22:34:50Z
2021-09-09T05:30:45Z
2012-11-27T10:12:06Z
NONE
resolved
requests/models.py and tests/test_requests.py recently started using callable(), which is not available in Python 3.1. ``` $ python3.1 tests/test_requests.py -v ... ====================================================================== ERROR: test_allow_list_of_hooks_to_register_hook (__main__.RequestsTestSuite) Issue 785: https://github.com/kennethreitz/requests/issues/785 ---------------------------------------------------------------------- Traceback (most recent call last): File "tests/test_requests.py", line 776, in test_allow_list_of_hooks_to_register_hook assert_hooks_are_callable(r.hooks) File "tests/test_requests.py", line 771, in assert_hooks_are_callable assert callable(h) is True NameError: global name 'callable' is not defined ---------------------------------------------------------------------- Ran 76 tests in 64.134s FAILED (errors=1) ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/882/reactions" }
https://api.github.com/repos/psf/requests/issues/882/timeline
null
completed
null
null
false
[ "`callable()` is back starting from Python 3.2 so just move forward :)\n", "Wow, they removed callable?\n", "Yeah, seems they did. This is just ridiculous. Is there a better way to test this? \n", "When callable() does not exist, then you can use `hasattr(x, \"__call__\")` or `isinstance(x, collections.Callable)`. (The second way is better.)\n", "+1 for `collections.Callable`\n", "That's guaranteed across all versions of python that requests supports, right? \n", "You can use:\n\n```\nimport collections\ntry:\n callable = callable\nexcept NameError:\n def callable(x):\n return isinstance(x, collections.Callable)\n```\n", "Meh, it would be easier to just use the isinstance pattern everywhere. \n", "Yeah, I see no need to split.\n", "> I see no need to split.\n\nI don't quite catch what you mean @kennethreitz \n", "@kennethreitz: Do we want to fix this, or just stop claiming that we support Python 3.1, seeing as we don't test on it anyway?\n", "I want to officially support 3.3 and up. Anything else is nice-to-have :)\n", "Right. In that case, I'll run the tests on my box in Python 3.1 and see how much work is required to get them passing again.\n", "There's no way as far as I can tell to make Travis test 3.1 at the moment. http://about.travis-ci.org/docs/user/ci-environment/#Python-versions Also they still don't have support for 3.3 (unless their docs are wildly out of date).\n", "It's undocumented, but exists if you specify it. They are working to remove it though.\n\nWe had a big argument about it this week :)\n", "Well in that case, perhaps removing the guarantee of 3.1 compatibility is the way to go. It would seem @Lukasa nipped this in #955 though, so this should be fixed. @Arfrever care to confirm?\n", "I agree.\n", "I think that the set of supported versions of Python should not be restricted by what is supported by Travis.\n", "@Arfrever there's this from Kenneth:\n\n> I want to officially support 3.3 and up. Anything else is nice-to-have :)\n\nBut the other issue is that automating (regression) tests for python 3.1 is a pain. If someone wants to volunteer a server, they can use any of the GitHub API wrappers to verify the tests work on 3.1 and post as much.\n", "Travis is just a nice excuse to not support it.\n\nI came up with the idea for the unicode literals PEP, actually, and it was for Requests. I have full intentions to use it.\n", "There might be software projects, which use Requests, but do not yet work with Python 3.3, so please do not remove support for Python 3.2.\n\nAFAIK the only feature present in Python 2.6, 2.7 and 3.2, but not in 3.1, is callable(), which can be easily defined for Python 3.1 as shown in comment 9202340.\n", "@Arfrever: Such a project can continue to use Requests 0.14.2 (or whatever version we get to where we finally break 3.2) with no ill effects.\n\nRegarding supported versions, if Travis doesn't test 3.1 for us then we have to assume that anyone raising a PR has not tested on 3.1 either. This requires Kenneth (or another contributor) to patch a copy of Requests with the PR and test it themselves, which is boring and time-inefficient. It's for this reason that bugs like this one crop up in the library: we simply do not have time to catch regressions.\n\nIf I thought supporting 3.1 and 3.2 was a long-term priority I'd try to use a local box to run these tests automatically, but the reality is we're simply going to stop supporting these versions. To be clear, we aren't going to break these _right now_: I'm not going to raise a PR tomorrow that puts unicode literals on every string, for instance. 3.1 and 3.2 will likely continue to function until 1.0, when Kenneth finishes his Transport Adapters stuff.\n\nIn the meantime, the original issue is fixed, so I'm closing it. Thanks for the bug report, please keep them coming! =)\n", "@Lukasa well explained. Thank you.\n" ]
https://api.github.com/repos/psf/requests/issues/881
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/881/labels{/name}
https://api.github.com/repos/psf/requests/issues/881/comments
https://api.github.com/repos/psf/requests/issues/881/events
https://github.com/psf/requests/issues/881
7,366,526
MDU6SXNzdWU3MzY2NTI2
881
squid proxy server says requests.get is "Unsupported Request Method and Protocol"
{ "avatar_url": "https://avatars.githubusercontent.com/u/1609634?v=4", "events_url": "https://api.github.com/users/shoibalc/events{/privacy}", "followers_url": "https://api.github.com/users/shoibalc/followers", "following_url": "https://api.github.com/users/shoibalc/following{/other_user}", "gists_url": "https://api.github.com/users/shoibalc/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/shoibalc", "id": 1609634, "login": "shoibalc", "node_id": "MDQ6VXNlcjE2MDk2MzQ=", "organizations_url": "https://api.github.com/users/shoibalc/orgs", "received_events_url": "https://api.github.com/users/shoibalc/received_events", "repos_url": "https://api.github.com/users/shoibalc/repos", "site_admin": false, "starred_url": "https://api.github.com/users/shoibalc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shoibalc/subscriptions", "type": "User", "url": "https://api.github.com/users/shoibalc", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-10-04T23:59:24Z
2021-09-09T03:00:39Z
2012-10-07T04:03:15Z
NONE
resolved
I am behind a squid proxy server (2.7) with authentication. request.get (version 0.14) is rejected by squid. ``` r = requests.get('https://www.google.com') r.headers {'connection': 'close', 'content-length': '1168', 'content-type': 'text/html', 'date': 'Thu, 04 Oct 2012 23:49:49 GMT', 'server': 'squid/2.7.STABLE7', 'via': '1.0 proxy_server:proxy_port (squid/2.7.STABLE7)', 'x-cache': 'MISS from proxy_server', 'x-cache-lookup': 'NONE from proxy_server:proxy_port', 'x-squid-error': 'ERR_UNSUP_REQ 0'} r.text u'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ERROR: The requested URL could not be retrieved</title> <style type="text/css"><!-- %l body :lang( fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; float: right; } -->< /style> </head><body> <div id="titles"> <h1>ERROR</h1> <h2>The requested URL could not be retrieved</h2> </div> <hr> <div id="content"> <p>The following error was encountered while trying to retrieve the URL: <a href="https://www.google.com/">https://www.google.com/</a></p> < blockquote id="error"> <p><b>Unsupported Request Method and Protocol</b></p> </blockquote> <p>Squid does not support all request methods for all access protocols. For example, you can not POST a Gopher request.</p> <p>Your cache administrator is <a href="mailto:webmaster%W"> webmaster</a>.</p> <br> </div> <hr> <div id="footer"> <p>Generated 05/Oct/2012:05:19:49 +0530 by proxy_server (squid/2.7.STABLE7)</p> <!-- ERR_UNSUP_REQ --> </div> </body></html> \n' ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/881/reactions" }
https://api.github.com/repos/psf/requests/issues/881/timeline
null
completed
null
null
false
[ "That's.... bizzare.\n\nI hate proxies :)\n", "501 error? Any idea what the issue is? Has anybody else faced something like this. \n", "My bad! Solved.\n\n```\nproxies = { \"http\": \"proxy_server:proxy_port\"}\nr = requests.get('https://www.google.com',proxies=proxies)\n```\n", "@shoibalc I thought I saw an email about you mentioning that 'http_proxy' was the more widely used environment variable... am I hallucinating?\n", "excellent :)\n", "Just for future reference, this pops up on PythonAnywhere as well but for HTTPS proxies for which this workaround does not seem to work.\n", "I still get this with requests 1.2... is there a special patch I need?\n\nHere's a post I submitted to https://github.com/mikeal/request/issues/552\n\nI know I've seen lots of stack overflow questions about this. I cannot seem to figure out which version of python and which version of requests are needed to get this simple test working:\n\n``` python\nimport requests.packages.urllib3 as urllib3\nimport unittest\n\nclass TestProxyConnect(unittest.TestCase):\n def setUp(self):\n self.proxy_url='http://192.168.201.138:3128/'\n self.https_url='https://www.google.com/index.html'\n def test_connect(self):\n proxy=urllib3.proxy_from_url(self.proxy_url)\n res=proxy.urlopen('GET', self.https_url)\n self.assertEqual(res.status, 200)\n\nif __name__ == '__main__':\n unittest.main()\n```\n\n```\nF\n======================================================================\nFAIL: test_connect (__main__.TestProxyConnect)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"/root/test.py\", line 11, in test_connect\n self.assertEqual(res.status, 200)\nAssertionError: 501 != 200\n```\n\nIt's just trying to use squid. I know this is more urllib3, but I am using the urllib3 that is in the requests 'packages' folder.\n\n(venv)[root@cb-server-test urllib3]# pip freeze\nrequests==1.2.0\nwsgiref==0.1.2\n\nCan anyone help me figure out how to get HTTPS requests over HTTP to use CONNECT?\n\nThanks,\nBen\n", "HTTPS requests over HTTP currently cannot use CONNECT. For a fuller explanation, see #1359.\n" ]
https://api.github.com/repos/psf/requests/issues/880
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/880/labels{/name}
https://api.github.com/repos/psf/requests/issues/880/comments
https://api.github.com/repos/psf/requests/issues/880/events
https://github.com/psf/requests/issues/880
7,339,527
MDU6SXNzdWU3MzM5NTI3
880
SSL validation doesn't consider subjectAltName
{ "avatar_url": "https://avatars.githubusercontent.com/u/565197?v=4", "events_url": "https://api.github.com/users/mitchwalker1979/events{/privacy}", "followers_url": "https://api.github.com/users/mitchwalker1979/followers", "following_url": "https://api.github.com/users/mitchwalker1979/following{/other_user}", "gists_url": "https://api.github.com/users/mitchwalker1979/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/mitchwalker1979", "id": 565197, "login": "mitchwalker1979", "node_id": "MDQ6VXNlcjU2NTE5Nw==", "organizations_url": "https://api.github.com/users/mitchwalker1979/orgs", "received_events_url": "https://api.github.com/users/mitchwalker1979/received_events", "repos_url": "https://api.github.com/users/mitchwalker1979/repos", "site_admin": false, "starred_url": "https://api.github.com/users/mitchwalker1979/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mitchwalker1979/subscriptions", "type": "User", "url": "https://api.github.com/users/mitchwalker1979", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-04T01:13:54Z
2021-09-09T05:30:54Z
2012-11-16T23:55:12Z
NONE
resolved
When performing SSL certificate validation, requests raises an SSLError when the domain name from the URL and the Subject CN don't match. Many recent SSL client implementations (including major browsers) now respect the subjectAltName extension, and consider a certificate valid if that matches, despite a mismatching CN. Support for this would be greatly appreciated.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/880/reactions" }
https://api.github.com/repos/psf/requests/issues/880/timeline
null
completed
null
null
false
[ "`requests` doesn't handle SSL authentication on its own, [`urllib3`](https://github.com/shazow/urllib3) handles it on our behalf. Thanks for the suggestion!\n" ]
https://api.github.com/repos/psf/requests/issues/879
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/879/labels{/name}
https://api.github.com/repos/psf/requests/issues/879/comments
https://api.github.com/repos/psf/requests/issues/879/events
https://github.com/psf/requests/issues/879
7,306,804
MDU6SXNzdWU3MzA2ODA0
879
Issues with HTTP proxy and accessing localhost - does requests ignore no_proxy?
{ "avatar_url": "https://avatars.githubusercontent.com/u/243499?v=4", "events_url": "https://api.github.com/users/victorhooi/events{/privacy}", "followers_url": "https://api.github.com/users/victorhooi/followers", "following_url": "https://api.github.com/users/victorhooi/following{/other_user}", "gists_url": "https://api.github.com/users/victorhooi/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/victorhooi", "id": 243499, "login": "victorhooi", "node_id": "MDQ6VXNlcjI0MzQ5OQ==", "organizations_url": "https://api.github.com/users/victorhooi/orgs", "received_events_url": "https://api.github.com/users/victorhooi/received_events", "repos_url": "https://api.github.com/users/victorhooi/repos", "site_admin": false, "starred_url": "https://api.github.com/users/victorhooi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/victorhooi/subscriptions", "type": "User", "url": "https://api.github.com/users/victorhooi", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2012-10-02T21:42:44Z
2018-09-01T22:35:15Z
2012-11-23T10:06:54Z
NONE
resolved
Hi, I have a Django app, exposing a REST API using TastyPie. I have it running locally using Django's runserver, and I'm trying to access it using Requests. For some reason though, accessing it with Curl or Firefox works fine: ``` curl "http://localhost:8000/api/v1/host/?name__regex=&amp;format=json" ``` And on the Django runserver console, I see: ``` [02/Oct/2012 17:24:20] "GET /api/v1/host/?name__regex=&amp;format=json HTTP/1.1" 200 2845 ``` However, when I try to use the Python requests module (http://docs.python-requests.org/en/latest/), I get a 404: ``` >>> r = requests.get('http://localhost:8000/api/v1/host/?name__regex=&format=json') >>> r <Response [404]> ``` or: ``` >>> r = requests.get('http://localhost:8000/api/v1/host/?name__regex=&amp;format=json') >>> r <Response [404]> ``` or: ``` >>> payload = { 'format': 'json'} >>> r = requests.get('http://localhost:8000/api/v1', params=payload) >>> r <Response [404]> >>> r.url u'http://localhost:8000/api/v1?format=json' ``` Also, on the Django runserver console, I see: ``` [02/Oct/2012 17:25:01] "GET http://localhost:8000/api/v1/host/?name__regex=&format=json HTTP/1.1" 404 161072 ``` Notice that runserver prints the whole path in this case, rather than just the part after localhost:8000 - not sure why that is. We have a HTTP proxy setup in this environment (Microsoft ISA, I believe), which uses authentication (I've put the username/password in the variable itself). I've set the `no_proxy` environment variable and put localhost and 127.0.0.1 in there. However, requests seems to still be doing something funky with the proxy. If I actually unset `http_proxy` - requests works fine: ``` $ unset http_proxy $ python Python 2.7.3 (default, Sep 7 2012, 12:28:31) [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import requests >>> hostname = '' >>> r = requests.get('http://localhost:8000/api/v1/host/?name__regex={}&format=json'.format(hostname)) >>> r <Response [200]> ``` So firstly, I'm curious why requests doesn't work with the proxy variable set? And secondly, is there any any way to get it to respect `no_proxy`? Cheers, Victor
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/879/reactions" }
https://api.github.com/repos/psf/requests/issues/879/timeline
null
completed
null
null
false
[ "I have a similar problem where I just want to disable the proxy for certain requests (connecting to internal WebServices that are not available outside our DMZ). After digging through the requests code to find out how proxies are handled and how proxy configuration is loaded I have come up with a work-around to disable the proxy when needed:\n\n```\nNO_PROXY = {\n 'no': 'pass',\n}\n\nr = requests.get(uri, proxies=NO_PROXY)\n```\n\nHow this works, if the _proxies_ parameter is passed to the get (or other http method) it is has any empty entries removed before checking if there are any values still in the dictionary. If the dictionary is empty then the variables are loaded from the environment using the method _requests.utils.get_environ_proxies_. By including a value in the 'no' key then the proxies parameter is used which includes empty _http_ and _https_ entries thereby disabling the proxy. The method is a bit hacky but does solve the issue.\n", "By default, `requests` trusts any environment variables the system has in place, and assumes you want to use them (which is usually the default behaviour of UNIXy programs). You can disable this behaviour either by using @timsavage's method (which is clever, nice workaround), or by setting the `trust_env` config value to `False`, like so:\n\n``` python\nr = requests.get('http://www.google.com', config={'trust_env': False})\ns = requests.Session(config={'trust_env': False})\n```\n\nYou can see everything you can change with the config dictionary [here](http://docs.python-requests.org/en/latest/api/#configurations).\n\nHope that helps!\n", "heya,\n\nHmm, yes, but by the same logic, wouldn't `requests` also trust the `NO_PROXY` environment variable as well?\n\nThis is meant to be a list of specific hosts for which we don't use the proxy - and it's supported by most *nix HTTP clients, as far as I'm aware\n- wget (http://www.editcorp.com/Personal/Lars_Appel/wget/wget_8.html)\n- lynx (http://lynx.isc.org/release/lynx2-8-6/lynx_help/keystrokes/environments.html)\n- chef (http://wiki.opscode.com/display/chef/Chef+Configuration+Settings)\n\njust to pick a few random ones.\n\nI don't think it's a case of not trusting the http_proxy variable, but more just having support for the no_proxy variable as well?\n\nCheers,\nVictor\n", "Ah, good point well made. I have genuinely never seen the NO_PROXY variable used, so didn't even know about it. In that case, we should probably endeavour to respect it. =)\n", "Oh, this is interesting! We do actually check for `NO_PROXY`, but we treat it like a standard proxy prefix, like `HTTP_PROXY` and `FTP_PROXY`. Put another way: we do totally the wrong thing with it. =D\n", "> just to pick a few random ones.\n\nIn every list of command line http clients there must be curl even if it's a random list :)\n", "Resolved by #945 (hopefully). Next minor release of Requests should have the fix in it. Please let me know if this turns out not to have fixed it for you.\n", "Hi @Lukasa , I was having this issue with Requests 1.2. After reading this thread, I thought it will go away on upgrading to 2.0.1 (which contains your fix). However, it did not fix it for me. \nThe only way I got around it was to add the following code: \n\n```\nimport os\nos.environ['no_proxy'] = '127.0.0.1,localhost'\n```\n", "@tanmay9 How are you setting the environment variable in question?\n", "Neither of these appear to work for me.\n\n@timsavage's method does nothing at all and the config= trick results in:\n\nTypeError: request() got an unexpected keyword argument 'config'\n\nThis is python 3.4.0 and requests 2.2.1.\n\nI had to resort to @tanmay9's method of setting the no_http environmental.\n\nJust FYI.\n", "Has this been resolved yet? Requests does not appear to respect the `NO_PROXY` environment variable currently (at least on Windows).", "Hi @natejgardner, this issue is over 3 years old and we’ve added support for portions of NO_PROXY since then. There are still a few quirks that won’t be addressed due to backwards incompatibility until the next major version of Requests, but the basic functionality works.\r\n\r\nIf you’ve found a specific defect, please open a new issue. Thanks!" ]
https://api.github.com/repos/psf/requests/issues/878
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/878/labels{/name}
https://api.github.com/repos/psf/requests/issues/878/comments
https://api.github.com/repos/psf/requests/issues/878/events
https://github.com/psf/requests/pull/878
7,294,727
MDExOlB1bGxSZXF1ZXN0MjUxNTUwNw==
878
miss the encoding declaration
{ "avatar_url": "https://avatars.githubusercontent.com/u/108762?v=4", "events_url": "https://api.github.com/users/tokuda109/events{/privacy}", "followers_url": "https://api.github.com/users/tokuda109/followers", "following_url": "https://api.github.com/users/tokuda109/following{/other_user}", "gists_url": "https://api.github.com/users/tokuda109/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/tokuda109", "id": 108762, "login": "tokuda109", "node_id": "MDQ6VXNlcjEwODc2Mg==", "organizations_url": "https://api.github.com/users/tokuda109/orgs", "received_events_url": "https://api.github.com/users/tokuda109/received_events", "repos_url": "https://api.github.com/users/tokuda109/repos", "site_admin": false, "starred_url": "https://api.github.com/users/tokuda109/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tokuda109/subscriptions", "type": "User", "url": "https://api.github.com/users/tokuda109", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-02T14:37:38Z
2021-09-08T23:01:07Z
2012-10-02T15:25:16Z
CONTRIBUTOR
resolved
Build error occurs when I translate this documentation.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/878/reactions" }
https://api.github.com/repos/psf/requests/issues/878/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/878.diff", "html_url": "https://github.com/psf/requests/pull/878", "merged_at": "2012-10-02T15:25:16Z", "patch_url": "https://github.com/psf/requests/pull/878.patch", "url": "https://api.github.com/repos/psf/requests/pulls/878" }
true
[ "thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/877
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/877/labels{/name}
https://api.github.com/repos/psf/requests/issues/877/comments
https://api.github.com/repos/psf/requests/issues/877/events
https://github.com/psf/requests/pull/877
7,278,762
MDExOlB1bGxSZXF1ZXN0MjUwODY5Nw==
877
Add function for clearing cookies from a session
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
false
null
[]
null
4
2012-10-01T22:51:12Z
2014-07-20T01:34:51Z
2012-10-02T00:05:42Z
NONE
null
Don't know if this is worth it, but it helps me on a project I'm working on. It's a little nicer than handling the cookie object directly.
null
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/877/reactions" }
https://api.github.com/repos/psf/requests/issues/877/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/877.diff", "html_url": "https://github.com/psf/requests/pull/877", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/877.patch", "url": "https://api.github.com/repos/psf/requests/pulls/877" }
true
[ "Hmm, I wonder if we can subclass CookieJar and add a `purge` method.\n", "I forget if we're using the standard cookielib, but if so: http://docs.python.org/library/cookielib.html#cookielib.CookieJar.clear\n", "Perfection.\n", "Oh wow, that does it much better. This is unneeded.\nThanks.\n" ]
https://api.github.com/repos/psf/requests/issues/876
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/876/labels{/name}
https://api.github.com/repos/psf/requests/issues/876/comments
https://api.github.com/repos/psf/requests/issues/876/events
https://github.com/psf/requests/pull/876
7,269,751
MDExOlB1bGxSZXF1ZXN0MjUwNDEyMA==
876
Only register callable items in lists
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-10-01T17:13:58Z
2021-09-08T17:05:51Z
2012-10-01T18:15:48Z
CONTRIBUTOR
resolved
Prior to this, you could sneak a list of anything to register_hook and it would accept it. This will check if the items in the list are callable before registering them. Also added a regression test to make sure if this gets changed it will be noticed.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/876/reactions" }
https://api.github.com/repos/psf/requests/issues/876/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/876.diff", "html_url": "https://github.com/psf/requests/pull/876", "merged_at": "2012-10-01T18:15:48Z", "patch_url": "https://github.com/psf/requests/pull/876.patch", "url": "https://api.github.com/repos/psf/requests/pulls/876" }
true
[ "Rebased to avoid any problems with merging.\n", "Looks great! Waiting for travis...\n", "Seems Travis likes it too.\n", "Thanks!\n", "No problem. Should have been written this way in the first place.\n" ]
https://api.github.com/repos/psf/requests/issues/875
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/875/labels{/name}
https://api.github.com/repos/psf/requests/issues/875/comments
https://api.github.com/repos/psf/requests/issues/875/events
https://github.com/psf/requests/issues/875
7,268,544
MDU6SXNzdWU3MjY4NTQ0
875
Keep-alive doesn't work over http proxy
{ "avatar_url": "https://avatars.githubusercontent.com/u/1771332?v=4", "events_url": "https://api.github.com/users/vlaci/events{/privacy}", "followers_url": "https://api.github.com/users/vlaci/followers", "following_url": "https://api.github.com/users/vlaci/following{/other_user}", "gists_url": "https://api.github.com/users/vlaci/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/vlaci", "id": 1771332, "login": "vlaci", "node_id": "MDQ6VXNlcjE3NzEzMzI=", "organizations_url": "https://api.github.com/users/vlaci/orgs", "received_events_url": "https://api.github.com/users/vlaci/received_events", "repos_url": "https://api.github.com/users/vlaci/repos", "site_admin": false, "starred_url": "https://api.github.com/users/vlaci/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vlaci/subscriptions", "type": "User", "url": "https://api.github.com/users/vlaci", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
11
2012-10-01T16:28:39Z
2021-09-09T05:29:54Z
2012-12-03T10:09:18Z
CONTRIBUTOR
resolved
Although, requests sends a `Proxy-Connection: keep-alive` header, it forcibly closes the connection after each requests. I tracked down the issue's origin to models.py, how the connection is acquired: ``` python if proxy and not any(map(_p.hostname.endswith, no_proxy)): conn = poolmanager.proxy_from_url(proxy) ``` vs ``` python if self.config.get('keep_alive'): conn = self._poolmanager.connection_from_url(url) else: conn = connectionpool.connection_from_url(url) ``` In the proxy case, a poolmanager is instantiated in every request, while without proxy the given `self._poolmanager` instance is reused. I have a workaround for the issue via using `poolmanager.ProxyManager(self._poolmanager.connection_from_url(proxy))` call instead of `poolmanager.proxy_from_url(proxy)` if keep_alive is configured. If you find my solution adequate, I prepare a patch for the issue in the upcoming days.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/875/reactions" }
https://api.github.com/repos/psf/requests/issues/875/timeline
null
completed
null
null
false
[ "I just ran into this limitation myself, and came here to see whether I needed to open a ticket with this information! I strongly support your proposed patch.\n", "@Lukasa @shazow @kennethreitz opinions on this? It seems reasonable to me, but I'm not as familiar with urllib3 honestly.\n", "+1 to the issue. The connection should definitely remain open across proxy requests. That's one of the most significant benefits of proxies--one connection for many requests across many hosts. :)\n", "Any opinions on the proposed patch?\n", "I can't think of a reason why you'd ever want new-connection-per-proxy-request, so I'd make keeping the same proxy connection the default behaviour.\n", "So to flesh out @vlaci's proposed patch:\n\n``` python\nif proxy and not any(map(_p.hostname.endswith, no_proxy)):\n if self.config.get('keep_alive'):\n conn = poolmanager.ProxyManager(self._poolmanager.connection_from_url(proxy))\n else:\n conn = poolmanager.proxy_from_url(proxy)\n```\n\nshould be feasible? I don't have a proxy to test against.\n\n@vlaci if I'm misspeaking please pipe up. It'd even be awesome if you submitted the Pull Request to fix this.\n", "My proposed solution works fine in our test system for a month. I'll make a pull request at the weekend then.\n", "@vlaci awesome. Thanks for finding, reporting and fixing this.\n", "Resolved by #982.\n", "Issue reappeared in recent requests versions (tried with 1.1)\n", "Related code in adapters.py:\n\n``` python\n def get_connection(self, url, proxies=None):\n \"\"\"Returns a connection for the given URL.\"\"\"\n proxies = proxies or {}\n proxy = proxies.get(urlparse(url).scheme)\n\n if proxy:\n proxy = prepend_scheme_if_needed(proxy, urlparse(url).scheme)\n conn = proxy_from_url(proxy)\n else:\n conn = self.poolmanager.connection_from_url(url)\n\n return conn\n```\n" ]
https://api.github.com/repos/psf/requests/issues/874
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/874/labels{/name}
https://api.github.com/repos/psf/requests/issues/874/comments
https://api.github.com/repos/psf/requests/issues/874/events
https://github.com/psf/requests/issues/874
7,257,903
MDU6SXNzdWU3MjU3OTAz
874
Support for request body streaming
{ "avatar_url": "https://avatars.githubusercontent.com/u/65913?v=4", "events_url": "https://api.github.com/users/rbu/events{/privacy}", "followers_url": "https://api.github.com/users/rbu/followers", "following_url": "https://api.github.com/users/rbu/following{/other_user}", "gists_url": "https://api.github.com/users/rbu/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/rbu", "id": 65913, "login": "rbu", "node_id": "MDQ6VXNlcjY1OTEz", "organizations_url": "https://api.github.com/users/rbu/orgs", "received_events_url": "https://api.github.com/users/rbu/received_events", "repos_url": "https://api.github.com/users/rbu/repos", "site_admin": false, "starred_url": "https://api.github.com/users/rbu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rbu/subscriptions", "type": "User", "url": "https://api.github.com/users/rbu", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-10-01T11:26:44Z
2021-09-09T06:00:41Z
2012-10-01T16:52:11Z
NONE
resolved
Sending a request with a large request body (i.e. a large file that is being multipart-encoded) will consume a large amount of memory. It would be very helpful if it were possible to specify a file-like object (and the content-length separately) and request as well as its helper libraries read only the chunks that are needed to continue sending the request. This may be related to https://github.com/shazow/urllib3/issues/51
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/874/reactions" }
https://api.github.com/repos/psf/requests/issues/874/timeline
null
completed
null
null
false
[ "The plan is to support generators. Work in progress :)\n", "Thanks for letting me know. Just to confirm, did you close the ticket because you're not tracking features as issues or you're currently working on it? Is it appropriate to raise new features as issues in the future?\n", "Oh, I should have mentioned #295 :)\n" ]
https://api.github.com/repos/psf/requests/issues/873
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/873/labels{/name}
https://api.github.com/repos/psf/requests/issues/873/comments
https://api.github.com/repos/psf/requests/issues/873/events
https://github.com/psf/requests/pull/873
7,250,543
MDExOlB1bGxSZXF1ZXN0MjQ5NjkwMw==
873
Use __iter__ rather than the inefficient nested for loops
{ "avatar_url": "https://avatars.githubusercontent.com/u/81392?v=4", "events_url": "https://api.github.com/users/legoktm/events{/privacy}", "followers_url": "https://api.github.com/users/legoktm/followers", "following_url": "https://api.github.com/users/legoktm/following{/other_user}", "gists_url": "https://api.github.com/users/legoktm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/legoktm", "id": 81392, "login": "legoktm", "node_id": "MDQ6VXNlcjgxMzky", "organizations_url": "https://api.github.com/users/legoktm/orgs", "received_events_url": "https://api.github.com/users/legoktm/received_events", "repos_url": "https://api.github.com/users/legoktm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/legoktm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/legoktm/subscriptions", "type": "User", "url": "https://api.github.com/users/legoktm", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-10-01T00:26:06Z
2021-09-08T17:05:50Z
2012-10-01T16:52:32Z
CONTRIBUTOR
resolved
Since you can iterate over a cookiejar, this is simpler and more efficient than using nested for loops.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/873/reactions" }
https://api.github.com/repos/psf/requests/issues/873/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/873.diff", "html_url": "https://github.com/psf/requests/pull/873", "merged_at": "2012-10-01T16:52:32Z", "patch_url": "https://github.com/psf/requests/pull/873.patch", "url": "https://api.github.com/repos/psf/requests/pulls/873" }
true
[ "+1\n" ]
https://api.github.com/repos/psf/requests/issues/872
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/872/labels{/name}
https://api.github.com/repos/psf/requests/issues/872/comments
https://api.github.com/repos/psf/requests/issues/872/events
https://github.com/psf/requests/issues/872
7,241,639
MDU6SXNzdWU3MjQxNjM5
872
Trouble posting some json
{ "avatar_url": "https://avatars.githubusercontent.com/u/282578?v=4", "events_url": "https://api.github.com/users/bimargulies/events{/privacy}", "followers_url": "https://api.github.com/users/bimargulies/followers", "following_url": "https://api.github.com/users/bimargulies/following{/other_user}", "gists_url": "https://api.github.com/users/bimargulies/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bimargulies", "id": 282578, "login": "bimargulies", "node_id": "MDQ6VXNlcjI4MjU3OA==", "organizations_url": "https://api.github.com/users/bimargulies/orgs", "received_events_url": "https://api.github.com/users/bimargulies/received_events", "repos_url": "https://api.github.com/users/bimargulies/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bimargulies/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bimargulies/subscriptions", "type": "User", "url": "https://api.github.com/users/bimargulies", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-09-29T22:51:59Z
2021-09-09T06:00:41Z
2012-09-30T01:43:25Z
NONE
resolved
``` headers = {'content-type': 'application/json', 'accept' : 'application/json' } my_config = {'verbose': sys.stderr} return requests.post(url + '/doc/processText', data=PlainTextInputOptionsEncoder().encode(request), headers=headers, config=my_config) ``` The above is rewarded with a 500 from the tomcat hosting the service. The json looks OK when I dump it out with 'print'. Is there something I'm missing?
{ "avatar_url": "https://avatars.githubusercontent.com/u/282578?v=4", "events_url": "https://api.github.com/users/bimargulies/events{/privacy}", "followers_url": "https://api.github.com/users/bimargulies/followers", "following_url": "https://api.github.com/users/bimargulies/following{/other_user}", "gists_url": "https://api.github.com/users/bimargulies/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bimargulies", "id": 282578, "login": "bimargulies", "node_id": "MDQ6VXNlcjI4MjU3OA==", "organizations_url": "https://api.github.com/users/bimargulies/orgs", "received_events_url": "https://api.github.com/users/bimargulies/received_events", "repos_url": "https://api.github.com/users/bimargulies/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bimargulies/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bimargulies/subscriptions", "type": "User", "url": "https://api.github.com/users/bimargulies", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/872/reactions" }
https://api.github.com/repos/psf/requests/issues/872/timeline
null
completed
null
null
false
[]
https://api.github.com/repos/psf/requests/issues/871
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/871/labels{/name}
https://api.github.com/repos/psf/requests/issues/871/comments
https://api.github.com/repos/psf/requests/issues/871/events
https://github.com/psf/requests/pull/871
7,241,509
MDExOlB1bGxSZXF1ZXN0MjQ5NDA1NQ==
871
Python 3.3 compatible update
{ "avatar_url": "https://avatars.githubusercontent.com/u/146133?v=4", "events_url": "https://api.github.com/users/yegle/events{/privacy}", "followers_url": "https://api.github.com/users/yegle/followers", "following_url": "https://api.github.com/users/yegle/following{/other_user}", "gists_url": "https://api.github.com/users/yegle/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yegle", "id": 146133, "login": "yegle", "node_id": "MDQ6VXNlcjE0NjEzMw==", "organizations_url": "https://api.github.com/users/yegle/orgs", "received_events_url": "https://api.github.com/users/yegle/received_events", "repos_url": "https://api.github.com/users/yegle/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yegle/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yegle/subscriptions", "type": "User", "url": "https://api.github.com/users/yegle", "user_view_type": "public" }
[]
closed
true
null
[]
null
9
2012-09-29T22:36:24Z
2021-09-08T23:05:06Z
2012-10-01T17:26:59Z
CONTRIBUTOR
resolved
`httplib.cookiejar.DefaultCookiePolicy` changed its implementation of function `set_ok_verifiability` in Python 3.3 It now checks `request.unverifiable` instead of `request.is_unverifiable()`
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/871/reactions" }
https://api.github.com/repos/psf/requests/issues/871/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/871.diff", "html_url": "https://github.com/psf/requests/pull/871", "merged_at": "2012-10-01T17:26:59Z", "patch_url": "https://github.com/psf/requests/pull/871.patch", "url": "https://api.github.com/repos/psf/requests/pulls/871" }
true
[ "Traceback without my modification:\nhttp://pastie.org/4867827\n", "@piotr-dobrogost I was thinking the same thing.\n", "Well I think this modification has the least code change. Adding an `unverifiable` property may needs more code change. But anyway it's just a proposal to fix this problem.\n", "From what I can see the code change using a property would be something like this (although I probably would include a docstring if doing this for real). Looks about the same IMO.\n\n``` Python\n@property\ndef unverifiable(self):\n return self.is_unverifiable()\n```\n", "+1 for a property as opposed to changing `__getattr__`.\n", "+1\n", "property decorator is clearly a better solution.\n", "@yegle care to update?\n", "I've updated this pull request :-)\n" ]
https://api.github.com/repos/psf/requests/issues/870
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/870/labels{/name}
https://api.github.com/repos/psf/requests/issues/870/comments
https://api.github.com/repos/psf/requests/issues/870/events
https://github.com/psf/requests/issues/870
7,168,440
MDU6SXNzdWU3MTY4NDQw
870
Session API doc doesn't mention attributes
{ "avatar_url": "https://avatars.githubusercontent.com/u/219470?v=4", "events_url": "https://api.github.com/users/benjaminp/events{/privacy}", "followers_url": "https://api.github.com/users/benjaminp/followers", "following_url": "https://api.github.com/users/benjaminp/following{/other_user}", "gists_url": "https://api.github.com/users/benjaminp/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/benjaminp", "id": 219470, "login": "benjaminp", "node_id": "MDQ6VXNlcjIxOTQ3MA==", "organizations_url": "https://api.github.com/users/benjaminp/orgs", "received_events_url": "https://api.github.com/users/benjaminp/received_events", "repos_url": "https://api.github.com/users/benjaminp/repos", "site_admin": false, "starred_url": "https://api.github.com/users/benjaminp/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/benjaminp/subscriptions", "type": "User", "url": "https://api.github.com/users/benjaminp", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-27T00:39:27Z
2021-09-09T05:30:52Z
2012-11-17T11:21:39Z
CONTRIBUTOR
resolved
The API docs for `Session` don't mention that it has useful attributes like `cookies`, which can be used to mutate its state.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/870/reactions" }
https://api.github.com/repos/psf/requests/issues/870/timeline
null
completed
null
null
false
[ ":+1:\n", "+1\n" ]
https://api.github.com/repos/psf/requests/issues/869
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/869/labels{/name}
https://api.github.com/repos/psf/requests/issues/869/comments
https://api.github.com/repos/psf/requests/issues/869/events
https://github.com/psf/requests/issues/869
7,162,078
MDU6SXNzdWU3MTYyMDc4
869
Installing Requests with PIP 1.2.1 and Python 3.1 encounters errors
{ "avatar_url": "https://avatars.githubusercontent.com/u/1351003?v=4", "events_url": "https://api.github.com/users/amckinlay/events{/privacy}", "followers_url": "https://api.github.com/users/amckinlay/followers", "following_url": "https://api.github.com/users/amckinlay/following{/other_user}", "gists_url": "https://api.github.com/users/amckinlay/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/amckinlay", "id": 1351003, "login": "amckinlay", "node_id": "MDQ6VXNlcjEzNTEwMDM=", "organizations_url": "https://api.github.com/users/amckinlay/orgs", "received_events_url": "https://api.github.com/users/amckinlay/received_events", "repos_url": "https://api.github.com/users/amckinlay/repos", "site_admin": false, "starred_url": "https://api.github.com/users/amckinlay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/amckinlay/subscriptions", "type": "User", "url": "https://api.github.com/users/amckinlay", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-09-26T20:43:46Z
2021-09-09T05:30:59Z
2012-10-27T15:18:50Z
NONE
resolved
Requests still installs, but setup.py seems to be running Python 2 code? https://gist.github.com/3790404
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/869/reactions" }
https://api.github.com/repos/psf/requests/issues/869/timeline
null
completed
null
null
false
[ "Those are all just warnings. Requests vendorizes a package called chardet which is specifically for python2. It doesn't break python3, but it gives those horrible and ugly warnings that you saw. A package maintainer complained about the same thing (#832). #858 is also related but only in that @craigholm was hoping to find a way to conditionally import/install chardet.\n", "The errors are benign, but they sure look like a problem. Unfortunately everyone who installs requests under Python 3.x will waste time researching this, until the find out it's not a problem.\n\nIt would be great if a solution could be found, but from the comments above it seems complex.\n", "It is complex :)\n" ]
https://api.github.com/repos/psf/requests/issues/868
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/868/labels{/name}
https://api.github.com/repos/psf/requests/issues/868/comments
https://api.github.com/repos/psf/requests/issues/868/events
https://github.com/psf/requests/issues/868
7,159,517
MDU6SXNzdWU3MTU5NTE3
868
Replacing usage of isinstance in requests
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
20
2012-09-26T19:18:24Z
2021-09-09T05:31:02Z
2012-10-01T16:55:53Z
CONTRIBUTOR
resolved
https://github.com/sigmavirus24/requests/commit/4dd3d1a1a2534f2996a368ebe26114bf974e15f9#commitcomment-1904600 For reference, I'm going to copy the comments into here. --- @piotr-dobrogost Explicit type checking is code smell. We should be checking for iterability not types. See http://stackoverflow.com/questions/1952464/ --- @sigmavirus24 I was following the style of the rest of requests, if wanted I'll clean up this and the other places I saw it. --- @piotr-dobrogost @kennethreitz What do you think? --- @kennethreitz iterability is always preferred, but not always possible in requests because of the way certain types work (strings, dicts) --- @sigmavirus24 @kennethreitz correct me if I'm wrong, but I believe you're against this. And if I remember correctly I had submitted an earlier PR that tried to do something similar to what @piotr-dobrogost is suggesting in `_encode_data` which failed when passed a dictionary. For reference in python 2 and 3, the following works ``` >>> a = [1, 2, 3] >>> b = {4: 5} >>> a.extend(b) # a == [1, 2, 3, 4] ``` Which may not be entirely obvious to some and certainly might seem like unintended behavior. Likewise, ``` >>> a = [1, 2, 3] >>> a.extend('abcdef') # a == [1, 2, 3, 'a', 'b', 'c', 'd', 'e', 'f'] ``` We could always do the complement though (which is far less obvious): ``` if hasattr(hook, '__iter__') and not isinstance(hook, (str, dict)): # ... ``` --- @piotr-dobrogost All we should care here is that we want iterable. It's up to the user to pass iterable he thinks is appropriate. If someone wants to pass "random" iterable then it's not our business to know better and reject it. Yes, there is more type checking in the Requests and I think it should be cleaned as well. --- @piotr-dobrogost @shazow What's your opinion? --- @shazow I would vote for making an is_foo helper somewhere nearby which contains the "is iter and not str/dict" logic or whatever we want it to be. Then re-use that where appropriate. Also name foo something descriptive. is_plural? As for the logic, I'd be +0 on {iter and not str/dict}. I imagine people may want to pass in arbitrary generators and whatnot. --- @sigmavirus24 I think @piotr-dobrogost would just rather the logic `hasattr(foo, '__iter__')` rather than excluding `str`s and `dict`s. --- @shazow In the context of hooks, shouldn't the check just be if it's callable? If not, then extend? (My previous suggestion was more towards the general style of Requests, rather than this hook-specific example.) --- @sigmavirus24 Right, I was following the general style of requests when writing this. But yeah, you're right, if it's callable then it should be append otherwise we should try to extend it. --- @shazow Further: Shouldn't the logic for register_hook and deregister_hook live in the same place as dispatch_hook? If that was the case, then the {check for `__call__` or extend} decision would be very evident. :) --- @piotr-dobrogost Just in case I asked this http://stackoverflow.com/questions/12590494/. > In the context of hooks, shouldn't the check just be if it's callable? If not, then extend? Either we check all for callability or none. Why should the first one be better than the rest? :) --- @sigmavirus24 So you just want something like: ``` python if callable(hook): self.hooks[event].append(hook) else: self.hooks[event].extend(hook) ``` ? How about a compromise on: ``` python if callable(hook): self.hooks[event].append(hook) elif hasattr(hook, '__iter__'): self.hooks[event].extend(hook) ``` Because calling it with None would cause some issues. If you would rather check that each element of the iterable is callable then simply: ``` python if callable(hook): self.hooks[event].append(hook) elif hasattr(hook, '__iter__'): for h in hook: self.register_hook(event, h) ``` That will take care of checking for callability and allow for lists, tuples, sets, etc to be passed. --- @sigmavirus24 @piotr-dobrogost, @shazow, @kennethreitz, does anyone mind if we take this to an issue instead of continuing to discuss everything here? An issue would make this more visible to future contributors/users/etc. of requests than it is here. --- @piotr-dobrogost +1 > That will take care of checking for callability and allow for lists, tuples, sets, etc to be passed. Not only this, this will allow for nested iterables (trees) to be passed as well! :) --- Well that was painful, I'm all up for fixing this in particular and going through the rest of requests to see if we can get rid of some of these explicit checks unless anyone disagrees.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/868/reactions" }
https://api.github.com/repos/psf/requests/issues/868/timeline
null
completed
null
null
false
[ "> Well that was painful\n\n@sigmavirus24 What do you mean? Btw, thanks for creating this issue.\n", "It was painful copying over the comments is all I meant. And no problem. Thanks for bringing up the entirely valid point of the issue. You also likely caught a bug in my logic for registering hooks that I overlooked because I felt bad for delaying the progress of that issue.\n", "So this is what I get looking for usage of `isinstance` in requests.\n\n```\n$ grep -n 'isinstance(' requests/*.py\nrequests/auth.py:167: if isinstance(x, str):\nrequests/auth.py:173: if isinstance(x, str):\nrequests/cookies.py:169: if isinstance(value, Morsel):\nrequests/models.py:135: if isinstance(cookies, cookielib.CookieJar):\nrequests/models.py:221: if isinstance(self.full_url, bytes):\nrequests/models.py:329: if isinstance(data, (str, bytes)):\nrequests/models.py:336: for v in isinstance(vs, list) and vs or [vs]:\nrequests/models.py:339: (k.encode('utf-8') if isinstance(k, str) else k,\nrequests/models.py:340: v.encode('utf-8') if isinstance(v, str) else v))\nrequests/models.py:353: if (not files) or isinstance(self.data, str):\nrequests/models.py:361: if isinstance(val, list):\nrequests/models.py:369: if isinstance(v, (tuple, list)):\nrequests/models.py:374: if isinstance(fp, str):\nrequests/models.py:376: if isinstance(fp, bytes):\nrequests/models.py:411: if isinstance(scheme, str):\nrequests/models.py:413: if isinstance(netloc, str):\nrequests/models.py:415: if isinstance(path, str):\nrequests/models.py:417: if isinstance(params, str):\nrequests/models.py:419: if isinstance(query, str):\nrequests/models.py:421: if isinstance(fragment, str):\nrequests/models.py:465: if isinstance(hook, (list, tuple, set)):\nrequests/models.py:513: if isinstance(self.auth, tuple) and len(self.auth) == 2:\nrequests/models.py:534: if isinstance(self.data, str) or isinstance(self.data, builtin_str) or hasattr(self.data, 'read'):\nrequests/models.py:637: if isinstance(e, _SSLError):\nrequests/models.py:639: elif isinstance(e, TimeoutError):\nrequests/sessions.py:31: if isinstance(local_kwarg, str):\nrequests/sessions.py:93: if isinstance(cookies, cookielib.CookieJar):\nrequests/sessions.py:201: if not isinstance(cookies, cookielib.CookieJar):\nrequests/utils.py:134: if isinstance(value, (str, bytes, bool, int)):\nrequests/utils.py:156: if isinstance(value, (str, bytes, bool, int)):\nrequests/utils.py:159: if isinstance(value, dict):\nrequests/utils.py:269: if isinstance(headers, dict):\nrequests/utils.py:271: elif isinstance(headers, basestring):\nrequests/utils.py:273: elif isinstance(headers, str):\n```\n\n**Edit** that's 34 lines it's being used in, mostly in models and utils. The latter is definitely in part my fault.\n", "Line 363 in `models.py` is certainly effective, but could probably use some serious modification. I'm open to suggestions.\n\n**Edit** Also, the tests are failing.\n", "Not all uses of isinstance are bad. :)\n", "Agreed @shazow, I'm probably going to change some of them back and squash the commits before turning that branch into a Pull Request which is probably a while off.\n", "This seems a bit pedantic to me.\n\nSimultaneous support of both Python 2 and 3 will make this difficult, and I'd be _shocked_ if there weren't serious hidden regressions from these changes. What's the tangible benefit? I doubt there is one. Most of this stuff is purely internal anyway. \n", "@shazow Then please show us which ones are good and why? :) Btw, yours _is_foo helper_ idea was heading in right direction. This is what ABCs in collections module are for although it looks like they specify too few interfaces.\n", "It's not _internal_ because many of these are part of api. I don't see a reason to restrict users to a few built-in collections. Are there any?\n", "Please give me an example of an end-user benefiting change.\n\n(I'm not disagreeing with you, I'd love to see an example)\n", "@piotr-dobrogost For example when the type needs to be checked for py2 vs py3 compatibility.\n", "@kennethreitz\nPeople use different containers - see for example http://sebsauvage.net/python/snyppets/index.html#dbdict If api is restricted only to standard ones then people can't use their custom made containers.\n", "On the one hand if they inherit from the base classes, there isn't an issue with this. Unfortunately in that case `DictMixin` and `UserDict` aren't subclasses of `dict`.\n", "@shazow \nI meant the ones we are talking here :) Like checking for dict, list, set etc.\n", "@piotr-dobrogost A big chunk of the results in @sigmavirus24's grep were for backwards compat. Another chunk was the base case reduction to 'str', which otherwise uses duck typing as you prefer. :) I suspect about half of the rest could be removed/improved.\n", "Yep. I generally over step to see what happens first. I generally tinker a lot before getting things to where they should be and my commit message was probably misleading. (I count tinkering as work because I inevitably learn something.)\n", "Again, I think this is pedantic. Please feel free to send small pull requests changing this behavior if you'd like. \n", "I'm going to send a PR just for the `register_hook` function. It's the only thing that needs to be done right now.\n", "FYI, I wrote a helper which could be useful here, feel free to steal the code: https://github.com/shazow/unstdlib.py/pull/6\n", "Which is similar to my version here: https://gist.github.com/3790156\n" ]
https://api.github.com/repos/psf/requests/issues/867
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/867/labels{/name}
https://api.github.com/repos/psf/requests/issues/867/comments
https://api.github.com/repos/psf/requests/issues/867/events
https://github.com/psf/requests/pull/867
7,136,423
MDExOlB1bGxSZXF1ZXN0MjQ1MDYwNw==
867
Handle encoding of `None` when decoding unicode
{ "avatar_url": "https://avatars.githubusercontent.com/u/212338?v=4", "events_url": "https://api.github.com/users/sweenzor/events{/privacy}", "followers_url": "https://api.github.com/users/sweenzor/followers", "following_url": "https://api.github.com/users/sweenzor/following{/other_user}", "gists_url": "https://api.github.com/users/sweenzor/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sweenzor", "id": 212338, "login": "sweenzor", "node_id": "MDQ6VXNlcjIxMjMzOA==", "organizations_url": "https://api.github.com/users/sweenzor/orgs", "received_events_url": "https://api.github.com/users/sweenzor/received_events", "repos_url": "https://api.github.com/users/sweenzor/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sweenzor/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sweenzor/subscriptions", "type": "User", "url": "https://api.github.com/users/sweenzor", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-09-25T22:36:15Z
2021-09-08T17:05:50Z
2012-10-01T16:53:56Z
CONTRIBUTOR
resolved
If encoding is None, decoding will throw the following TypeError: ``` File "/home/env/local/lib/python2.7/site-packages/requests-0.14.0-py2.7.egg/requests/models.py", line 825, in text content = str(self.content, encoding, errors='replace') TypeError: unicode() argument 2 must be string, not None ``` If this is the case, attempt to run without any set encoding
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/867/reactions" }
https://api.github.com/repos/psf/requests/issues/867/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/867.diff", "html_url": "https://github.com/psf/requests/pull/867", "merged_at": "2012-10-01T16:53:56Z", "patch_url": "https://github.com/psf/requests/pull/867.patch", "url": "https://api.github.com/repos/psf/requests/pulls/867" }
true
[ "Since you're handling this the same way as a `LookupError`, why not fold the two together, e.g.,\n\n``` python\nexcept (LookupError, TypeError):\n # A LookupError is raised if the encoding was not found which could\n # indicate a misspelling or similar mistake.\n #\n # A TypeError can be raised if encoding is None\n #\n # So we try blindly encoding.\n content = str(self.content, errors='replace')\n```\n\nLess code, less confusion.\n", "@sigmavirus24 sounds reasonable!\n", ":+1:\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/866
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/866/labels{/name}
https://api.github.com/repos/psf/requests/issues/866/comments
https://api.github.com/repos/psf/requests/issues/866/events
https://github.com/psf/requests/pull/866
7,095,922
MDExOlB1bGxSZXF1ZXN0MjQzMTY1OQ==
866
Accept integers in header values, e.g.,
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-09-24T16:03:04Z
2021-09-08T17:05:49Z
2012-09-26T20:37:38Z
CONTRIBUTOR
resolved
headers = {'Content-Length': 0} Also add regression test. Fixes #865.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/866/reactions" }
https://api.github.com/repos/psf/requests/issues/866/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/866.diff", "html_url": "https://github.com/psf/requests/pull/866", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/866.patch", "url": "https://api.github.com/repos/psf/requests/pulls/866" }
true
[]
https://api.github.com/repos/psf/requests/issues/865
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/865/labels{/name}
https://api.github.com/repos/psf/requests/issues/865/comments
https://api.github.com/repos/psf/requests/issues/865/events
https://github.com/psf/requests/issues/865
7,095,234
MDU6SXNzdWU3MDk1MjM0
865
Setting a custom header to integer 0 (zero) results in 'int' object is not iterable error
{ "avatar_url": "https://avatars.githubusercontent.com/u/109316?v=4", "events_url": "https://api.github.com/users/PAStheLoD/events{/privacy}", "followers_url": "https://api.github.com/users/PAStheLoD/followers", "following_url": "https://api.github.com/users/PAStheLoD/following{/other_user}", "gists_url": "https://api.github.com/users/PAStheLoD/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/PAStheLoD", "id": 109316, "login": "PAStheLoD", "node_id": "MDQ6VXNlcjEwOTMxNg==", "organizations_url": "https://api.github.com/users/PAStheLoD/orgs", "received_events_url": "https://api.github.com/users/PAStheLoD/received_events", "repos_url": "https://api.github.com/users/PAStheLoD/repos", "site_admin": false, "starred_url": "https://api.github.com/users/PAStheLoD/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/PAStheLoD/subscriptions", "type": "User", "url": "https://api.github.com/users/PAStheLoD", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-09-24T15:42:13Z
2021-09-09T06:00:41Z
2012-10-01T16:56:16Z
NONE
resolved
When a custom header has a value of integer 0, here's the stacktrace: ``` Traceback (most recent call last): File "gtest.py", line 169, in <module> parse() File "gtest.py", line 158, in parse add_to_group(domain, argz[0], argz[1]) File "gtest.py", line 107, in add_to_group r = requests.post('https://apps-apis.google.com/a/feeds/group/2.0/%s/%s/%s?prettyprint=%s' % (domain, groupname, email, debug), headers=headers) File "/home/pas/.virtualenvs/v/lib/python3.2/site-packages/requests/api.py", line 98, in post return request('post', url, data=data, **kwargs) File "/home/pas/.virtualenvs/v/lib/python3.2/site-packages/requests/safe_mode.py", line 39, in wrapped return function(method, url, **kwargs) File "/home/pas/.virtualenvs/v/lib/python3.2/site-packages/requests/api.py", line 51, in request return session.request(method=method, url=url, **kwargs) File "/home/pas/.virtualenvs/v/lib/python3.2/site-packages/requests/sessions.py", line 188, in request headers[k] = header_expand(v) File "/home/pas/.virtualenvs/v/lib/python3.2/site-packages/requests/utils.py", line 260, in header_expand for i, (value, params) in enumerate(headers): TypeError: 'int' object is not iterable ``` Just run into this while trying to work around the missing Content-Lenght header for empty POST requests. (Installed via pip.)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/865/reactions" }
https://api.github.com/repos/psf/requests/issues/865/timeline
null
completed
null
null
false
[ "Seems like this might be something I introduced. I'm looking into it right now.\n", "Headers should be strings, really.\n", "Ah, well then feel free to ignore 865. Jumped on this a bit too quickly it seems. :P\n", "You can convince me otherwise :)\n", "Oh I have nothing invested in this. It was a quick/simple fix. I just thought I'd broken something (again). I was under the same impression (that headers should be strings).\n", "So it's for Humans, as long as they are RFC compliant then? :)\n\nIt was just confusing, because the error message made no sense, why would it iterate over a header value anyway; then after lurking a bit in the code I saw that it's possible to pass nice nested dicts as values.\n" ]
https://api.github.com/repos/psf/requests/issues/864
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/864/labels{/name}
https://api.github.com/repos/psf/requests/issues/864/comments
https://api.github.com/repos/psf/requests/issues/864/events
https://github.com/psf/requests/issues/864
7,075,463
MDU6SXNzdWU3MDc1NDYz
864
Data of array not converted properly on content-type application/x-www-form-urlencoded
{ "avatar_url": "https://avatars.githubusercontent.com/u/474302?v=4", "events_url": "https://api.github.com/users/jeanlucmongrain/events{/privacy}", "followers_url": "https://api.github.com/users/jeanlucmongrain/followers", "following_url": "https://api.github.com/users/jeanlucmongrain/following{/other_user}", "gists_url": "https://api.github.com/users/jeanlucmongrain/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/jeanlucmongrain", "id": 474302, "login": "jeanlucmongrain", "node_id": "MDQ6VXNlcjQ3NDMwMg==", "organizations_url": "https://api.github.com/users/jeanlucmongrain/orgs", "received_events_url": "https://api.github.com/users/jeanlucmongrain/received_events", "repos_url": "https://api.github.com/users/jeanlucmongrain/repos", "site_admin": false, "starred_url": "https://api.github.com/users/jeanlucmongrain/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jeanlucmongrain/subscriptions", "type": "User", "url": "https://api.github.com/users/jeanlucmongrain", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-09-23T22:17:15Z
2021-09-09T06:00:42Z
2012-09-24T14:38:41Z
NONE
resolved
if you try to post `data={'key': ['value1', 'value2']}` with `headers={'content-type': 'application/x-www-form-urlencoded'}` it's translated into `key=value1&key=value2`. while it should be `key[]=value1&key[]=value2` the workaround for that is to do: `data={'key[]':['value1','value2']}`
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/864/reactions" }
https://api.github.com/repos/psf/requests/issues/864/timeline
null
completed
null
null
false
[ "Is there a spec for this somewhere?\n\nI've never seen the foo[] semantic anywhere outside of PHP.\n", "I'm with @shazow on this one, and I hadn't even seen it in use with PHP until I saw it [here](http://stackoverflow.com/questions/353379/how-to-get-multiple-parameters-with-same-name-from-a-url-in-php).\n", "I had to do that while trying to use this API:\n\nhttps://github.com/serverdensity/sd-api-docs/blob/master/sections/alerts.md\n", "I haven't heard of this either :)\n", "it's probably just bad api implementation made by serverdensity\n", "Agreed :)\n" ]
https://api.github.com/repos/psf/requests/issues/863
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/863/labels{/name}
https://api.github.com/repos/psf/requests/issues/863/comments
https://api.github.com/repos/psf/requests/issues/863/events
https://github.com/psf/requests/pull/863
7,016,397
MDExOlB1bGxSZXF1ZXN0MjQwMTYxNQ==
863
Fix #785 & add regression test.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-20T15:48:00Z
2021-09-08T17:05:49Z
2012-09-23T01:49:19Z
CONTRIBUTOR
resolved
Sorry for the delay on this.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/863/reactions" }
https://api.github.com/repos/psf/requests/issues/863/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/863.diff", "html_url": "https://github.com/psf/requests/pull/863", "merged_at": "2012-09-23T01:49:19Z", "patch_url": "https://github.com/psf/requests/pull/863.patch", "url": "https://api.github.com/repos/psf/requests/pulls/863" }
true
[ "Hm, seems I submitted this while Travis was dead. I'm going to close and reopen.\n", "<3\n" ]
https://api.github.com/repos/psf/requests/issues/862
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/862/labels{/name}
https://api.github.com/repos/psf/requests/issues/862/comments
https://api.github.com/repos/psf/requests/issues/862/events
https://github.com/psf/requests/issues/862
7,003,071
MDU6SXNzdWU3MDAzMDcx
862
digest authentication fails because of wrongly nonce-count
{ "avatar_url": "https://avatars.githubusercontent.com/u/76891?v=4", "events_url": "https://api.github.com/users/koenvb/events{/privacy}", "followers_url": "https://api.github.com/users/koenvb/followers", "following_url": "https://api.github.com/users/koenvb/following{/other_user}", "gists_url": "https://api.github.com/users/koenvb/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/koenvb", "id": 76891, "login": "koenvb", "node_id": "MDQ6VXNlcjc2ODkx", "organizations_url": "https://api.github.com/users/koenvb/orgs", "received_events_url": "https://api.github.com/users/koenvb/received_events", "repos_url": "https://api.github.com/users/koenvb/repos", "site_admin": false, "starred_url": "https://api.github.com/users/koenvb/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/koenvb/subscriptions", "type": "User", "url": "https://api.github.com/users/koenvb", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" } ]
closed
true
null
[]
null
5
2012-09-20T06:47:59Z
2021-09-09T05:30:53Z
2012-11-17T11:04:27Z
NONE
resolved
I was trying to use the httpie library which uses requests and I had a server implementation which strictly follows the RFC (http://www.ietf.org/rfc/rfc2617.txt) When using curl everything is fine, when using httpie, it did not work. after some help it looks like the nonce-count (nc) is not correctly generated nonce-count This MUST be specified if a qop directive is sent (see above), and MUST NOT be specified if the server did not send a qop directive in the WWW-Authenticate header field. The nc-value is the hexadecimal count of the number of requests (including the current request) that the client has sent with the nonce value in this request. For example, in the first request sent in response to a given nonce value, the client sends "nc=00000001". The purpose of this directive is to allow the server to detect request replays by maintaining its own copy of this count - if the same nc-value is seen twice, then the request is a replay. See the description below of the construction of the request-digest value. Curl request: ``` GET /manage/policy HTTP/1.1 User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 Host: 192.168.12.229:8080 Accept: text/plain HTTP/1.1 401 Unauthorized DAV: 1,3 Date: Wed, 19 Sep 2012 15:14:31 GMT Server: test-test/3.0.0-7a5aba4d7a9771c7d03bde211aa37be56b670444 Content-Length: 0 WWW-Authenticate: Digest realm="test", qop="auth", nonce="2471f4d8618db6787377250976d29df6", opaque="6c375ad0468140c7b4404ba77b7464b9" GET /manage/policy HTTP/1.1 Authorization: Digest username="admin", realm="test", nonce="2471f4d8618db6787377250976d29df6", uri="/manage/policy", cnonce="MDAwNjMx", nc=00000001, qop="auth", response="f38e88c6b3f63c423be7f38c9dc2a623", opaque="6c375ad0468140c7b4404ba77b7464b9" User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 Host: 192.168.12.229:8080 Accept: text/plain HTTP/1.1 200 OK DAV: 1,3 Date: Wed, 19 Sep 2012 15:14:31 GMT Server: test-test/3.0.0-7a5aba4d7a9771c7d03bde211aa37be56b670444 Content-Type: text/plain;charset=UTF-8 Content-Length: 70 Pragma: no-cache Cache-Control: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT "4c94e07c5d44405889c11a0c71a091ac" "89d76185a2db4bdbb2a751b6e35003b0" ``` httpie request: ``` GET /manage/policy HTTP/1.1 User-Agent: HTTPie/0.2.7 Host: 192.168.12.229:8080 Accept-Encoding: identity, deflate, compress, gzip Accept: text/plain HTTP/1.1 401 Unauthorized DAV: 1,3 Date: Wed, 19 Sep 2012 15:16:40 GMT Server: test-test/3.0.0-7a5aba4d7a9771c7d03bde211aa37be56b670444 Content-Length: 0 WWW-Authenticate: Digest realm="test", qop="auth", nonce="1810bc988a671e239bb10567e80ca92b", opaque="ec37b575badf48a2aec30bc9168cdcea" GET /manage/policy HTTP/1.1 Authorization: Digest username="admin", realm="test", nonce="1810bc988a671e239bb10567e80ca92b", uri="/manage/policy", response="3c17eac558cba24a77f7bbf981e3cf75", opaque="ec37b575badf48a2aec30bc9168cdcea", qop=auth, nc=00000002, cnonce="9ab5326226636735" Accept-Encoding: identity, deflate, compress, gzip User-Agent: HTTPie/0.2.7 Host: 192.168.12.229:8080 Accept: text/plain HTTP/1.1 401 Unauthorized DAV: 1,3 Date: Wed, 19 Sep 2012 15:16:40 GMT Server: test-test/3.0.0-7a5aba4d7a9771c7d03bde211aa37be56b670444 Content-Length: 0 WWW-Authenticate: Digest realm="test", qop="auth", nonce="2925523a90abea51844ed1798a69874e", opaque="8a092396a826475e9b00b07e05e3a77a" ``` The difference is in the nc=00000002 which should be nc=00000001 according to the standard? So I guess somewhere a counter should only start from 1 in stead of 2
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/862/reactions" }
https://api.github.com/repos/psf/requests/issues/862/timeline
null
completed
null
null
false
[ "Seems something wrong in the auth.py:\n\n``` python\n if qop == 'auth':\n if nonce == self.last_nonce:\n self.nonce_count += 1\n else:\n self.nonce_count = 1\n\n ncvalue = '%08x' % self.nonce_count\n s = str(self.nonce_count).encode('utf-8')\n s += nonce.encode('utf-8')\n s += time.ctime().encode('utf-8')\n s += os.urandom(8)\n\n cnonce = (hashlib.sha1(s).hexdigest()[:16])\n noncebit = \"%s:%s:%s:%s:%s\" % (nonce, ncvalue, cnonce, qop, hash_utf8(A2))\n respdig = KD(hash_utf8(A1), noncebit)\n elif qop is None:\n respdig = KD(hash_utf8(A1), \"%s:%s\" % (nonce, hash_utf8(A2)))\n else:\n # XXX handle auth-int.\n return None\n```\n\nDo not see exact why I get nc=00000002\n", "After changing nonce_count from 1 => 0 in the code \nit works. Dunno if it now still works for other implementations\n\nSo current code:\n\n``` python\n\nif nonce == self.last_nonce:\n self.nonce_count += 1\n else:\n self.nonce_count = 1\n```\n\nChanged code:\n\n``` python\n\nif nonce == self.last_nonce:\n self.nonce_count += 1\n else:\n self.nonce_count = 0\n```\n", "This is very interesting, thanks!\n\nThe original code looks correct --- \"increment, else set equal to 1\". My guess would be that we are calling `build_digest_header` an extra time and discarding the results?\n", "You're calling requests through another library yeah? Can you try using requests directly to confirm this is a bug in requests and not the calling library?\n\nI would argue that the server is being overly pedantic though. The intention is to detect replay attacks, not keep a perfectly precise count of requests.\n", "I'm closing this due to lack of activity. If this problem still exists and is still bothering people, please let me know and I'll reopen this issue. =)\n" ]
https://api.github.com/repos/psf/requests/issues/861
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/861/labels{/name}
https://api.github.com/repos/psf/requests/issues/861/comments
https://api.github.com/repos/psf/requests/issues/861/events
https://github.com/psf/requests/issues/861
6,970,805
MDU6SXNzdWU2OTcwODA1
861
parsing encoding utf-8 page doesn't as expected
{ "avatar_url": "https://avatars.githubusercontent.com/u/10137?v=4", "events_url": "https://api.github.com/users/ghost/events{/privacy}", "followers_url": "https://api.github.com/users/ghost/followers", "following_url": "https://api.github.com/users/ghost/following{/other_user}", "gists_url": "https://api.github.com/users/ghost/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/ghost", "id": 10137, "login": "ghost", "node_id": "MDQ6VXNlcjEwMTM3", "organizations_url": "https://api.github.com/users/ghost/orgs", "received_events_url": "https://api.github.com/users/ghost/received_events", "repos_url": "https://api.github.com/users/ghost/repos", "site_admin": false, "starred_url": "https://api.github.com/users/ghost/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ghost/subscriptions", "type": "User", "url": "https://api.github.com/users/ghost", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-19T02:58:13Z
2021-09-09T00:34:20Z
2012-09-19T09:16:50Z
NONE
resolved
Test code: ``` #!/usr/bin/env python import httplib import requests def test_by_req(): url = "http://183.61.6.11/playerSearch.php" headers = {"Host" : "lolbox.duowan.com"} r = requests.get(url = url , headers = headers) assert r.status_code == httplib.OK print r.text def test_by_httplib(): path = "/playerSearch.php" headers = {"Host" : "lolbox.duowan.com"} conn = httplib.HTTPConnection(host="183.61.6.11") conn.request(method = "GET", url = path, headers = headers) resp = conn.getresponse() assert resp.status == httplib.OK print resp.read() if __name__ == "__main__": test_by_req() test_by_httplib() ``` httplib works well, but requests doesn't, please confirm and fix it.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/861/reactions" }
https://api.github.com/repos/psf/requests/issues/861/timeline
null
completed
null
null
false
[ "Please be cordial, and don't ask me to fix things for you?\n\n---\n\nThe URL you are providing doesn't provide proper headers, so requests is guessing. You should be using `response.content`\n", "Thanks for your reply.\n\n---\n\nI do add following into NGINX instance configuration file\n\n```\n...\ncharset utf-8;\n...\n```\n\nthen it generates proper header\n\n```\nContent-Type: text/html; charset=utf-8\n```\n\ninstead of the former incorrect one\n\n```\nContent-Type: text/html\n```\n\nEverything works well right now.\n" ]
https://api.github.com/repos/psf/requests/issues/860
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/860/labels{/name}
https://api.github.com/repos/psf/requests/issues/860/comments
https://api.github.com/repos/psf/requests/issues/860/events
https://github.com/psf/requests/issues/860
6,964,341
MDU6SXNzdWU2OTY0MzQx
860
response.raw.read() not working
{ "avatar_url": "https://avatars.githubusercontent.com/u/1119967?v=4", "events_url": "https://api.github.com/users/bmhatfield/events{/privacy}", "followers_url": "https://api.github.com/users/bmhatfield/followers", "following_url": "https://api.github.com/users/bmhatfield/following{/other_user}", "gists_url": "https://api.github.com/users/bmhatfield/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/bmhatfield", "id": 1119967, "login": "bmhatfield", "node_id": "MDQ6VXNlcjExMTk5Njc=", "organizations_url": "https://api.github.com/users/bmhatfield/orgs", "received_events_url": "https://api.github.com/users/bmhatfield/received_events", "repos_url": "https://api.github.com/users/bmhatfield/repos", "site_admin": false, "starred_url": "https://api.github.com/users/bmhatfield/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bmhatfield/subscriptions", "type": "User", "url": "https://api.github.com/users/bmhatfield", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-09-18T20:37:23Z
2021-09-09T06:00:44Z
2012-09-19T09:22:18Z
NONE
resolved
The following code works, but will load the entire file in memory: ``` def save_url(url, file_handle, size=(8 * 1024)): req = requests.get(url) file_handle.write(req.content) ``` This code, designed to improve upon the above code, writes 0 byte files without error. I'm having a hard time seeing where I've gone wrong in the documentation, but it simply seems that the read() socket is not functioning. ``` def save_url(url, file_handle, size=(8 * 1024)): req = requests.get(url) while True: chunk = req.raw.read(size) if chunk: file_handle.write(chunk) else: break ``` What do I need to do to make the read() socket work? Or is there a bug in Requests?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/860/reactions" }
https://api.github.com/repos/psf/requests/issues/860/timeline
null
completed
null
null
false
[ "The second bit of code should do this:\n\n``` python\ndef save_url(url, file_handle, size=(8 * 1024)):\n req = requests.get(url, prefetch=False) # <<< prefetch is the key\n\n while True:\n chunk = req.raw.read(size)\n if chunk:\n file_handle.write(chunk)\n else:\n break\n```\n", "Ah! That worked!\n\nThe documentation seems to lack a good call out that if you want to use the raw socket, you need to specify prefetch=False.\n\nThanks again,\nBrian\n", "Pretty sure it is described in the docs but I'm glad to help. Care to close the issue for @kennethreitz? \n" ]
https://api.github.com/repos/psf/requests/issues/859
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/859/labels{/name}
https://api.github.com/repos/psf/requests/issues/859/comments
https://api.github.com/repos/psf/requests/issues/859/events
https://github.com/psf/requests/issues/859
6,955,639
MDU6SXNzdWU2OTU1NjM5
859
No connection pooling for proxies
{ "avatar_url": "https://avatars.githubusercontent.com/u/45057?v=4", "events_url": "https://api.github.com/users/russss/events{/privacy}", "followers_url": "https://api.github.com/users/russss/followers", "following_url": "https://api.github.com/users/russss/following{/other_user}", "gists_url": "https://api.github.com/users/russss/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/russss", "id": 45057, "login": "russss", "node_id": "MDQ6VXNlcjQ1MDU3", "organizations_url": "https://api.github.com/users/russss/orgs", "received_events_url": "https://api.github.com/users/russss/received_events", "repos_url": "https://api.github.com/users/russss/repos", "site_admin": false, "starred_url": "https://api.github.com/users/russss/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/russss/subscriptions", "type": "User", "url": "https://api.github.com/users/russss", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-09-18T15:14:30Z
2021-09-09T05:00:52Z
2013-01-21T20:24:43Z
NONE
resolved
It appears to me that connection pooling plain doesn't work if you're connecting through a proxy. In the [Request.send method](https://github.com/kennethreitz/requests/blob/develop/requests/models.py#L546), when connecting through a proxy, instead of using the provided self._poolmanager object, it uses the static module-level function proxy_from_url. This instantiates a new connection pool for each request. This is obviously partly an issue with urllib3, and it seems like this code is changed by the SOCKS proxy changes being considered for urllib3. In the mean time it makes requests unusable for high-performance connections through a proxy.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/859/reactions" }
https://api.github.com/repos/psf/requests/issues/859/timeline
null
completed
null
null
false
[ "For whatever proxies urllib3 already supports, there's no reason why it shouldn't be able to reuse the same connection. I suspect this is a requests-level thing.\n", "Oh yes, it's just struck me how this should work. If there's a proxy involved then we should be using a ProxyManager instead of a ConnectionManager. So `proxymanager.proxy_from_url` should be called when the session is getting set up, instead of per-request.\n\nHowever, I don't think it's that simple if a separate proxy is used for HTTPS, because then we'd need a separate ProxyManager for HTTPS connections.\n", "This will be fixed during the refactor for Transport Adapters.\n", "And it was. =)\n" ]
https://api.github.com/repos/psf/requests/issues/858
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/858/labels{/name}
https://api.github.com/repos/psf/requests/issues/858/comments
https://api.github.com/repos/psf/requests/issues/858/events
https://github.com/psf/requests/issues/858
6,903,227
MDU6SXNzdWU2OTAzMjI3
858
requests adds packages directory to sys.path
{ "avatar_url": "https://avatars.githubusercontent.com/u/1476786?v=4", "events_url": "https://api.github.com/users/craigholm/events{/privacy}", "followers_url": "https://api.github.com/users/craigholm/followers", "following_url": "https://api.github.com/users/craigholm/following{/other_user}", "gists_url": "https://api.github.com/users/craigholm/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/craigholm", "id": 1476786, "login": "craigholm", "node_id": "MDQ6VXNlcjE0NzY3ODY=", "organizations_url": "https://api.github.com/users/craigholm/orgs", "received_events_url": "https://api.github.com/users/craigholm/received_events", "repos_url": "https://api.github.com/users/craigholm/repos", "site_admin": false, "starred_url": "https://api.github.com/users/craigholm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/craigholm/subscriptions", "type": "User", "url": "https://api.github.com/users/craigholm", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-09-16T14:12:24Z
2021-09-09T06:00:42Z
2012-09-24T14:39:25Z
NONE
resolved
Importing requests adds its internal packages directory to sys.path. This causes problems on Python 3, because modules that try to use chardet end up importing requests.packages.chardet (which is incompatible with Python 3), even if a Python 3 chardet is available. For example, beautifulsoup4: ``` Python >>> import requests >>> import bs4 >>> bs4.BeautifulSoup(b'\xae') Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> bs4.BeautifulSoup(b'\xae') File "C:\Python32\lib\site-packages\bs4\__init__.py", line 169, in __init__ self.builder.prepare_markup(markup, from_encoding)) File "C:\Python32\lib\site-packages\bs4\builder\_lxml.py", line 68, in prepare_markup dammit = UnicodeDammit(markup, try_encodings, is_html=True) File "C:\Python32\lib\site-packages\bs4\dammit.py", line 223, in __init__ u = self._convert_from(chardet_dammit(self.markup)) File "C:\Python32\lib\site-packages\bs4\dammit.py", line 30, in chardet_dammit return chardet.detect(s)['encoding'] File "C:\Python32\lib\site-packages\requests\packages\chardet\__init__.py", line 21, in detect import universaldetector ImportError: No module named universaldetector ``` If you install chardet2 (the version that works with Python 3), and import that module before importing requests, it works fine: ``` Python >>> import chardet >>> import requests >>> import bs4 >>> bs4.BeautifulSoup(b'\xae') <html><body><p>®</p></body></html> >>> ``` I reproduced this issue on Linux and Windows 7, with Python 3.2.3 and 3.3.0rc2.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/858/reactions" }
https://api.github.com/repos/psf/requests/issues/858/timeline
null
completed
null
null
false
[ "I think this is an okay caveat for now. I'd be open to other suggestions though.\n", "Is it possible to rename the modules in requests.packages so they're less likely to conflict with other modules (ie, \"requests-chardet\")? Or have the requests setup script exclude (or rename) requests.packages.chardet when installing on Python 3, since that package should never be used in that case?\n", "Where do you see this happening? I don't see any sys.path munging in production code except for `requests._oauth`: [https://gist.github.com/62b0d4614e885b9ba4b7]\n", "requests._oauth is where it modifies sys.path. When you import requests, it imports models which imports auth which imports _oauth. If oauthlib isn't available elsewhere, then _oauth modifies sys.path.\n\n``` Python\nPython 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32\nType \"copyright\", \"credits\" or \"license()\" for more information.\n>>> import sys\n>>> sys.path\n['', ...]\n>>> import requests\n>>> sys.path\n['C:\\\\Python32\\\\lib\\\\site-packages\\\\requests\\\\packages', '', ...]\n>>> \n```\n", "Yeah, I hadn't tried this before, but it certainly affects python 3k, even on linux.\n\nI'm pretty sure simply doing:\n\n``` python\n# ...\nexcept ImportError:\n # ...\n sys.path.insert(0, path)\n # ...\n sys.path.remove(path)\n # or you could so sys.path.pop(0)\n```\n\nI see nothing objectionable with that. We have imported what we need so we can leave the path alone, unless this is relied upon elsewhere.\n" ]
https://api.github.com/repos/psf/requests/issues/857
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/857/labels{/name}
https://api.github.com/repos/psf/requests/issues/857/comments
https://api.github.com/repos/psf/requests/issues/857/events
https://github.com/psf/requests/issues/857
6,901,392
MDU6SXNzdWU2OTAxMzky
857
Streaming requests should raise an error when network problems occur
{ "avatar_url": "https://avatars.githubusercontent.com/u/27806?v=4", "events_url": "https://api.github.com/users/swinton/events{/privacy}", "followers_url": "https://api.github.com/users/swinton/followers", "following_url": "https://api.github.com/users/swinton/following{/other_user}", "gists_url": "https://api.github.com/users/swinton/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/swinton", "id": 27806, "login": "swinton", "node_id": "MDQ6VXNlcjI3ODA2", "organizations_url": "https://api.github.com/users/swinton/orgs", "received_events_url": "https://api.github.com/users/swinton/received_events", "repos_url": "https://api.github.com/users/swinton/repos", "site_admin": false, "starred_url": "https://api.github.com/users/swinton/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/swinton/subscriptions", "type": "User", "url": "https://api.github.com/users/swinton", "user_view_type": "public" }
[ { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
9
2012-09-16T07:24:57Z
2021-09-09T05:00:41Z
2013-02-10T22:48:02Z
NONE
resolved
It seems streaming requests (as per example given [here](http://docs.python-requests.org/en/latest/user/advanced/#streaming-requests)) do not raise an error when the connection is dropped or when there are network problems that prevent the stream from being consumed. This makes it difficult to know if we should reconnect to the stream. If an error was raised, then disconnections could be handled gracefully, e.g. ``` python while True: try: for line in r.iter_lines(): if line: # filter out keep-alive new lines print json.loads(line) except ConnectionError: # reconnect... ```
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/857/reactions" }
https://api.github.com/repos/psf/requests/issues/857/timeline
null
completed
null
null
false
[ "See also #844.\n", "I'd quite happily have a go at implementing a fix for this myself, if someone more familiar with the codebase could give me a few pointers of where to start?\n", "Check out `iter_content` in `requests/models.py`. This defines an iterator that does `self.raw.read(chunk_size)` repeatedly --- this read call goes to a `requests.packages.urllib3.response.HTTPResponse`, and from there to an `httplib.HTTPResponse`, and from there to a socket.\n\nFrom my cursory inspection of the code, it's actually surprising to me that socket errors from these `read` calls are not being properly raised. I don't see anything that would be suppressing them :-/\n\nDo you have a test case for the issue?\n\nThanks for the bug report and the offer of a patch, always appreciated :-) Tell us if we can offer any more guidance.\n", "Good to know that this issue has some attention.\n\nJust for the moment, what would be the best way to handle server side or client side HTTP errors when streaming?\n\nThe current approach I'm using now. I don't know if it's going to work though, as I'm not sure whether `r.status_code` is going to change on the fly. Is it better to actually check `r.status_code`, or check `r.headers['connection']`?\n\n``` python\nr = request.get(url, ...)\n\nwhile r.status_code >= 200 and r.status_code <= 299:\n for line in r.iter_lines(chunk_size=chunk_size):\n if line:\n # do great things\nelse:\n # handle potential HTTP errors\n```\n\nAnd furthermore, how do I appropriately implement retry logic in this case?\n", "@ruli look at `requests/models.py` around line 735, status_code will never change as a result of using `iter_lines` or `iter_chunks`. `Response.headers` does not seem to change either unfortunately.\n\nI think there is retry logic recipe (in general) in the docs written as a hook. I'm not 100% sure though. Hope this gives you a hand.\n", "Ah, alright. So the hook would give me a timely update on the status? I'm checking the docs and haven't seen it mentioned though. And my impression is that if I attempt to retrieve the headers, then the connection is automagically closed even if no error (server/client side) has occured. Right now I'll just use a naive way:\n\n``` python\ntry:\n while 1:\n r = requests.get(url, ..., prefetch=False)\n\n if r.status_code == 200:\n for line in r.iter_lines():\n if line:\n # do greatness\n else:\n # log\n # exponential or fixed time.sleep(x)\nexcept ... # Major nastiness happened, we may not see 2013 coming\n```\n\nThis use case is used primarily for (theoretically) endless HTTP streams.\n", "For a stream with an expected rate of responses, it is probably best to set a sanity `timeout` setting for the request. This timeout should be the maximum time a socket call will block in `http.client`/`httplib`.\n\nThe `status_code` will never change for an HTTP response, and it would be surprising to change its behavior. It seems the issue is the general one that network problems can cause what may be effectively indefinite delays. If the OS raises an `socket.error` it should be rethrown as a `ConnectionError` but the delay before the OS assumes the network is dead or a TCP FIN is received can be many minutes.\n\nTCP does have the concept of keep alive. This can be enabled with `s.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)`. It is disabled by default in Linux and probably Mac OS X. This can cause a more prompt failure in the right conditions. But this may be overcomplicated and less effective than a request timeout.\n", "@jkl1337 we don't set the options on the sockets and I'm not sure if urllib3 does either (although if it does, it would probably be a good idea to submit the idea to @shazow). That aside, it would be ideal if we could use `select` but that would break Windows support.\n\nWe could definitely catch and re-throw the `socket.error`. That's easy. The problem it seems (to me) is that reading from a broken socket isn't raising any exception at all.\n", "There is already a timeout parameter available for the `requests` constructor. I tested a bit and it and it seems to work. My reading of the original issue is that it is a misunderstanding of what happens when TCP connections go bad (or not). For HTTP streaming or long-polling if a timeout is not set, one can expect to block indefinitely for numerous network failure modes. This is one of the reasons WebSockets has PING/PONG.\n\nThe solution to the original post I believe is to just use an appropriate timeout argument to requests.\n\nThat said, there might be an API defect in how the exceptions are handled (though they still come through):\nWhen a timeout is set a `socket.timeout` may be raised out of `self.raw.read()` in models.py.\nHowever, it looks from adapters.py that it is both not expecting a `socket.timeout` to be raised and also the `r.content` property access is outside of the try block, so any socket exception doesn't get translated to a one of those urllib3 types.\n\nOf course, the same will occur for the streaming case. A raw socket.error or socket.timeout will be propagated. So I am not yet sure what is the intent of the translation in `HTTPAdapter`.\n\nThe exact tests I used were an HTTP server that returns a Content-Length greater than the amount of data sent before a long pause (no FIN sent) and also an immediate `close()` after partial transfer. In the former a `socket.timeout` occurs (from `self.raw.read()` in models) and in the latter a `socket.error(ECONNRESET)` is propagated as expected.\n" ]
https://api.github.com/repos/psf/requests/issues/856
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/856/labels{/name}
https://api.github.com/repos/psf/requests/issues/856/comments
https://api.github.com/repos/psf/requests/issues/856/events
https://github.com/psf/requests/pull/856
6,850,174
MDExOlB1bGxSZXF1ZXN0MjMzMjUzOA==
856
adds Response.__len__ #854
{ "avatar_url": "https://avatars.githubusercontent.com/u/1144197?v=4", "events_url": "https://api.github.com/users/btoews/events{/privacy}", "followers_url": "https://api.github.com/users/btoews/followers", "following_url": "https://api.github.com/users/btoews/following{/other_user}", "gists_url": "https://api.github.com/users/btoews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/btoews", "id": 1144197, "login": "btoews", "node_id": "MDQ6VXNlcjExNDQxOTc=", "organizations_url": "https://api.github.com/users/btoews/orgs", "received_events_url": "https://api.github.com/users/btoews/received_events", "repos_url": "https://api.github.com/users/btoews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/btoews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/btoews/subscriptions", "type": "User", "url": "https://api.github.com/users/btoews", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-09-13T15:12:12Z
2021-09-08T17:05:48Z
2012-09-17T17:23:57Z
CONTRIBUTOR
resolved
I think it should be okay to use response headers for content length, falling back on len(response.content) if they aren't provided. I tested this against httpbin('stream') and it seems okay. #854
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/856/reactions" }
https://api.github.com/repos/psf/requests/issues/856/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/856.diff", "html_url": "https://github.com/psf/requests/pull/856", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/856.patch", "url": "https://api.github.com/repos/psf/requests/pulls/856" }
true
[ "I think this is a bad idea, see how `len()` builtin is limited on python2 32bit\n\n```\n>>> class A(object):\n... def __len__(self):\n... return 2*1024**3 # use sys.maxint+1 to reproduce on 64bits \n... \n... \n>>> a = A()\n>>> a.__len__()\n2147483648L\n>>> len(a)\n---------------------------------------------------------------------------\nOverflowError Traceback (most recent call last)\n\n/home/daniel/src/<ipython console> in <module>()\n\nOverflowError: long int too large to convert to int\n```\n\nand you are trying to add the same weird feature I faced this issue in discoproject/disco#270\n", "@dangra that's a great point. Although, on 64 bit machines (like I'm on at the moment) I did this:\n\n```\n>>> import sys\n>>> class A:\n... def __len__(self):\n... return sys.maxint+1\n... \n>>> a = A()\n>>> a.__len__()\n9223372036854775808L\n>>> len(a)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nTypeError: __len__() should return an int\n>>> class A:\n... def __len__(self):\n... return int(sys.maxint + 1)\n... \n>>> a = A()\n>>> len(a)\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nTypeError: __len__() should return an int\n>>> a.__len__()\n9223372036854775808L\n```\n\nJust so no one tries to say you're wrong, this is in fact the same problem. I'm also using py26, which probably explains the difference in Errors. Also python3 doesn't apparently have `sys.maxint` so I just used the value returned above from py26 and got the OverflowError.\n", "Hrmmm. Is there a workaround for this? Is this a showstopper? Does\ndownloading a 2GB file with requests break anything else?\n\nOn Mon, Sep 17, 2012 at 8:00 AM, Ian Cordasco [email protected]:\n\n> @dangra https://github.com/dangra that's a great point. Although, on 64\n> bit machines (like I'm on at the moment) I did this:\n> \n> > > > import sys\n> > > > class A:\n> > > > ... def **len**(self):\n> > > > ... return sys.maxint+1\n> > > > ...\n> > > > a = A()\n> > > > a.**len**()\n> > > > 9223372036854775808L\n> > > > len(a)\n> > > > Traceback (most recent call last):\n> > > > File \"<stdin>\", line 1, in <module>\n> > > > TypeError: **len**() should return an int\n> > > > class A:\n> > > > ... def **len**(self):\n> > > > ... return int(sys.maxint + 1)\n> > > > ...\n> > > > a = A()\n> > > > len(a)\n> > > > Traceback (most recent call last):\n> > > > File \"<stdin>\", line 1, in <module>\n> > > > TypeError: **len**() should return an int\n> > > > a.**len**()\n> > > > 9223372036854775808L\n> \n> Just so no one tries to say you're wrong, this is in fact the same\n> problem. I'm also using py26, which probably explains the difference in\n> Errors. Also python3 doesn't apparently have sys.maxint so I just used\n> the value returned above from py26 and got the OverflowError.\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/856#issuecomment-8613139.\n\n## \n\n-Ben Toews\n", "the point is that if other parts of requests (or even third party libraries) start using `len()` builtin to reliable get the response size, they will become broken for files larger than 2GB in 32bits systems.\n\nthis is a limitation of the len() builtin, why not add a `content_length()` method if you really want this shortcut to response size?\n", "I think it is more Pythonic and elegant to use the len() method, but I\nagree that it is a problem if len() cannot return longs.\n\nOn Mon, Sep 17, 2012 at 9:44 AM, Daniel Graña [email protected]:\n\n> the point is that if other parts of requests (or even third party\n> libraries) start using len() builtin to reliable get the response size,\n> they will become broken for files larger than 2G in 32bits systems.\n> \n> this is a limitation of the len() builtin, why not add a content_lenght()method if you really want this shortcut to response size?\n> \n> —\n> Reply to this email directly or view it on GitHubhttps://github.com/kennethreitz/requests/pull/856#issuecomment-8617045.\n\n## \n\n-Ben Toews\n", "I considered this early on when working on Requests. I decided to keep it out because you aren't interacting with a Response object like a string. If you do unicode(Response), it doesn't contain the value of the response. So, len didn't make sense to me either.\n", "Thanks for the contribution though, I'll definitely consider it again in the future. The longs issue def makes it a no-brainer to not include at the moment.\n", "On an entirely unrelated note @mastahyeti , it appears your commiter email address and the address you used to sign up for GitHub are not one and the same. You can add that email address to your GitHub profile if you want the committer/author on the diffs to point back to you.\n" ]
https://api.github.com/repos/psf/requests/issues/855
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/855/labels{/name}
https://api.github.com/repos/psf/requests/issues/855/comments
https://api.github.com/repos/psf/requests/issues/855/events
https://github.com/psf/requests/pull/855
6,848,929
MDExOlB1bGxSZXF1ZXN0MjMzMTk3OA==
855
added __len__ to response.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1144197?v=4", "events_url": "https://api.github.com/users/btoews/events{/privacy}", "followers_url": "https://api.github.com/users/btoews/followers", "following_url": "https://api.github.com/users/btoews/following{/other_user}", "gists_url": "https://api.github.com/users/btoews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/btoews", "id": 1144197, "login": "btoews", "node_id": "MDQ6VXNlcjExNDQxOTc=", "organizations_url": "https://api.github.com/users/btoews/orgs", "received_events_url": "https://api.github.com/users/btoews/received_events", "repos_url": "https://api.github.com/users/btoews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/btoews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/btoews/subscriptions", "type": "User", "url": "https://api.github.com/users/btoews", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-13T14:35:51Z
2021-09-08T17:05:48Z
2012-09-13T14:47:40Z
CONTRIBUTOR
resolved
#854 I added **len** . I have it checking the headers first for content-length. If it must it will do check length of content, but that should be avoided if possible, right?
{ "avatar_url": "https://avatars.githubusercontent.com/u/1144197?v=4", "events_url": "https://api.github.com/users/btoews/events{/privacy}", "followers_url": "https://api.github.com/users/btoews/followers", "following_url": "https://api.github.com/users/btoews/following{/other_user}", "gists_url": "https://api.github.com/users/btoews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/btoews", "id": 1144197, "login": "btoews", "node_id": "MDQ6VXNlcjExNDQxOTc=", "organizations_url": "https://api.github.com/users/btoews/orgs", "received_events_url": "https://api.github.com/users/btoews/received_events", "repos_url": "https://api.github.com/users/btoews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/btoews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/btoews/subscriptions", "type": "User", "url": "https://api.github.com/users/btoews", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/855/reactions" }
https://api.github.com/repos/psf/requests/issues/855/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/855.diff", "html_url": "https://github.com/psf/requests/pull/855", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/855.patch", "url": "https://api.github.com/repos/psf/requests/pulls/855" }
true
[ "I messed this up. Didn't pull the latest before updating.\n", "That isn't a problem since Travis showed that it would merge without a problem. You can also do:\n\n```\ngit pull git://github.com/kennethreitz/requests.git --rebase\ngit push --force\n```\n\nto get it to update the pull request. Please don't open a new one.\n" ]
https://api.github.com/repos/psf/requests/issues/854
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/854/labels{/name}
https://api.github.com/repos/psf/requests/issues/854/comments
https://api.github.com/repos/psf/requests/issues/854/events
https://github.com/psf/requests/issues/854
6,848,888
MDU6SXNzdWU2ODQ4ODg4
854
Add response.__len__
{ "avatar_url": "https://avatars.githubusercontent.com/u/1144197?v=4", "events_url": "https://api.github.com/users/btoews/events{/privacy}", "followers_url": "https://api.github.com/users/btoews/followers", "following_url": "https://api.github.com/users/btoews/following{/other_user}", "gists_url": "https://api.github.com/users/btoews/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/btoews", "id": 1144197, "login": "btoews", "node_id": "MDQ6VXNlcjExNDQxOTc=", "organizations_url": "https://api.github.com/users/btoews/orgs", "received_events_url": "https://api.github.com/users/btoews/received_events", "repos_url": "https://api.github.com/users/btoews/repos", "site_admin": false, "starred_url": "https://api.github.com/users/btoews/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/btoews/subscriptions", "type": "User", "url": "https://api.github.com/users/btoews", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-09-13T14:34:30Z
2021-09-09T06:00:43Z
2012-09-24T14:40:16Z
CONTRIBUTOR
resolved
Do people think it would be nice to have a response.__len__ simply as a convenience function?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/854/reactions" }
https://api.github.com/repos/psf/requests/issues/854/timeline
null
completed
null
null
false
[ "How well would this work with streaming APIs?\n", "good point. it probably wouldn't work well. I will do some testing.\n", "is there anyway with httpbin to simulate infinite streaming? I think thats the main concern, right?\n", "I'm no expert on streaming APIs but it wouldn't make sense to me that they would provide a Content-length header. Also, if you were to measure the length of what has been sent, you would have to do a length measurement on something like `r.raw.read()` which would also consume what the user is looking for.\n\nAs for simulating infinite streaming on httpbin use the endpoint 'stream' followed by the number of lines you wish to stream, e.g., httpbin.org/stream/1000\n", "so, looking at how Response.content handles things, it runs iter_chunk until there is nothing left. In the case of an infinite stream, this would also break. Do we think that its okay to assume that people who are making a request to an infinite stream would know not to call len, just like they know not to call .content. I think it should be okay to first check for a content-length header, and fall back on checking the len of Response.content.\n", "Whilst working on a library \"for humans\" I don't know if it's ever safe to assume anything. I for one frequently advise new users to use requests when working with anything and sadly most of them come back asking silly questions that could be answered by looking at the documentation. Anyway, in the end the decision is not mine. \n", "I feel the same way. I think though that adding **len** would help more people than it would confuse....\n" ]
https://api.github.com/repos/psf/requests/issues/853
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/853/labels{/name}
https://api.github.com/repos/psf/requests/issues/853/comments
https://api.github.com/repos/psf/requests/issues/853/events
https://github.com/psf/requests/pull/853
6,839,632
MDExOlB1bGxSZXF1ZXN0MjMyNzcyMQ==
853
Create label for the ISC License, which is referenced from the index page
{ "avatar_url": "https://avatars.githubusercontent.com/u/91895?v=4", "events_url": "https://api.github.com/users/plaes/events{/privacy}", "followers_url": "https://api.github.com/users/plaes/followers", "following_url": "https://api.github.com/users/plaes/following{/other_user}", "gists_url": "https://api.github.com/users/plaes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/plaes", "id": 91895, "login": "plaes", "node_id": "MDQ6VXNlcjkxODk1", "organizations_url": "https://api.github.com/users/plaes/orgs", "received_events_url": "https://api.github.com/users/plaes/received_events", "repos_url": "https://api.github.com/users/plaes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/plaes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/plaes/subscriptions", "type": "User", "url": "https://api.github.com/users/plaes", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-13T06:29:00Z
2021-09-08T17:05:48Z
2012-09-13T06:36:37Z
CONTRIBUTOR
resolved
Documentation index references label called `isc`, but it's nowhere to be found (changed section title maybe?). Therefore create it. And Pardon me for creating these single liners ;)
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/853/reactions" }
https://api.github.com/repos/psf/requests/issues/853/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/853.diff", "html_url": "https://github.com/psf/requests/pull/853", "merged_at": "2012-09-13T06:36:36Z", "patch_url": "https://github.com/psf/requests/pull/853.patch", "url": "https://api.github.com/repos/psf/requests/pulls/853" }
true
[ "excellent!\n" ]
https://api.github.com/repos/psf/requests/issues/852
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/852/labels{/name}
https://api.github.com/repos/psf/requests/issues/852/comments
https://api.github.com/repos/psf/requests/issues/852/events
https://github.com/psf/requests/pull/852
6,839,443
MDExOlB1bGxSZXF1ZXN0MjMyNzYzNA==
852
Use the include directive instead of rewriting the license in docs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/91895?v=4", "events_url": "https://api.github.com/users/plaes/events{/privacy}", "followers_url": "https://api.github.com/users/plaes/followers", "following_url": "https://api.github.com/users/plaes/following{/other_user}", "gists_url": "https://api.github.com/users/plaes/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/plaes", "id": 91895, "login": "plaes", "node_id": "MDQ6VXNlcjkxODk1", "organizations_url": "https://api.github.com/users/plaes/orgs", "received_events_url": "https://api.github.com/users/plaes/received_events", "repos_url": "https://api.github.com/users/plaes/repos", "site_admin": false, "starred_url": "https://api.github.com/users/plaes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/plaes/subscriptions", "type": "User", "url": "https://api.github.com/users/plaes", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-13T06:09:07Z
2021-09-08T17:05:47Z
2012-09-13T06:10:11Z
CONTRIBUTOR
resolved
Helps also keeping the copyright years in sync \o/
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/852/reactions" }
https://api.github.com/repos/psf/requests/issues/852/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/852.diff", "html_url": "https://github.com/psf/requests/pull/852", "merged_at": "2012-09-13T06:10:11Z", "patch_url": "https://github.com/psf/requests/pull/852.patch", "url": "https://api.github.com/repos/psf/requests/pulls/852" }
true
[ "tremendous, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/851
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/851/labels{/name}
https://api.github.com/repos/psf/requests/issues/851/comments
https://api.github.com/repos/psf/requests/issues/851/events
https://github.com/psf/requests/issues/851
6,837,189
MDU6SXNzdWU2ODM3MTg5
851
SSL "unknown protocol" is returned when it should be "certificate verify failed"
{ "avatar_url": "https://avatars.githubusercontent.com/u/39916?v=4", "events_url": "https://api.github.com/users/joeshaw/events{/privacy}", "followers_url": "https://api.github.com/users/joeshaw/followers", "following_url": "https://api.github.com/users/joeshaw/following{/other_user}", "gists_url": "https://api.github.com/users/joeshaw/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/joeshaw", "id": 39916, "login": "joeshaw", "node_id": "MDQ6VXNlcjM5OTE2", "organizations_url": "https://api.github.com/users/joeshaw/orgs", "received_events_url": "https://api.github.com/users/joeshaw/received_events", "repos_url": "https://api.github.com/users/joeshaw/repos", "site_admin": false, "starred_url": "https://api.github.com/users/joeshaw/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joeshaw/subscriptions", "type": "User", "url": "https://api.github.com/users/joeshaw", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" } ]
closed
true
null
[]
null
18
2012-09-13T02:17:35Z
2021-09-09T05:00:51Z
2013-01-21T20:23:07Z
NONE
resolved
This may be related to issue #606 and is caused by pull request #799. With requests 0.14.0, if you attempt to visit a site with a certificate whose CA is not trusted and who doesn't support SSLv2, you'll get an error like this: ``` _ssl.c:480: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol ``` when you should instead be getting an error like this: ``` _ssl.c:480: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed ``` This is because `SSLError` is caught when calling `ssl.wrap_socket()` in `VerifiedHTTPSConnection` attempting only a SSLv3 connection and then tries SSLv23. Since my server doesn't support SSLv2, the latter call throws the "unknown protocol" error. From my interpretation of issue #606 it seems like that was an intentional OpenSSL policy decision (although reversed in later OpenSSL?) Requests 0.12.1 returns the right error. This is testing on Ubuntu 10.04 LTS (Lucid) with Python 2.6.5 and OpenSSL 0.9.8k-7ubuntu8.13
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/851/reactions" }
https://api.github.com/repos/psf/requests/issues/851/timeline
null
completed
null
null
false
[ "Hmm, maybe this belongs in urllib3. @shazow ?\n", "@joeshaw If the issue is under VerifiedHTTPSConnection, then please re-open this under https://github.com/shazow/urllib3. :)\n", "Ack, sorry, this problem was caused by pull request #799, not #797.\n", "It would appear as though the code that causes the problem (in #799) is only in requests and not in urllib3? (At least as of shazow/urllib3@dfe0ea1f9)\n", "Sorry, didn't mean to break stuff. \n", "@joequery not your fault ;)\n", "Is this ticket still open and considered \"contributor friendly\"?\n", "As far as I'm aware, yes. =)\n", "I'm fairly sure this issue is resolved, so I'm closing it unless someone tells me otherwise. =)\n", "Yes, it was fixed by reverting #799. See the comments there for more info, including a link to a couple relevant urllib3 issues/pull requests.\n", "The issue brought up by #799 isn't resolved as far as I can tell. I realize my commit broke some things, but I'm still unable to circumvent the issue. Perhaps the issue was resolved without documentation change, but I still see no way to force SSLv3. Many of the fixes described in various issue threads involved updating Python to 2.7.3, specifically on OS X. There are no resolutions for Ubuntu users having the issue AFAIK. \n\nI've resorted to maintaining a fork of requests that has the change introduced by #799 but merges everything else from this main repo. \n", "@joequery: Is your specific issue that you need to force SSLv3 on Ubuntu?\n", "@joequery If you are able to run (or update to) requests 1.0, https://github.com/kennethreitz/requests/issues/1083#issuecomment-11853729 might be helpful.\n", "There is also https://github.com/shazow/urllib3/pull/109 but I'm not sure when/how/if that is available in requests.\n", "Yes. I'm not trying to cause a stir or anything, it's just that none of the commits since opening the issue have resolved my problem. The issue only occurs on certain sites. University websites seem to be prone to enforcing SSLv3.\n\n@joeshaw #1083 looks like a good solution. However, I'm a bit confused since the code provided says it works for pre 1.0. I don't see examples provided for post 1.0. \n\nAnd the when/how/if is pretty much the exact problem I'm having. If there's a way to interface with urllib3 to choose ssl version, I don't see it in the docs. \n", "@joequery: You aren't creating a stir. =) If you're having a problem, we want to fix it.\n\n#1083 absolutely does **not** work pre version 1. I should know, I wrote it. =) In fact, the first sentence reads:\n\n> Requests does not support doing this before version 1.\n\nThe examples provided are for post v1.\n\nYou are correct that this is not in the docs, and I don't think it belongs there. If you want a more detailed explanation, I have a [blog post about it](http://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/).\n", "My mistake. Man, my English is pretty bad. I though subsequent meant \"before\", so I was confused... >_>\n", "No worries. =) Does #1083 resolve your problems?\n" ]
https://api.github.com/repos/psf/requests/issues/850
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/850/labels{/name}
https://api.github.com/repos/psf/requests/issues/850/comments
https://api.github.com/repos/psf/requests/issues/850/events
https://github.com/psf/requests/pull/850
6,826,599
MDExOlB1bGxSZXF1ZXN0MjMyMTU3Nw==
850
Resolve issue in #849
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
[]
closed
true
null
[]
null
5
2012-09-12T17:51:13Z
2021-09-08T17:05:46Z
2012-09-12T17:58:03Z
CONTRIBUTOR
resolved
Resolves issue discovered in https://github.com/kennethreitz/requests/pull/849 for fixing empty proxies. Thanks to all in that thread who helped in this!
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/850/reactions" }
https://api.github.com/repos/psf/requests/issues/850/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/850.diff", "html_url": "https://github.com/psf/requests/pull/850", "merged_at": "2012-09-12T17:58:03Z", "patch_url": "https://github.com/psf/requests/pull/850.patch", "url": "https://api.github.com/repos/psf/requests/pulls/850" }
true
[ "Apparently working with a new branch doesn't do me any good, heh. Will fix if wanting just the new commit to be in pull request.\n", "Actually the second commit hasn't finished being tested yet. The first commit doesn't pass but that's that commit alone. Give it a second. (And it just went green for me)\n", "I thought doing a new branch would also eliminate the commit from before, but... :( All well, Travis approves of the new build though, so it's a bonus.\n", ":cake:\n", "@securityforus it all depends where you branch from.\n" ]
https://api.github.com/repos/psf/requests/issues/849
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/849/labels{/name}
https://api.github.com/repos/psf/requests/issues/849/comments
https://api.github.com/repos/psf/requests/issues/849/events
https://github.com/psf/requests/pull/849
6,799,758
MDExOlB1bGxSZXF1ZXN0MjMwOTc4Mg==
849
Fixed issue with empty proxies being passed
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
[]
closed
true
null
[]
null
8
2012-09-11T19:42:14Z
2021-09-08T17:05:47Z
2012-09-12T17:50:03Z
CONTRIBUTOR
resolved
Redone pull for fixing proxies using empty proxies as if they are real. I.e.: if you had this set up: ``` python proxy = {"https" : ""} ``` Requests would try to connect via empty proxy ("") instead of through a regular connection.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/849/reactions" }
https://api.github.com/repos/psf/requests/issues/849/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/849.diff", "html_url": "https://github.com/psf/requests/pull/849", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/849.patch", "url": "https://api.github.com/repos/psf/requests/pulls/849" }
true
[ "Apparently Travis says this doesn't build against 3.2, but as I don't have that environment set up I wasn't able to test it.\n", "You could iter over a copy to prevent the runtime error?\n\n``` python\nfor proxy_type,uri_ref in self.proxies.copy().items():\n if not uri_ref:\n del self.proxies[proxy_type]\n```\n\nNot a huge fan... but should work.\n", "That might work. The problem from my end though is I don't have a 3.2 environment set up, and to make it happen on my system would mean compiling Python from source, which to be honest I'm too lazy to do when I'm focused on 2.7.\n\nAnother option would be to basically do what you mentioned, but instead do this:\n\n``` pthon\ntmp_proxies = self.proxies\n\nfor proxy_type,uri_ref in tmp_proxies.items():\n if not uri_ref:\n del self.proxies[proxy_type]\n```\n\nBut this is more so just guessing and thinking back to my C/C++ days when I had to do similar to solve issues.\n", "just push up and see what travis says... thats what i did in #843.\n\nIf your worried bout commit history, when your satisfied do a squash merge into a new branch and pull request that branch.\n", "``` python\ntmp_proxies = self.proxies\n```\n\nI think that will have the same run time error, cause you would be still changing the dictionary you are iterating over.\n", "I actually think this is because `dict.items()` returns an iterator now instead of a list like in python2. This should be fixable by doing `list(dict.items())` but I could be wrong. Another option would be to do:\n\n``` python\ntmp_proxies = self.proxies.copy()\n\nfor ptype, uri_ref in tmp_proxies.items():\n if not uri_ref:\n del self.proxies[ptype]\n```\n\nSince you're not changing the dictionary you're iterating over (although this is just an expansion on what @barberj was say).\n", "i think list() is the right approach here\n", "Yeah just came back to say that I tested it in the interactive console like so:\n\n```\n>>> d = {'a': 1, 'b': 0, 'c': 1}\n>>> for k, v in list(d.items()):\n... if not v:\n... del d[k]\n... \n>>> d\n{'a': 1, 'c': 1}\n```\n" ]
https://api.github.com/repos/psf/requests/issues/848
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/848/labels{/name}
https://api.github.com/repos/psf/requests/issues/848/comments
https://api.github.com/repos/psf/requests/issues/848/events
https://github.com/psf/requests/pull/848
6,789,566
MDExOlB1bGxSZXF1ZXN0MjMwNDk2NA==
848
None is not iterable
{ "avatar_url": "https://avatars.githubusercontent.com/u/503436?v=4", "events_url": "https://api.github.com/users/barberj/events{/privacy}", "followers_url": "https://api.github.com/users/barberj/followers", "following_url": "https://api.github.com/users/barberj/following{/other_user}", "gists_url": "https://api.github.com/users/barberj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/barberj", "id": 503436, "login": "barberj", "node_id": "MDQ6VXNlcjUwMzQzNg==", "organizations_url": "https://api.github.com/users/barberj/orgs", "received_events_url": "https://api.github.com/users/barberj/received_events", "repos_url": "https://api.github.com/users/barberj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/barberj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/barberj/subscriptions", "type": "User", "url": "https://api.github.com/users/barberj", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-11T12:40:15Z
2021-09-08T23:10:57Z
2012-09-12T17:58:20Z
CONTRIBUTOR
resolved
Cut the fat... rebased. Related to #843
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/848/reactions" }
https://api.github.com/repos/psf/requests/issues/848/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/848.diff", "html_url": "https://github.com/psf/requests/pull/848", "merged_at": "2012-09-12T17:58:20Z", "patch_url": "https://github.com/psf/requests/pull/848.patch", "url": "https://api.github.com/repos/psf/requests/pulls/848" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/847
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/847/labels{/name}
https://api.github.com/repos/psf/requests/issues/847/comments
https://api.github.com/repos/psf/requests/issues/847/events
https://github.com/psf/requests/issues/847
6,762,208
MDU6SXNzdWU2NzYyMjA4
847
Support 'file' scheme
{ "avatar_url": "https://avatars.githubusercontent.com/u/223776?v=4", "events_url": "https://api.github.com/users/seppo0010/events{/privacy}", "followers_url": "https://api.github.com/users/seppo0010/followers", "following_url": "https://api.github.com/users/seppo0010/following{/other_user}", "gists_url": "https://api.github.com/users/seppo0010/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/seppo0010", "id": 223776, "login": "seppo0010", "node_id": "MDQ6VXNlcjIyMzc3Ng==", "organizations_url": "https://api.github.com/users/seppo0010/orgs", "received_events_url": "https://api.github.com/users/seppo0010/received_events", "repos_url": "https://api.github.com/users/seppo0010/repos", "site_admin": false, "starred_url": "https://api.github.com/users/seppo0010/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/seppo0010/subscriptions", "type": "User", "url": "https://api.github.com/users/seppo0010", "user_view_type": "public" }
[]
closed
true
null
[]
null
12
2012-09-10T13:43:32Z
2021-09-09T03:00:23Z
2012-09-11T03:07:33Z
NONE
resolved
I was using urllib on a project and decided to change to requests, but I was using a mix of 'http' and 'file' schemes on some scenarios which is handled by urllib. I know requests is mostly about network and doesn't make much sense to use for files but transparency would be useful. Would this be possible?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/847/reactions" }
https://api.github.com/repos/psf/requests/issues/847/timeline
null
completed
null
null
false
[ "I'm pretty sure this support would have to be added to urllib3 (or if it's already there, the vendorized package would have to be updated). @shazow might be a better person to talk to about this. In the meantime, I'll see if it's part of urllib3.\n", "It could be done on the requests side since `file` scheme won't be doing any network-based work nor does it require any connection pooling. For those reasons I'm also uncomfortable adding it into urllib3. :/ What do you think, @kennethreitz?\n", "-100. Once we have transport adapters, this will be really easy to write, but this is currently one of the biggest problems with urllib2. Massive security exploit.\n", "I use requests to do scraping and we have html files of the pages we scrape that we want to use for tests. We wanted to just tell requests the path to these files instead of the URL of the site, but because of this bug we need to go write some custom code now to check the scheme, using requests accordingly.\n\nThis means we have to add functionality to our codebase to support our tests, which is certainly not ideal. \n\nDon't know what transport adapters are, so can't comment on that, but thought I'd put a use case in here in case it's useful. \n", "You have two options. The first is to write a custom Transport Adapter, which isn't very hard. Unfortunately, this won't work in the current version of Requests, which insists you have both a netloc (e.g. hostname) and a path. A `file` URL does not have a netloc, so we throw exceptions.\n\nThe second option is to run a local webserver to host the files for testing. You can do that very easily: go to the directory the files are in and run `python -m SimpleHTTPServer`.\n", "I tried using the SimpleHTTPServer as mentioned above, but I don't want to have to start it up before running my tests, and if you start it as part of the setUp or setUpClass method in your unittests, there's no way to tear it down in the tearDown method. This leaves you with frustrating issues around tied up addresses and \"Address already in use\" exceptions. Beyond that, starting up a server just to do local file access seems like the wrong approach in a unittest. \n\nNot sure how helpful this is, but I wrote a MockRequest object that can be used when the method is set to LOCAL rather than get or post:\n\n```\nfrom requests.models import Request, Response\nfrom requests.exceptions import ConnectionError\n\n\nclass MockRequest(Request):\n def __init__(self, url=None):\n super(Request, self).__init__()\n self.url = url\n\n def get(self):\n r = Response()\n try:\n r._content = open(self.url).read()\n #: Integer Code of responded HTTP Status.\n r.status_code = 200\n except IOError as e:\n r.status_code = 404\n raise ConnectionError(e)\n\n r._content_consumed = True\n\n #: Final URL location of Response.\n r.url = self.url\n\n #: Resulting :class:`HTTPError` of request, if one occurred.\n self.error = None\n\n #: Encoding to decode with when accessing r.content.\n self.encoding = None\n\n #: The :class:`Request <Request>` that created the Response.\n self.request = self\n\n # Return the response.\n return r\n```\n\nThis is currently working in my unit tests, where I can easily change the request.method to \"LOCAL\", and then use the MockRequest object instead of a standard one. I only took the most cursory dive into the requests library, but maybe something like this would provide a useful tool to people using requests in testing environments. \n\nIs this something that could be added to Requests, in lieu of the other options above, which it seems wont' be moving forward any time soon? \n", "I'm glad you got something working for your use case, @mlissner!\n\nI doubt Requests will ever have direct support in the main library for the `file:` URL scheme. Aside from Kenneth's point above about it being a security risk, Requests is strictly an HTTP library. `file:` URLs do not use HTTP, so they're outside the Requests use case.\n\nIf you wanted a more transparent example, you should be able to use something like this:\n\n``` python\nimport requests\nfrom cStringIO import StringIO\n\nclass TestAdapter(requests.adapters.HTTPAdapter):\n urlmap = {'http://www.google.com/', '/home/lukasa/test.html'}\n\n def send(self, request, **kwargs):\n try:\n rsp = open(urlmap[request.url])\n status = 200\n except IOError:\n rsp = StringIO()\n status = 404\n\n response = requests.Response()\n response.status_code = status\n response.headers = {}\n response.encoding = None\n response.raw = rsp\n response.url = request.url\n response.request = request\n response.connection = self\n\n return response\n```\n\nMounting that transport adapter _should_ (I haven't tested it) provide you with the behaviour you want.\n", "Thanks @Lukasa. I gave that a whirl and tried to make it work for a bit, but I ran into an error I can't get past.\n\nThis line is the one causing trouble: https://github.com/kennethreitz/requests/blob/master/requests/cookies.py#L109\n\nFrom what I can tell, setting response.raw to a file or StringIO object won't work because: \n\n``` python\nTraceback (most recent call last):\n File \"/home/mlissner/Programming/intellij/juriscraper/tests/tests.py\", line 43, in test_scrape_all_example_files\n site.parse()\n File \"/usr/lib/python2.7/dist-packages/juriscraper/GenericSite.py\", line 85, in parse\n self.html = self._download()\n File \"/usr/lib/python2.7/dist-packages/juriscraper/GenericSite.py\", line 238, in _download\n r = s.get(self.url, headers={'User-Agent': 'Juriscraper'})\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 347, in get\n return self.request('GET', url, **kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 335, in request\n resp = self.send(prep, **send_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 446, in send\n extract_cookies_to_jar(self.cookies, request, r.raw)\n File \"/usr/local/lib/python2.7/dist-packages/requests/cookies.py\", line 108, in extract_cookies_to_jar\n res = MockResponse(response._original_response.msg)\nAttributeError: 'file' object has no attribute '_original_response'\n```\n\nI'm not sure how to proceed with this, though I read your FTP Adapter code and blog entry (but there's not much else on transport adapters yet!). I'm tempted to say that not allowing file-like objects is a bug, but I know that's been closed before as a wont-fix. I've also gotten the impression that _original_response shouldn't be used for anything (though it is used in cookie.py). So...I'm confused how to make this work properly, whether _original_response shouldn't be used the way it is, and what the proper fix for this should be.\n", "That's an interesting bug. Could you perhaps trying using @kanzure's \nrequestions? I suspect that's probably getting a little long in the tooth but \nit probably works around that issue if I remember it correctly. I forget, \nhowever, whether it uses transport adapters.\n", "@sigmavirus24 I took a look at requestions, but don't see any use of adapters (or workarounds) in there. Regardless, I'd rather avoid the dependency if possible.\n", "Roger that.\n", "I can confirm that I don't remember if I added support for adapters in kanzure/requestions.\n" ]
https://api.github.com/repos/psf/requests/issues/846
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/846/labels{/name}
https://api.github.com/repos/psf/requests/issues/846/comments
https://api.github.com/repos/psf/requests/issues/846/events
https://github.com/psf/requests/pull/846
6,753,965
MDExOlB1bGxSZXF1ZXN0MjI5MDAyOQ==
846
Update requests/models.py
{ "avatar_url": "https://avatars.githubusercontent.com/u/1995640?v=4", "events_url": "https://api.github.com/users/yoshiaki-nakagawa/events{/privacy}", "followers_url": "https://api.github.com/users/yoshiaki-nakagawa/followers", "following_url": "https://api.github.com/users/yoshiaki-nakagawa/following{/other_user}", "gists_url": "https://api.github.com/users/yoshiaki-nakagawa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/yoshiaki-nakagawa", "id": 1995640, "login": "yoshiaki-nakagawa", "node_id": "MDQ6VXNlcjE5OTU2NDA=", "organizations_url": "https://api.github.com/users/yoshiaki-nakagawa/orgs", "received_events_url": "https://api.github.com/users/yoshiaki-nakagawa/received_events", "repos_url": "https://api.github.com/users/yoshiaki-nakagawa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/yoshiaki-nakagawa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yoshiaki-nakagawa/subscriptions", "type": "User", "url": "https://api.github.com/users/yoshiaki-nakagawa", "user_view_type": "public" }
[]
closed
true
null
[]
null
0
2012-09-10T05:49:22Z
2021-09-08T17:05:46Z
2012-09-11T03:03:35Z
NONE
resolved
no_proxies not use full URLs.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/846/reactions" }
https://api.github.com/repos/psf/requests/issues/846/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/846.diff", "html_url": "https://github.com/psf/requests/pull/846", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/846.patch", "url": "https://api.github.com/repos/psf/requests/pulls/846" }
true
[]
https://api.github.com/repos/psf/requests/issues/845
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/845/labels{/name}
https://api.github.com/repos/psf/requests/issues/845/comments
https://api.github.com/repos/psf/requests/issues/845/events
https://github.com/psf/requests/pull/845
6,741,128
MDExOlB1bGxSZXF1ZXN0MjI4NzI5OA==
845
fixed typo in docs
{ "avatar_url": "https://avatars.githubusercontent.com/u/522344?v=4", "events_url": "https://api.github.com/users/alanhamlett/events{/privacy}", "followers_url": "https://api.github.com/users/alanhamlett/followers", "following_url": "https://api.github.com/users/alanhamlett/following{/other_user}", "gists_url": "https://api.github.com/users/alanhamlett/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alanhamlett", "id": 522344, "login": "alanhamlett", "node_id": "MDQ6VXNlcjUyMjM0NA==", "organizations_url": "https://api.github.com/users/alanhamlett/orgs", "received_events_url": "https://api.github.com/users/alanhamlett/received_events", "repos_url": "https://api.github.com/users/alanhamlett/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alanhamlett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alanhamlett/subscriptions", "type": "User", "url": "https://api.github.com/users/alanhamlett", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-09T08:56:40Z
2021-09-08T17:05:45Z
2012-09-09T09:29:37Z
CONTRIBUTOR
resolved
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/845/reactions" }
https://api.github.com/repos/psf/requests/issues/845/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/845.diff", "html_url": "https://github.com/psf/requests/pull/845", "merged_at": "2012-09-09T09:29:37Z", "patch_url": "https://github.com/psf/requests/pull/845.patch", "url": "https://api.github.com/repos/psf/requests/pulls/845" }
true
[ "nice catch, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/844
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/844/labels{/name}
https://api.github.com/repos/psf/requests/issues/844/comments
https://api.github.com/repos/psf/requests/issues/844/events
https://github.com/psf/requests/issues/844
6,705,803
MDU6SXNzdWU2NzA1ODAz
844
umbrella ticket to resolve iteration / read size / chunked encoding questions
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[ { "color": "e10c02", "default": false, "description": null, "id": 117744, "name": "Bug", "node_id": "MDU6TGFiZWwxMTc3NDQ=", "url": "https://api.github.com/repos/psf/requests/labels/Bug" }, { "color": "0b02e1", "default": false, "description": null, "id": 191274, "name": "Contributor Friendly", "node_id": "MDU6TGFiZWwxOTEyNzQ=", "url": "https://api.github.com/repos/psf/requests/labels/Contributor%20Friendly" }, { "color": "f7c6c7", "default": false, "description": null, "id": 167537670, "name": "Propose Close", "node_id": "MDU6TGFiZWwxNjc1Mzc2NzA=", "url": "https://api.github.com/repos/psf/requests/labels/Propose%20Close" } ]
closed
true
null
[]
null
52
2012-09-07T03:54:10Z
2021-09-08T23:06:04Z
2015-01-19T09:29:14Z
CONTRIBUTOR
resolved
This ticket is intended to aggregate previous discussion from #539, #589, and #597 about the default value of `chunk_size` used by `iter_content` and `iter_lines`. cc @mponton @gwrtheyrn @shazow Issues: 1. The default read size of `iter_content` is 1 byte; this is probably inefficient 2. Requests does not expose the ability to read chunked encoding streams in the "correct" way, i.e., using the provided octet counts to tell how much to read. 3. However, this would not be suitable as the default implementation of `iter_content` anyway; not all websites are standards-compliant and when this was tried it caused more problems than it solved. 4. The current default read size for `iter_lines` is 10kB. This is high enough that iteration over lines can be perceived as unresponsive --- no lines are returned until all 10kB have been read. 5. There is no "correct" way to implement `iter_lines` using blocking I/O, we just have to bite the bullet and take a guess as to how much data we should read. 6. There's apparently some nondeterminism in `iter_lines`, I think because of the edge case where a read ends between a `\r` and a `\n`. 7. `iter_lines` is backed by `iter_content`, which operates on raw byte strings and splits at byte boundaries. I think there may be edge cases where we could split the body in the middle of a multi-byte encoding of a Unicode character. My guess at a solution: 1. Set the default `chunk_size` to 1024 bytes, for both `iter_content` and `iter_lines`. 2. Provide a separate interface (possibly `iter_chunks`) for iterating over chunks of pages that are known to correctly implement chunked encoding, e.g., Twitter's firehose APIs 3. We may need our own implementation of `splitlines` that is deterministic with respect to our chunking boundaries, i.e., remembers if the last-read character was `\r` and suppresses a subsequent `\n`. We may also need to build in Unicode awareness at this level, i.e., decode as much of the body as is valid, then save any leftover invalid bytes to be prepended to the next chunk. Comments and thoughts are much appreciated. Thanks for your time!
{ "avatar_url": "https://avatars.githubusercontent.com/u/1382556?v=4", "events_url": "https://api.github.com/users/Lukasa/events{/privacy}", "followers_url": "https://api.github.com/users/Lukasa/followers", "following_url": "https://api.github.com/users/Lukasa/following{/other_user}", "gists_url": "https://api.github.com/users/Lukasa/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/Lukasa", "id": 1382556, "login": "Lukasa", "node_id": "MDQ6VXNlcjEzODI1NTY=", "organizations_url": "https://api.github.com/users/Lukasa/orgs", "received_events_url": "https://api.github.com/users/Lukasa/received_events", "repos_url": "https://api.github.com/users/Lukasa/repos", "site_admin": false, "starred_url": "https://api.github.com/users/Lukasa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Lukasa/subscriptions", "type": "User", "url": "https://api.github.com/users/Lukasa", "user_view_type": "public" }
{ "+1": 1, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 1, "url": "https://api.github.com/repos/psf/requests/issues/844/reactions" }
https://api.github.com/repos/psf/requests/issues/844/timeline
null
completed
null
null
false
[ ":+1: for `iter_chunks` \n", "@slingamn thanks so much for stepping up with this ;)\n", "I'm not sure using 1024 as the default size for `iter_lines` is appropriate, I think it should be 1 byte. Don't get me wrong, **I KNOW** how bad this is for performance. But I stick with my original reasoning: If someone iterates on `iter_lines`, lines should be processed as soon as they are available and there should be no chance of \"hanging\" with complete lines in the buffer. The interface is called `iter_lines` so it should do just that by default.\n\nA knowledgeable developer that wants better performance could still decide to use a larger read size knowing that it could mean that the read process will hang until the specified amount is read or the stream closed and that some lines could come in late.\n\nI love `requests` because it is fun and easy to use first, yet very powerful. This is why I think `iter_lines` should behave as expected even if it means poor performance. This decision should simply be documented. Newcomers will appreciate this (i.e. works as expected out of the box) while more experienced devs can still fiddle with the buffer size.\n\nThat said, `iter_content` should definitely have a larger default read size. The previous one was 10K if I remember correctly. The newly proposed one is 1K. I'm not sure which one make a better default.\n\n+1 for `iter_chunks`.\n", "I think I'm missing something but why must `iter_lines` hang when it has complete lines in the buffer? Why can't we scan for completed lines (`\\n` or such) and yield it just the same even if we've read less than the default size?\n", "@shazow Because the synchronous network read call will not return until the specified amount of bytes has been read or the stream is closed. Thus, is you use a 1K read size and the server returns lines averaging 100 bytes, you will have to wait for the server to return at least 11 lines before `iter_lines` return any lines and your Python code is executed. If one line is sent every minute, it will take 11 minutes before your code is even aware of the first line sent by the server.\n", "Ah I see what you mean. For some reason I was thinking in local IO terms. Thanks for the clarification!\n\nI wonder if there is any way to do it timeout-based, such that it will read as much as it can in N ms and process, loop.\n", "@mponton these are good points.\n\nDoes anyone know what browsers typically do when reading streaming text data without chunked encoding?\n", "I did a quick test out of curiosity. It seems to depend on the `Content-Type`. For `text/ascii`, each line is printed as it comes in without delay (Safari 6). If content type is unspecified or HTML, the browser waits for the server to close the connection before rendering the content.\n\nIn any case, I'm not sure we should compare and try to emulate a browser... We're \"stuck\" in synchronous I/O land, browsers aren't. We should implement what makes the most sense for `requests`.\n", "I was poking around for something unrelated and there's quite an interesting implementation of a `readline` method inside the `socket` module. I haven't read it in detail yet, but it looks as though it reads byte-at-a-time in some cases and 8kB at a time in others.\n\nIt doesn't respect unicode or universal newlines, so we probably can't use it out of the box, but it looks like they put quite a bit of thought into it, so maybe some of the ideas are applicable.\n", "It seems most of the discussion is to do with how iter_lines should work. Is there any reason for iter_content not to have a larger default chunk size? The performance hit was really hard for the 1 byte size before I figured out what was going on.\n", "There's no reason (at least, for `iter_content`'s own default, as opposed to the default that `iter_lines` uses it with). I've been sort of reluctant to just dive in and try to change it, lest we trigger latent bugs (which is what happened the last time I changed a default).\n\nTo be honest, I think the typical use case should just be to read the entire body with the `.content` property. `iter_content` strikes me as a difficult interface to use correctly.\n", "I had changed back to 10K (original value) in #589 but the travisbot failed the build because one of the unit tests' expected result was not the same with a chunk size > 1 (see https://github.com/kennethreitz/requests/pull/589#issuecomment-5538019 for details).\n\nKenneth, proceeded to close the issue saying `iter_content` now had a proper size. At the time I thought he had made the changes on his side would merge them. Apparently this feel through a crack or something...\n", "@slingamn Could you elaborate on point 3 from your initial list?\n", "+1 for improving the default performance of iter_content, or at least, in the property Request.content, make sure to call iter_content with a larger chunk size. I think there's no reason for reading in chunks over there...\n\nEdit: sorry. I see this has already been fixed in the latest release. Thanks for that!\n", "@slingamn pointed out that there are a few issues here that are still unresolved. Sometime today I'll go through and work out which ones still haven't been done.\n", "Current status as of v1.1.0:\n1. the iter_content read size is still at 1 byte\n2. the iter_lines read size has been reduced to 512 bytes (which should help responsiveness)\n3. multibyte characters and newlines can still overlap with read boundaries\n4. there's an implementation of chunked encoding for outgoing requests, but I'm not sure if there is one for incoming requests (the documentation says so, but I can't find the implementation)\n", "My view:\n1. Yeah, probably. Something small-ish though, as we generally expect users who need `iter_content` to specify their own values.\n2. I'd call that fixed. =D\n3. This has all the hallmarks of being an interesting problem. =) If no-one else does I'll probably take a look at seeing if we can fix this.\n4. Again, interesting problem for someone to work on.\n", "3 is an interesting problem. There is probably a minimum length you might want to consider in those cases, but I'm sure you won't be able to please everyone. Since UTF-8 is on the rise, we could probably use that as a way of deciding on a default length.\n", "@slingamn #4's a documentation problem and needs to be corrected.\n", "I would like to jump in because it appears that a bit of the above discussion is based upon a false premise: that a synchronous network receive of _n_ bytes will block until at least _n_ bytes are received (or, presumably, the socket has closed).\n\nThis is not, in fact, the case, and Unix network programming would be a shambles if it were — think of the disaster that every network program would face: applications would have to make the horrible decision to either read data byte-by-byte, or block indefinitely if they overestimated, even very slightly, the amount of data about to arrive on a socket. Network programmers would all stand impaled upon the horns of a dilemma. Everyone might use Windows for network programming instead. :)\n\nBut, fortunately, the plain normal vanilla blocking synchronous version of the `recv()` call is merciful to us: it only blocks waiting as long as _no data at all_ is ready to be consumed! As soon as _even a single byte_ of data arrives in an incoming packet, your beefy call to `recv(1048576)` will return _that single byte_ and your program is off and running again. There is _no penalty_ for giving `recv()` permission to return lots of data if a lot of data arrives in a single packet, or arrives in several packets while the operating system is still getting around to scheduling your thread again.\n\nIt is true that, for those rare exceptional cases where you really _want_ to stay blocked because you really know that you need _n_ bytes before you can do anything useful, there exists a POSIX flag `MSG_WAITALL` that you can pass to `recv()` so that your program really does block until lots of data arrives. But that is a very rare flag to specify, for all of these reasons that we have put on the table here.\n\nSo what is the problem here, you ask?\n\nWell, @mponton actually lets the cat out of the bag without knowing it! Look carefully at this phrase from his reply to @shazow:\n\n“…the synchronous network read call…”\n\n“Read” call? What? Who would do a `read()` call on a socket? While POSIX does allow `read()` and `write()` on sockets for those extremely rare cases where you pass a socket to a library that is only designed for talking to files, it's not something you would ever do in a network program—you would lock yourself up waiting for _n_ bytes to arrive even if less than _n_ bytes were available immediately! Who would do _that?_\n\nWhy, the author of `httplib`, of course!\n\nYes, that's right. Instead of simply sitting in a tidy standard `recv()` loop and slowly filling a buffer until an end-of-line is visible, the author of `httplib` **wraps the socket in a fake file-like object with `makefile()` and completely abandons all of the benefits of network programming under Unix!**\n\nThey gain a tiny bit of convenience — and maybe, way back when it was written, C-level performance? — by having a Python file-like object watch for the end-of-line character for them. But they **completely disabled the ability to stream live data from the network** by making this choice, probably because they were operating in an era when people read and wrote network payloads whole anyway.\n\nI recommend that Requests move off of `httplib`. It does very, very little for you; it could be re-implemented much more simply with `recv()` and `send()` in a day or two, given the simplicity of HTTP. There is no reason why Python or Requests shouldn't have line-based or content-based iteration that returns the moment that enough data has arrived to satisfy the caller; you just need to move off of a broken implementation that wantonly imposes the semantics of the `read()` call on what is really a socket capable of doing `recv()` if you'll just ask nicely!\n", "I need to go have dinner, but another quick note that I'll expand on later: there's also no reason that `readline()` should find UTF-8 a challenge, because the pair of bytes `\\r\\n` look exactly the same in UTF-8 — and since _every byte_ of a multi-byte character in UTF-8 has the high bit set, no multi-byte character or sequence of them could accidentally have `\\r\\n` sitting inside. So you just need `readline()` to call `recv()` getting raw bytes until you see the sequence `\\r\\n`, and _then_ pass the sequence of bytes — that you know already is a single line — to the decoder to be turned into a string.\n", "I doubt we're prepared to ditch httplib (and thus urllib3) over `iter_lines()`.\n", "@brandon-rhodes thanks very much, this was extremely illuminating.\n", "urllib3 would be very very happy to ditch httplib. https://github.com/shazow/urllib3/issues/58\n\nI'm thinking of trying to find some corporate sponsors for making this happen and diving in (alongside some other high-demand issues).\n", "@shazow: I'm all for that! Let me know if you get off the ground with it and I'll do my best to help out.\n", "So, the implementation of iter_content calls `read` directly:\n\n``` python\n def generate():\n while 1:\n chunk = self.raw.read(chunk_size)\n if not chunk:\n break\n yield chunk\n self._content_consumed = True\n```\n\nSo we can presumably just call `recv` directly here, modulo an issue where `self.raw` may be a `CStringIO` instead of a socket if the content was prefetched. This wouldn't require eliminating httplib.\n", "@slingamn There is a danger here: once the socket has been wrapped with a file-like object by `makefile()`, there is a chance that the stdio buffering will have read a bit _past_ the end of the first line and, after returning that line to you, will hold in its buffer a good bit of data that lay _after_ the line ending.\n\nUsually this is no problem, as when you next issue `readline()` or `read()` the file buffering simply draws data from its buffer first before then turning to the file descriptor for more.\n\nBut if you try to go _around_ the stdio input buffering and read directly from the socket, you will be missing the chunk of data (if any) that had been read past the end of the line! Unfortunately, stdio provides no way to introspect a `FILE *` object and rescue the contents of its buffer without also probably inducing the punishment of a blocking `read()`. So once you have even for a moment used a file-like object to do your reading for you, you are committed: you cannot return to raw socket I/O.\n\nIt might be possible to craft your own file-like object; I found, for example, that `pywsgi.py` in `gevent` let me provide my own `rfile` object that implements `read()` and `readline()` on top of a socket, and the problem was solved.\n\nIt is also possible that you might want a way around the `FILE *` problem, or even a guarantee that no data will be trapped there. I am often wrong about such things, and you may see a way out where I have not yet.\n\nBut I think the whole issue is what lead the Python 3 people to ditch `FILE *` I/O entirely and write a new dedicated Python buffering subsystem directly atop POSIX system calls. If only we were working under Python 3, we might not even face these issues. Alas that all of our favorite toys keep us toiling under Python 2!\n", "@brandon-rhodes `makefile()` is implemented entirely in Python (in 2.7 at least) and is a wrapper around the low-level socket object. It is not a FILE \\* object so it has nothing to do with stdio. Its internal buffering is implemented using StringIO. It has a `readline()` method that does exactly what we need (i.e. use `recv()` to get data from the network into a buffer and return immediately when an EOL is encountered) for `iter_lines()` (minus unicode decoding).\n\n@slingamn The file-like object in `Response.raw` is a `urllib3` `HTTPResponse` wrapping a `httplib` `HTTPResponse`. The later uses `makefile()` to wrap the socket object but does no expose that socket object and thus it is not possible to call `recv()` from a `Response` object (well, unless you dig deep, see below).\n\nAs an example, here's an ugly kludge that would use an \"optimized\" way to read lines from the network:\n\n```\n# Decoding stuff ignored, just an example...\ndef iter_lines(self, max_size=10000, decode_unicode=None):\n while 1:\n # raw = urllib3 HTTPResponse\n # raw._fp = httplib HTTPResponse\n # raw._fp.fp = socket file-like object returned by socket.makefile()\n line = self.raw._fp.fp.readline(max_size)\n # raw._fp.fp._sock is the actual socket where we could call recv()\n if not line:\n break\n yield line\n```\n\nHere's an example of the result when reading 10 lines generated at 5 seconds interval with a buffer size of 10K:\n\nOriginal `iter_lines` (stuck in `read()` for 50 seconds):\n\n```\n01:06:14: This is line 1\n01:06:14: This is line 2\n01:06:14: This is line 3\n01:06:14: This is line 4\n01:06:14: This is line 5\n01:06:14: This is line 6\n01:06:14: This is line 7\n01:06:14: This is line 8\n01:06:14: This is line 9\n01:06:14: This is line 10\n```\n\n\"Fixed\" `iter_lines` (properly streaming every 5 seconds):\n\n```\n01:06:20: This is line 1\n01:06:22: This is line 2\n01:06:27: This is line 3\n01:06:32: This is line 4\n01:06:37: This is line 5\n01:06:42: This is line 6\n01:06:47: This is line 7\n01:06:52: This is line 8\n01:06:57: This is line 9\n01:07:02: This is line 10\n```\n\nI'm sorry if my previous comments on network I/O might have been overly simplistic, but in the current context, they seemed right enough.\n\n@brandon-rhodes Is right, the proper way of fixing this would be to either use `recv()` directly or use the `makefile()`-generated file-like object's `readline()` (which does exactly what Brandon describes). Considering that `httplib`'s HTTPResponse class does not \"officialy\" expose the file-like object it uses, using it for our own purpose may not be a good idea. This would be solved if `urllib3` stopped using `httplib` and properly exposed the methods/properties we need to fix this issue correctly but this would require some surgery...\n", "@mponton, you are AWESOME — thank you for stopping me from making this fix more work than was necessary for everyone! My information was outdated. The last time I read `makefile()`, it merely did this with the socket (here I'm quoting from Python 2.3, which happens to be on my hard drive):\n\n```\n((fd = dup(s->sock_fd)) < 0 || (fp = fdopen(fd, mode)) == NULL)\n```\n\nI am VERY happy that the modern `makefile()`, even in Python 2.7, has been spruced up and improved and does not impose on Requests all of the problems that I was wildly claiming.\n", "Oh: and, I'd recommend that Requests go with @mponton's solution here and not worry about whether `httplib` “officially” exposes the object or not; the library at this point has been entombed within amber for more than a decade and I would be surprised, given how much code depends upon its every peculiarity, whether it will ever change again at this point. If Python 3.4 or 3.5 does ever invalidate the access to `_fp` then a more difficult solution could be constructed at that point.\n" ]
https://api.github.com/repos/psf/requests/issues/843
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/843/labels{/name}
https://api.github.com/repos/psf/requests/issues/843/comments
https://api.github.com/repos/psf/requests/issues/843/events
https://github.com/psf/requests/pull/843
6,704,204
MDExOlB1bGxSZXF1ZXN0MjI3MjczOQ==
843
'NoneType' object is not iterable
{ "avatar_url": "https://avatars.githubusercontent.com/u/503436?v=4", "events_url": "https://api.github.com/users/barberj/events{/privacy}", "followers_url": "https://api.github.com/users/barberj/followers", "following_url": "https://api.github.com/users/barberj/following{/other_user}", "gists_url": "https://api.github.com/users/barberj/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/barberj", "id": 503436, "login": "barberj", "node_id": "MDQ6VXNlcjUwMzQzNg==", "organizations_url": "https://api.github.com/users/barberj/orgs", "received_events_url": "https://api.github.com/users/barberj/received_events", "repos_url": "https://api.github.com/users/barberj/repos", "site_admin": false, "starred_url": "https://api.github.com/users/barberj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/barberj/subscriptions", "type": "User", "url": "https://api.github.com/users/barberj", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-07T01:20:11Z
2021-09-08T17:05:45Z
2012-09-11T03:03:23Z
CONTRIBUTOR
resolved
'NoneType' object is not iterable
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/843/reactions" }
https://api.github.com/repos/psf/requests/issues/843/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/843.diff", "html_url": "https://github.com/psf/requests/pull/843", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/843.patch", "url": "https://api.github.com/repos/psf/requests/pulls/843" }
true
[ "Would you mind removing the fudge stuff? I don't want to add another dependency for development just yet :)\n", "Sure not a problem. Just wanted to prove my work!\n" ]
https://api.github.com/repos/psf/requests/issues/842
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/842/labels{/name}
https://api.github.com/repos/psf/requests/issues/842/comments
https://api.github.com/repos/psf/requests/issues/842/events
https://github.com/psf/requests/pull/842
6,702,768
MDExOlB1bGxSZXF1ZXN0MjI3MjAwMQ==
842
fix some tests to correctly cover the API
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-06T23:33:28Z
2021-09-08T17:05:44Z
2012-09-07T07:10:21Z
CONTRIBUTOR
resolved
After #831, the tests added in #764 (which relied on iter_content() crashing if the response was prefetched) no longer tested what they were intended to test. Test-only change, no expected changes in functionality.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/842/reactions" }
https://api.github.com/repos/psf/requests/issues/842/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/842.diff", "html_url": "https://github.com/psf/requests/pull/842", "merged_at": "2012-09-07T07:10:21Z", "patch_url": "https://github.com/psf/requests/pull/842.patch", "url": "https://api.github.com/repos/psf/requests/pulls/842" }
true
[ "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/841
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/841/labels{/name}
https://api.github.com/repos/psf/requests/issues/841/comments
https://api.github.com/repos/psf/requests/issues/841/events
https://github.com/psf/requests/pull/841
6,689,170
MDExOlB1bGxSZXF1ZXN0MjI2NDkyMA==
841
Reset PYTHONDONTWRITEBYTECODE after installation
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-09-06T14:24:29Z
2021-09-08T23:10:56Z
2012-09-11T03:15:43Z
CONTRIBUTOR
resolved
Fixes #839.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/841/reactions" }
https://api.github.com/repos/psf/requests/issues/841/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/841.diff", "html_url": "https://github.com/psf/requests/pull/841", "merged_at": "2012-09-11T03:15:43Z", "patch_url": "https://github.com/psf/requests/pull/841.patch", "url": "https://api.github.com/repos/psf/requests/pulls/841" }
true
[ "I actually think that Python just checks for the existence of the environ, so we should remove it completely if it didn't exist. \n", "Ok then. You want me to submit a separate patch just doing:\n\n``` python\ndel os.environ['PYTHONDONTWRITEBYTECODE']\n```\n", "Oh you could have just added another commit, it would have updated the pull request automatically :)\n", "Also, rebased for a clean history.\n" ]
https://api.github.com/repos/psf/requests/issues/840
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/840/labels{/name}
https://api.github.com/repos/psf/requests/issues/840/comments
https://api.github.com/repos/psf/requests/issues/840/events
https://github.com/psf/requests/pull/840
6,688,980
MDExOlB1bGxSZXF1ZXN0MjI2NDgyOQ==
840
add prefetch=False to streaming example
{ "avatar_url": "https://avatars.githubusercontent.com/u/325146?v=4", "events_url": "https://api.github.com/users/gareth-lloyd/events{/privacy}", "followers_url": "https://api.github.com/users/gareth-lloyd/followers", "following_url": "https://api.github.com/users/gareth-lloyd/following{/other_user}", "gists_url": "https://api.github.com/users/gareth-lloyd/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/gareth-lloyd", "id": 325146, "login": "gareth-lloyd", "node_id": "MDQ6VXNlcjMyNTE0Ng==", "organizations_url": "https://api.github.com/users/gareth-lloyd/orgs", "received_events_url": "https://api.github.com/users/gareth-lloyd/received_events", "repos_url": "https://api.github.com/users/gareth-lloyd/repos", "site_admin": false, "starred_url": "https://api.github.com/users/gareth-lloyd/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gareth-lloyd/subscriptions", "type": "User", "url": "https://api.github.com/users/gareth-lloyd", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-06T14:17:06Z
2021-09-08T17:05:44Z
2012-09-07T07:06:51Z
CONTRIBUTOR
resolved
I was tripped up when playing around with streaming APIs by the non-inclusion of the prefetch=False parameter in the documentation's example. I see that the default value of prefetch was changed in v 0.13.6, so this is probably just a hangover of that change.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/840/reactions" }
https://api.github.com/repos/psf/requests/issues/840/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/840.diff", "html_url": "https://github.com/psf/requests/pull/840", "merged_at": "2012-09-07T07:06:51Z", "patch_url": "https://github.com/psf/requests/pull/840.patch", "url": "https://api.github.com/repos/psf/requests/pulls/840" }
true
[ "Thanks!\n", ":cake:\n" ]
https://api.github.com/repos/psf/requests/issues/839
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/839/labels{/name}
https://api.github.com/repos/psf/requests/issues/839/comments
https://api.github.com/repos/psf/requests/issues/839/events
https://github.com/psf/requests/issues/839
6,685,599
MDU6SXNzdWU2Njg1NTk5
839
os.environ['PYTHONDONTWRITEBYTECODE'] = '1' in setup.py breaks other packages
{ "avatar_url": "https://avatars.githubusercontent.com/u/121624?v=4", "events_url": "https://api.github.com/users/io41/events{/privacy}", "followers_url": "https://api.github.com/users/io41/followers", "following_url": "https://api.github.com/users/io41/following{/other_user}", "gists_url": "https://api.github.com/users/io41/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/io41", "id": 121624, "login": "io41", "node_id": "MDQ6VXNlcjEyMTYyNA==", "organizations_url": "https://api.github.com/users/io41/orgs", "received_events_url": "https://api.github.com/users/io41/received_events", "repos_url": "https://api.github.com/users/io41/repos", "site_admin": false, "starred_url": "https://api.github.com/users/io41/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/io41/subscriptions", "type": "User", "url": "https://api.github.com/users/io41", "user_view_type": "public" }
[]
closed
true
null
[]
null
1
2012-09-06T11:32:47Z
2021-09-09T06:00:44Z
2012-09-11T03:15:43Z
NONE
resolved
os.environ['PYTHONDONTWRITEBYTECODE'] = '1' globally changes behaviour for all packages installing along side requests, if requests is installed as a dependancy of another package.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/839/reactions" }
https://api.github.com/repos/psf/requests/issues/839/timeline
null
completed
null
null
false
[ "i.e. if pyro & requests are dependencies of the same python package, pyro breaks since it requires writing bytecode as part of it's setup.\n" ]
https://api.github.com/repos/psf/requests/issues/838
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/838/labels{/name}
https://api.github.com/repos/psf/requests/issues/838/comments
https://api.github.com/repos/psf/requests/issues/838/events
https://github.com/psf/requests/pull/838
6,648,088
MDExOlB1bGxSZXF1ZXN0MjI0NTg2NA==
838
Remove Authorization header when following redirection
{ "avatar_url": "https://avatars.githubusercontent.com/u/188302?v=4", "events_url": "https://api.github.com/users/hamstah/events{/privacy}", "followers_url": "https://api.github.com/users/hamstah/followers", "following_url": "https://api.github.com/users/hamstah/following{/other_user}", "gists_url": "https://api.github.com/users/hamstah/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/hamstah", "id": 188302, "login": "hamstah", "node_id": "MDQ6VXNlcjE4ODMwMg==", "organizations_url": "https://api.github.com/users/hamstah/orgs", "received_events_url": "https://api.github.com/users/hamstah/received_events", "repos_url": "https://api.github.com/users/hamstah/repos", "site_admin": false, "starred_url": "https://api.github.com/users/hamstah/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hamstah/subscriptions", "type": "User", "url": "https://api.github.com/users/hamstah", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-09-04T22:31:11Z
2021-09-08T23:11:05Z
2012-09-09T09:32:43Z
NONE
resolved
See http://bugs.python.org/issue3819 for a discussion on a similar change in urllib2
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/838/reactions" }
https://api.github.com/repos/psf/requests/issues/838/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/838.diff", "html_url": "https://github.com/psf/requests/pull/838", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/838.patch", "url": "https://api.github.com/repos/psf/requests/pulls/838" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2337758) (merged 73ca5943 into c8f166f6).\n", "I need to think about this.\n", "Sure. One other option is to keep the authorization if the host/port etc is the same.\nAs the bugzilla discussion shows the rfc is ambiguous about it, but it seems that most libs/browsers do the same.\n", "That Python ticket brings back bad memories. Before that fix in Python, urllib2 still sent basic auth after a redirect regardless of whether the URI matched the valid URIs specified in the `HTTPPasswordMgr` instance which was clearly wrong. However, urllib2's API does not map exactly to the requests API in that you don't specify the URIs to send the authentication token.\n\nI think not forwarding the credentials if the sites are not of the \"same origin\" is a sane default although this could break backwards compatibility. For the strange use case (read: mine) where sending the credentials to some of the hosts in the redirection chain and not others based on other criteria is desired, I think [custom authentication](http://docs.python-requests.org/en/latest/user/advanced/#custom-authentication) is the right approach.\n", "I'm going to reject this for now — but certainly keep it in mind for the future.\n\nThanks for the contribution!\n", "Ok, no problem.\nMight be worth adapting the new unit test to check for the cookie removal on redirect.\n" ]
https://api.github.com/repos/psf/requests/issues/837
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/837/labels{/name}
https://api.github.com/repos/psf/requests/issues/837/comments
https://api.github.com/repos/psf/requests/issues/837/events
https://github.com/psf/requests/pull/837
6,627,551
MDExOlB1bGxSZXF1ZXN0MjIzNjI5Mg==
837
Test for iter_content()
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-04T06:58:52Z
2021-09-08T16:01:02Z
2012-09-11T03:04:45Z
NONE
resolved
Take #4. Thanks @sigmavirus24
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/837/reactions" }
https://api.github.com/repos/psf/requests/issues/837/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/837.diff", "html_url": "https://github.com/psf/requests/pull/837", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/837.patch", "url": "https://api.github.com/repos/psf/requests/pulls/837" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2327773) (merged d46ac076 into c8f166f6).\n", "Glad to help. \n" ]
https://api.github.com/repos/psf/requests/issues/836
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/836/labels{/name}
https://api.github.com/repos/psf/requests/issues/836/comments
https://api.github.com/repos/psf/requests/issues/836/events
https://github.com/psf/requests/issues/836
6,620,922
MDU6SXNzdWU2NjIwOTIy
836
NTLM support
{ "avatar_url": "https://avatars.githubusercontent.com/u/340979?v=4", "events_url": "https://api.github.com/users/fruch/events{/privacy}", "followers_url": "https://api.github.com/users/fruch/followers", "following_url": "https://api.github.com/users/fruch/following{/other_user}", "gists_url": "https://api.github.com/users/fruch/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/fruch", "id": 340979, "login": "fruch", "node_id": "MDQ6VXNlcjM0MDk3OQ==", "organizations_url": "https://api.github.com/users/fruch/orgs", "received_events_url": "https://api.github.com/users/fruch/received_events", "repos_url": "https://api.github.com/users/fruch/repos", "site_admin": false, "starred_url": "https://api.github.com/users/fruch/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/fruch/subscriptions", "type": "User", "url": "https://api.github.com/users/fruch", "user_view_type": "public" }
[]
closed
true
null
[]
null
3
2012-09-03T18:44:53Z
2021-09-09T06:00:42Z
2012-09-24T14:41:11Z
NONE
resolved
python-ntlm has HTTPNtlmAuthHandler for urllib2 http://code.google.com/p/python-ntlm/ shame I have to work with urllib2, for ntlm authentication. Can someone help in implementing it in requests style ? [tried looking at the code, got me confused] Israel
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/836/reactions" }
https://api.github.com/repos/psf/requests/issues/836/timeline
null
completed
null
null
false
[ "So, based on a cursory reading of the code it looks like NTLM would be difficult to implement in Requests' style. Part of the problem is that NTLM authenticates whole connections, not individual requests. This means that you can't simply implement a subclass of `requests.AuthBase`.\n\nWhat you'd need to do is fork the library and adjust the behaviour of the `requests.Session` object to handle authentication. Sadly, I don't know NTLM at all, so I can't really help with how that should go, but implementing some of the stuff in `python-ntlm` can't hurt.\n", "FYI: urllib3 already has an, albeit old-ish, ntlm implementation: https://github.com/shazow/urllib3/tree/master/urllib3/contrib\n\nIt might need some cleanup but you should be able to piggyback on it.\n", "Closing for now. I'd like to see this in a separate package though!\n" ]
https://api.github.com/repos/psf/requests/issues/835
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/835/labels{/name}
https://api.github.com/repos/psf/requests/issues/835/comments
https://api.github.com/repos/psf/requests/issues/835/events
https://github.com/psf/requests/pull/835
6,610,692
MDExOlB1bGxSZXF1ZXN0MjIyOTQ4OA==
835
Test for iter_content()
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
6
2012-09-03T08:19:14Z
2021-09-08T17:05:43Z
2012-09-04T06:59:22Z
NONE
resolved
Replaces #834 and #823. We can do this ;)
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/835/reactions" }
https://api.github.com/repos/psf/requests/issues/835/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/835.diff", "html_url": "https://github.com/psf/requests/pull/835", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/835.patch", "url": "https://api.github.com/repos/psf/requests/pulls/835" }
true
[ "<3\n", "Actually, this appears to be against an old version of the code :(\n", "Want to do a rebase or should i deal with it? :P\n", "I give up :)\n", "@alicebob it would be fairly simple.\n\n```\n$ git branch\n develop\n master\n pullrequest\n pullrequest2\n* pullrequest3\n$ git pull --rebase git://github.com/kennethreitz/requests.git develop\n```\n\nIf there is a merge conflict at this stage, you have to resolve it and commit the difference. Otherwise, just follow this up with `git push --force origin`.\n", "done, thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/834
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/834/labels{/name}
https://api.github.com/repos/psf/requests/issues/834/comments
https://api.github.com/repos/psf/requests/issues/834/events
https://github.com/psf/requests/pull/834
6,610,132
MDExOlB1bGxSZXF1ZXN0MjIyOTI3Mg==
834
iter_content unittest
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-03T07:36:38Z
2021-09-08T16:01:02Z
2012-09-03T08:22:24Z
NONE
resolved
Test for iter_content() (replaces pullrequest #823)
{ "avatar_url": "https://avatars.githubusercontent.com/u/621306?v=4", "events_url": "https://api.github.com/users/alicebob/events{/privacy}", "followers_url": "https://api.github.com/users/alicebob/followers", "following_url": "https://api.github.com/users/alicebob/following{/other_user}", "gists_url": "https://api.github.com/users/alicebob/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/alicebob", "id": 621306, "login": "alicebob", "node_id": "MDQ6VXNlcjYyMTMwNg==", "organizations_url": "https://api.github.com/users/alicebob/orgs", "received_events_url": "https://api.github.com/users/alicebob/received_events", "repos_url": "https://api.github.com/users/alicebob/repos", "site_admin": false, "starred_url": "https://api.github.com/users/alicebob/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alicebob/subscriptions", "type": "User", "url": "https://api.github.com/users/alicebob", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/834/reactions" }
https://api.github.com/repos/psf/requests/issues/834/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/834.diff", "html_url": "https://github.com/psf/requests/pull/834", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/834.patch", "url": "https://api.github.com/repos/psf/requests/pulls/834" }
true
[ "Can you revert 520e983 ? That's no longer the case :)\n", "_sigh_ ;)\n" ]
https://api.github.com/repos/psf/requests/issues/833
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/833/labels{/name}
https://api.github.com/repos/psf/requests/issues/833/comments
https://api.github.com/repos/psf/requests/issues/833/events
https://github.com/psf/requests/pull/833
6,608,013
MDExOlB1bGxSZXF1ZXN0MjIyODQ1OA==
833
Fixes #817.
{ "avatar_url": "https://avatars.githubusercontent.com/u/240830?v=4", "events_url": "https://api.github.com/users/sigmavirus24/events{/privacy}", "followers_url": "https://api.github.com/users/sigmavirus24/followers", "following_url": "https://api.github.com/users/sigmavirus24/following{/other_user}", "gists_url": "https://api.github.com/users/sigmavirus24/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sigmavirus24", "id": 240830, "login": "sigmavirus24", "node_id": "MDQ6VXNlcjI0MDgzMA==", "organizations_url": "https://api.github.com/users/sigmavirus24/orgs", "received_events_url": "https://api.github.com/users/sigmavirus24/received_events", "repos_url": "https://api.github.com/users/sigmavirus24/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sigmavirus24/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sigmavirus24/subscriptions", "type": "User", "url": "https://api.github.com/users/sigmavirus24", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-03T03:13:19Z
2021-09-08T16:01:01Z
2012-09-11T03:05:07Z
CONTRIBUTOR
resolved
Use dicts and lists where necessary but accept both dicts and lists of 2-tuples everywhere.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/833/reactions" }
https://api.github.com/repos/psf/requests/issues/833/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/833.diff", "html_url": "https://github.com/psf/requests/pull/833", "merged_at": "2012-09-11T03:05:07Z", "patch_url": "https://github.com/psf/requests/pull/833.patch", "url": "https://api.github.com/repos/psf/requests/pulls/833" }
true
[ "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2315204) (merged 8081d7b1 into c8f166f6).\n", "Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/832
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/832/labels{/name}
https://api.github.com/repos/psf/requests/issues/832/comments
https://api.github.com/repos/psf/requests/issues/832/events
https://github.com/psf/requests/issues/832
6,602,253
MDU6SXNzdWU2NjAyMjUz
832
request 0.14.0 doesn't bytecompile with python 3.2
{ "avatar_url": "https://avatars.githubusercontent.com/u/151255?v=4", "events_url": "https://api.github.com/users/sagarun/events{/privacy}", "followers_url": "https://api.github.com/users/sagarun/followers", "following_url": "https://api.github.com/users/sagarun/following{/other_user}", "gists_url": "https://api.github.com/users/sagarun/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/sagarun", "id": 151255, "login": "sagarun", "node_id": "MDQ6VXNlcjE1MTI1NQ==", "organizations_url": "https://api.github.com/users/sagarun/orgs", "received_events_url": "https://api.github.com/users/sagarun/received_events", "repos_url": "https://api.github.com/users/sagarun/repos", "site_admin": false, "starred_url": "https://api.github.com/users/sagarun/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sagarun/subscriptions", "type": "User", "url": "https://api.github.com/users/sagarun", "user_view_type": "public" }
[]
closed
true
null
[]
null
7
2012-09-02T12:32:04Z
2021-09-09T05:30:58Z
2012-09-24T14:45:15Z
NONE
resolved
I am trying to build requests rpm using python 3.2, rpmbuild -ba ~/rpmbuild/SPECS/python-requests.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.b6OCbb Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.796rl5 running build running build_py creating build creating build/lib creating build/lib/requests copying requests/safe_mode.py -> build/lib/requests copying requests/cookies.py -> build/lib/requests copying requests/exceptions.py -> build/lib/requests copying requests/compat.py -> build/lib/requests copying requests/models.py -> build/lib/requests copying requests/hooks.py -> build/lib/requests copying requests/api.py -> build/lib/requests copying requests/_oauth.py -> build/lib/requests copying requests/defaults.py -> build/lib/requests copying requests/async.py -> build/lib/requests copying requests/structures.py -> build/lib/requests copying requests/status_codes.py -> build/lib/requests copying requests/certs.py -> build/lib/requests copying requests/sessions.py -> build/lib/requests copying requests/auth.py -> build/lib/requests copying requests/utils.py -> build/lib/requests copying requests/__init__.py -> build/lib/requests creating build/lib/requests/packages copying requests/packages/**init**.py -> build/lib/requests/packages creating build/lib/requests/packages/urllib3 copying requests/packages/urllib3/exceptions.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/filepost.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/response.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/request.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/_collections.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/poolmanager.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/util.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/__init__.py -> build/lib/requests/packages/urllib3 copying requests/packages/urllib3/connectionpool.py -> build/lib/requests/packages/urllib3 creating build/lib/requests/packages/urllib3/packages copying requests/packages/urllib3/packages/ordered_dict.py -> build/lib/requests/packages/urllib3/packages copying requests/packages/urllib3/packages/**init**.py -> build/lib/requests/packages/urllib3/packages copying requests/packages/urllib3/packages/six.py -> build/lib/requests/packages/urllib3/packages creating build/lib/requests/packages/urllib3/packages/ssl_match_hostname copying requests/packages/urllib3/packages/ssl_match_hostname/**init**.py -> build/lib/requests/packages/urllib3/packages/ssl_match_hostname creating build/lib/requests/packages/oauthlib copying requests/packages/oauthlib/common.py -> build/lib/requests/packages/oauthlib copying requests/packages/oauthlib/**init**.py -> build/lib/requests/packages/oauthlib creating build/lib/requests/packages/oauthlib/oauth1 copying requests/packages/oauthlib/oauth1/**init**.py -> build/lib/requests/packages/oauthlib/oauth1 creating build/lib/requests/packages/oauthlib/oauth1/rfc5849 copying requests/packages/oauthlib/oauth1/rfc5849/parameters.py -> build/lib/requests/packages/oauthlib/oauth1/rfc5849 copying requests/packages/oauthlib/oauth1/rfc5849/signature.py -> build/lib/requests/packages/oauthlib/oauth1/rfc5849 copying requests/packages/oauthlib/oauth1/rfc5849/utils.py -> build/lib/requests/packages/oauthlib/oauth1/rfc5849 copying requests/packages/oauthlib/oauth1/rfc5849/**init**.py -> build/lib/requests/packages/oauthlib/oauth1/rfc5849 creating build/lib/requests/packages/oauthlib/oauth2 copying requests/packages/oauthlib/oauth2/**init**.py -> build/lib/requests/packages/oauthlib/oauth2 creating build/lib/requests/packages/oauthlib/oauth2/draft25 copying requests/packages/oauthlib/oauth2/draft25/parameters.py -> build/lib/requests/packages/oauthlib/oauth2/draft25 copying requests/packages/oauthlib/oauth2/draft25/tokens.py -> build/lib/requests/packages/oauthlib/oauth2/draft25 copying requests/packages/oauthlib/oauth2/draft25/utils.py -> build/lib/requests/packages/oauthlib/oauth2/draft25 copying requests/packages/oauthlib/oauth2/draft25/**init**.py -> build/lib/requests/packages/oauthlib/oauth2/draft25 creating build/lib/requests/packages/chardet copying requests/packages/chardet/escsm.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/utf8prober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langhungarianmodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/sjisprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/latin1prober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/euckrprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/euctwprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/euckrfreq.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/escprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/mbcssm.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/jisfreq.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/charsetprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/jpcntx.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/euctwfreq.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/gb2312freq.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/big5prober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/codingstatemachine.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/chardistribution.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/constants.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langhebrewmodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langcyrillicmodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/sbcsgroupprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/hebrewprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/eucjpprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/charsetgroupprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/mbcharsetprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langbulgarianmodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/mbcsgroupprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langthaimodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/universaldetector.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/sbcharsetprober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/langgreekmodel.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/gb2312prober.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/big5freq.py -> build/lib/requests/packages/chardet copying requests/packages/chardet/**init**.py -> build/lib/requests/packages/chardet running egg_info writing requests.egg-info/PKG-INFO writing top-level names to requests.egg-info/top_level.txt writing dependency_links to requests.egg-info/dependency_links.txt reading manifest file 'requests.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'requests.egg-info/SOURCES.txt' copying requests/cacert.pem -> build/lib/requests creating build/lib/requests/packages/chardet2 copying requests/packages/chardet2/**init**.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/big5freq.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/big5prober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/chardistribution.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/charsetgroupprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/charsetprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/codingstatemachine.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/constants.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/escprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/escsm.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/eucjpprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/euckrfreq.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/euckrprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/euctwfreq.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/euctwprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/gb2312freq.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/gb2312prober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/hebrewprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/jisfreq.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/jpcntx.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langbulgarianmodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langcyrillicmodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langgreekmodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langhebrewmodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langhungarianmodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/langthaimodel.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/latin1prober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/mbcharsetprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/mbcsgroupprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/mbcssm.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/sbcharsetprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/sbcsgroupprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/sjisprober.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/test.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/universaldetector.py -> build/lib/requests/packages/chardet2 copying requests/packages/chardet2/utf8prober.py -> build/lib/requests/packages/chardet2 running build running build_py Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.Rj6Ub1 running install running install_lib creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/safe_mode.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/cookies.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname copying build/lib/requests/packages/urllib3/packages/ssl_match_hostname/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages/ssl_match_hostname copying build/lib/requests/packages/urllib3/packages/ordered_dict.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/packages/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/packages/six.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/exceptions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/filepost.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/response.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/request.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/_collections.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/poolmanager.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/util.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/__init__.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/connectionpool.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/urllib3 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/escsm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/utf8prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langhungarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/test.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sjisprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/latin1prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euckrprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euctwprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euckrfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/escprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcssm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/jisfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/charsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/jpcntx.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euctwfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/gb2312freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/big5prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/codingstatemachine.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/chardistribution.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/constants.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langhebrewmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langcyrillicmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/hebrewprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/eucjpprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/charsetgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langbulgarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langthaimodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/universaldetector.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langgreekmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/gb2312prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/big5freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet2 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/escsm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/utf8prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langhungarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sjisprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/latin1prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euckrprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euctwprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euckrfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/escprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcssm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/jisfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/charsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/jpcntx.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euctwfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/gb2312freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/big5prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/codingstatemachine.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/chardistribution.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/constants.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langhebrewmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langcyrillicmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/hebrewprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/eucjpprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/charsetgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langbulgarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langthaimodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/universaldetector.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langgreekmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/gb2312prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/big5freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/chardet creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib copying build/lib/requests/packages/oauthlib/common.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/parameters.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/signature.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth1 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/parameters.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/tokens.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib/oauth2 copying build/lib/requests/packages/oauthlib/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages/oauthlib copying build/lib/requests/packages/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests/packages copying build/lib/requests/exceptions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/compat.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/models.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/hooks.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/api.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/cacert.pem -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/_oauth.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/defaults.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/async.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/structures.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/status_codes.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/certs.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/sessions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/auth.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests copying build/lib/requests/__init__.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests running install_egg_info running egg_info writing requests.egg-info/PKG-INFO writing top-level names to requests.egg-info/top_level.txt writing dependency_links to requests.egg-info/dependency_links.txt reading manifest file 'requests.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'requests.egg-info/SOURCES.txt' Copying requests.egg-info to /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/site-packages/requests-0.14.0-py2.7.egg-info running install_scripts running install running install_lib creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/safe_mode.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/cookies.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages/ssl_match_hostname copying build/lib/requests/packages/urllib3/packages/ssl_match_hostname/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages/ssl_match_hostname copying build/lib/requests/packages/urllib3/packages/ordered_dict.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/packages/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/packages/six.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3/packages copying build/lib/requests/packages/urllib3/exceptions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/filepost.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/response.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/request.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/_collections.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/poolmanager.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/util.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/__init__.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 copying build/lib/requests/packages/urllib3/connectionpool.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/urllib3 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/escsm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/utf8prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langhungarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/test.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sjisprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/latin1prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euckrprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euctwprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euckrfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/escprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcssm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/jisfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/charsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/jpcntx.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/euctwfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/gb2312freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/big5prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/codingstatemachine.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/chardistribution.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/constants.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langhebrewmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langcyrillicmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/hebrewprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/eucjpprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/charsetgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langbulgarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/mbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langthaimodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/universaldetector.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/sbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/langgreekmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/gb2312prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/big5freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 copying build/lib/requests/packages/chardet2/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet2 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/escsm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/utf8prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langhungarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sjisprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/latin1prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euckrprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euctwprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euckrfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/escprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcssm.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/jisfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/charsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/jpcntx.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/euctwfreq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/gb2312freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/big5prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/codingstatemachine.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/chardistribution.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/constants.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langhebrewmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langcyrillicmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/hebrewprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/eucjpprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/charsetgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langbulgarianmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/mbcsgroupprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langthaimodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/universaldetector.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/sbcharsetprober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/langgreekmodel.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/gb2312prober.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/big5freq.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet copying build/lib/requests/packages/chardet/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib copying build/lib/requests/packages/oauthlib/common.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/parameters.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/signature.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/rfc5849/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1/rfc5849 copying build/lib/requests/packages/oauthlib/oauth1/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth1 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2 creating /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/parameters.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/tokens.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/draft25/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2/draft25 copying build/lib/requests/packages/oauthlib/oauth2/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/oauth2 copying build/lib/requests/packages/oauthlib/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib copying build/lib/requests/packages/**init**.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages copying build/lib/requests/exceptions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/compat.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/models.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/hooks.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/api.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/cacert.pem -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/_oauth.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/defaults.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/async.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/structures.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/status_codes.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/certs.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/sessions.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/auth.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/utils.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests copying build/lib/requests/__init__.py -> /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests running install_egg_info Writing /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests-0.14.0-py3.2.egg-info Bytecompiling .py files below /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python2.7/ using /usr/bin/python2.7 Bytecompiling .py files below /home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/ using /usr/bin/python3.2 **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/chardistribution.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/chardistribution.py", line 48 self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/charsetgroupprober.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/charsetgroupprober.py", line 44 prober.active = constants.True ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/constants.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/constants.py", line 46 False = **builtin**.False ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/escprober.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/escprober.py", line 48 codingSM.active = constants.True ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/jpcntx.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/jpcntx.py", line 132 self._mDone = constants.False # If this flag is set to constants.True, detection is done and conclusion has been made ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langbulgarianmodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langbulgarianmodel.py", line 218 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langcyrillicmodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langcyrillicmodel.py", line 287 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langgreekmodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langgreekmodel.py", line 215 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langhebrewmodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langhebrewmodel.py", line 199 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langhungarianmodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langhungarianmodel.py", line 215 'keepEnglishLetter': constants.True, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/langthaimodel.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/langthaimodel.py", line 198 'keepEnglishLetter': constants.False, ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/sbcharsetprober.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/sbcharsetprober.py", line 42 def **init**(self, model, reversed=constants.False, nameProber=None): ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/sbcsgroupprober.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/sbcsgroupprober.py", line 59 logicalHebrewProber = SingleByteCharSetProber(Win1255HebrewModel, constants.False, hebrewProber) ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/chardet/universaldetector.py'... File "/usr/lib/python3.2/site-packages/requests/packages/chardet/universaldetector.py", line 51 self.done = constants.False ^ SyntaxError: invalid syntax **\* Error compiling '/home/zer0c00l/rpmbuild/BUILDROOT/python-requests-0.14.0-1.fc17.x86_64/usr/lib/python3.2/site-packages/requests/packages/oauthlib/common.py'... File
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/832/reactions" }
https://api.github.com/repos/psf/requests/issues/832/timeline
null
completed
null
null
false
[ "Oh, that's interesting.\n\nBasically, Requests is supposed to enable chardet on Python 2 and chardet2 on Python 3. This special-casing is referred to in the setup.py, but it looks like the effects don't extend to telling Python 3 not to compile chardet.\n\nI'm guessing if you remove the chardet directory, everything will work. There's special-casing in `requests/compat.py` to import the correct package depending on the version.\n\nYou're probably more familiar with the rpm system than we are; do you have any thoughts on a long-term fix?\n", "You are correct. I removed the following directories before doing a python3 byte compilation\n\nbuild/lib/requests/packages/chardet\nbuild/lib/requests/packages/oauthlib\n\nThese packages shouldn't be there in the first place, but as i am doing python3 and python2 builds using the same spec file, the first 'python2 setup.py build' puts in these directories in build/lib/requests/ and then 'python3 setup.py build' puts in the rest of them.\n\nSo during 'python3 setup.py install' everything gets copied into the buildroot and python3 tries to bytecompile these libraries. Here is my current spec file http://sagarun.fedorapeople.org/SPECS/python-requests.spec\n\nBy the way are there any plans to use these packages as 'dependencies' instead of bundling them into the requests library? Are there any requests specific modifications done to these dependencies?\n", "Any changes needed in those libraries are done upstream and not in the copies requests keeps. I do not know exactly why those were chosen to be vendorized, however, you can get some ideas from: http://bitprophet.org/blog/2012/06/07/on-vendorizing/ and eventually http://docs.python-guide.org/en/latest/writing/structure/#vendorizing-dependencies\n", "These libraries are vendored to make it possible to easily vendor Requests itself. A bit problem with httplib2 and others is different command-line tools, for example, requiring different versions. \n\nRequests doesn't have this problem.\n\nIt also makes the experience super simple for the user.\n", "It should also be noted at this isn't actually an error — it's a warning. You can still use requests despite this warning.\n", "> These libraries are vendored to make it possible to easily vendor Requests itself.\n\n@kennethreitz \nHow about changing the way vendorization is done by including dependencies in a zip and adding an option to setup.py to unzip them? This way vendorization could be sort of opt-in.\n", "It's really not that complicated or that big of a deal.\n\nOn Oct 27, 2012, at 11:37 AM, Piotr Dobrogost [email protected] wrote:\n\n> These libraries are vendored to make it possible to easily vendor Requests itself.\n> \n> @kennethreitz \n> How about changing the way vendorization is done by including dependencies in a zip and adding an option to setup.py to unzip them? This way vendorization could be sort of opt-in.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n" ]
https://api.github.com/repos/psf/requests/issues/831
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/831/labels{/name}
https://api.github.com/repos/psf/requests/issues/831/comments
https://api.github.com/repos/psf/requests/issues/831/events
https://github.com/psf/requests/pull/831
6,601,254
MDExOlB1bGxSZXF1ZXN0MjIyNjUwNg==
831
permissive implementation of iter_content
{ "avatar_url": "https://avatars.githubusercontent.com/u/376448?v=4", "events_url": "https://api.github.com/users/slingamn/events{/privacy}", "followers_url": "https://api.github.com/users/slingamn/followers", "following_url": "https://api.github.com/users/slingamn/following{/other_user}", "gists_url": "https://api.github.com/users/slingamn/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/slingamn", "id": 376448, "login": "slingamn", "node_id": "MDQ6VXNlcjM3NjQ0OA==", "organizations_url": "https://api.github.com/users/slingamn/orgs", "received_events_url": "https://api.github.com/users/slingamn/received_events", "repos_url": "https://api.github.com/users/slingamn/repos", "site_admin": false, "starred_url": "https://api.github.com/users/slingamn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/slingamn/subscriptions", "type": "User", "url": "https://api.github.com/users/slingamn", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-09-02T08:45:33Z
2021-09-08T23:07:17Z
2012-09-02T08:47:19Z
CONTRIBUTOR
resolved
This is #781 but it respects chunk_size. This should also fix the issue from #823?
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/831/reactions" }
https://api.github.com/repos/psf/requests/issues/831/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/831.diff", "html_url": "https://github.com/psf/requests/pull/831", "merged_at": "2012-09-02T08:47:19Z", "patch_url": "https://github.com/psf/requests/pull/831.patch", "url": "https://api.github.com/repos/psf/requests/pulls/831" }
true
[ "Beautiful! Just waiting for the tests now :)\n", "This pull request [passes](http://travis-ci.org/kennethreitz/requests/builds/2309298) (merged 77cf9951 into 11758660).\n", ":sparkles: :cake: :sparkles:\n", "Requests v0.14.0 just released, which includes this awesome fix :) \n" ]
https://api.github.com/repos/psf/requests/issues/830
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/830/labels{/name}
https://api.github.com/repos/psf/requests/issues/830/comments
https://api.github.com/repos/psf/requests/issues/830/events
https://github.com/psf/requests/pull/830
6,592,501
MDExOlB1bGxSZXF1ZXN0MjIyMzk5OQ==
830
Sfufix
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
[]
closed
true
null
[]
null
4
2012-09-01T02:12:32Z
2021-09-08T16:01:01Z
2012-09-11T03:05:51Z
CONTRIBUTOR
resolved
This is for commit https://github.com/SecurityForUs/requests/commit/e35e561a55f4223b4b69312c01677042a854327c Currently if you pass proxy settings like this: ``` python proxy = {"https" : ""} req = requests.get("http://www.google.com", proxies=proxy) ``` The request will be sent through an empty proxy (""). Every request will return a 404 since it cannot connect to a non-existent proxy. While I know there should be error checking for this on the developer's side, I thought it would be helpful to pass along a fix to this as well.
{ "avatar_url": "https://avatars.githubusercontent.com/u/119893?v=4", "events_url": "https://api.github.com/users/kennethreitz/events{/privacy}", "followers_url": "https://api.github.com/users/kennethreitz/followers", "following_url": "https://api.github.com/users/kennethreitz/following{/other_user}", "gists_url": "https://api.github.com/users/kennethreitz/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kennethreitz", "id": 119893, "login": "kennethreitz", "node_id": "MDQ6VXNlcjExOTg5Mw==", "organizations_url": "https://api.github.com/users/kennethreitz/orgs", "received_events_url": "https://api.github.com/users/kennethreitz/received_events", "repos_url": "https://api.github.com/users/kennethreitz/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kennethreitz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kennethreitz/subscriptions", "type": "User", "url": "https://api.github.com/users/kennethreitz", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/830/reactions" }
https://api.github.com/repos/psf/requests/issues/830/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/830.diff", "html_url": "https://github.com/psf/requests/pull/830", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/830.patch", "url": "https://api.github.com/repos/psf/requests/pulls/830" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2300350) (merged 784ee71f into 11758660).\n", "Sorry for opening this up twice, I was hoping to clean up the commit list it showed but didn't work as planned.\n", "You may want to fork another branch off of the official develop branch, e.g.,\n\n```\n$ git remote add upstream git://github.com/kennethreitz/requests.git\n$ git checkout develop\n$ git pull upstream develop\n$ git checkout -b fix_proxies\n$ git cherry-pick sfufix e35e561..784ee71 # or something similar\n```\n\nHope this helps.\n", "Thanks for the awesome patch! Would you mind resending it with the advise given by @sigmavirus24? Thanks!\n" ]
https://api.github.com/repos/psf/requests/issues/829
https://api.github.com/repos/psf/requests
https://api.github.com/repos/psf/requests/issues/829/labels{/name}
https://api.github.com/repos/psf/requests/issues/829/comments
https://api.github.com/repos/psf/requests/issues/829/events
https://github.com/psf/requests/pull/829
6,592,344
MDExOlB1bGxSZXF1ZXN0MjIyMzkzNg==
829
Develop
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
[]
closed
true
null
[]
null
2
2012-09-01T01:43:24Z
2021-09-08T16:01:00Z
2012-09-01T02:11:49Z
CONTRIBUTOR
resolved
This is for commit https://github.com/SecurityForUs/requests/commit/e35e561a55f4223b4b69312c01677042a854327c Currently if you pass proxy settings like this: ``` python proxy = {"https" : ""} req = requests.get("http://www.google.com", proxies=proxy) ``` The request will be sent through an empty proxy (""). Every request will return a 404 since it cannot connect to a non-existent proxy. While I know there should be error checking for this on the developer's side, I thought it would be helpful to pass along a fix to this as well.
{ "avatar_url": "https://avatars.githubusercontent.com/u/1146703?v=4", "events_url": "https://api.github.com/users/SecurityForUs/events{/privacy}", "followers_url": "https://api.github.com/users/SecurityForUs/followers", "following_url": "https://api.github.com/users/SecurityForUs/following{/other_user}", "gists_url": "https://api.github.com/users/SecurityForUs/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/SecurityForUs", "id": 1146703, "login": "SecurityForUs", "node_id": "MDQ6VXNlcjExNDY3MDM=", "organizations_url": "https://api.github.com/users/SecurityForUs/orgs", "received_events_url": "https://api.github.com/users/SecurityForUs/received_events", "repos_url": "https://api.github.com/users/SecurityForUs/repos", "site_admin": false, "starred_url": "https://api.github.com/users/SecurityForUs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SecurityForUs/subscriptions", "type": "User", "url": "https://api.github.com/users/SecurityForUs", "user_view_type": "public" }
{ "+1": 0, "-1": 0, "confused": 0, "eyes": 0, "heart": 0, "hooray": 0, "laugh": 0, "rocket": 0, "total_count": 0, "url": "https://api.github.com/repos/psf/requests/issues/829/reactions" }
https://api.github.com/repos/psf/requests/issues/829/timeline
null
null
false
{ "diff_url": "https://github.com/psf/requests/pull/829.diff", "html_url": "https://github.com/psf/requests/pull/829", "merged_at": null, "patch_url": "https://github.com/psf/requests/pull/829.patch", "url": "https://api.github.com/repos/psf/requests/pulls/829" }
true
[ "This pull request [fails](http://travis-ci.org/kennethreitz/requests/builds/2300273) (merged e35e561a into 11758660).\n", "Probably should've named the first var name something else besides \"type\". Can push a new commit if requested.\n" ]