My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Mar 08, 2010
    issue 12 (Default empty headers aren't safely defined in request_*()) reported by dmarclay.rs   -   Comme python mistake. It causes a real problem here when the function is called several times with headers uninitialized : added headers are kept in next call. Sorry to be short on details. There is a quick fix, but this could be fixed better. =================================================================== --- restful_lib.py (revision 12) +++ restful_lib.py (working copy) @@ -79,6 +79,7 @@ return guessed_mimetype or 'application/octet-stream' def request(self, resource, method = "get", args = None, body = None, filename=None, headers={}): + headers = headers or {} ## prevents old headers to be carried along with further requests params = None path = resource headers['User-Agent'] = 'Basic Agent'
    Comme python mistake. It causes a real problem here when the function is called several times with headers uninitialized : added headers are kept in next call. Sorry to be short on details. There is a quick fix, but this could be fixed better. =================================================================== --- restful_lib.py (revision 12) +++ restful_lib.py (working copy) @@ -79,6 +79,7 @@ return guessed_mimetype or 'application/octet-stream' def request(self, resource, method = "get", args = None, body = None, filename=None, headers={}): + headers = headers or {} ## prevents old headers to be carried along with further requests params = None path = resource headers['User-Agent'] = 'Basic Agent'
  • Mar 07, 2010
    issue 10 (Is it possible to change the licensing or dual license it so...) commented on by qwa...@gmail.com   -   I think it is very unlikely that this project will change its license - it includes GPL code from other projects. Also, it doesn't appear that this project is being maintained anymore. So, does anyone know of an alternative with a more liberal license?
    I think it is very unlikely that this project will change its license - it includes GPL code from other projects. Also, it doesn't appear that this project is being maintained anymore. So, does anyone know of an alternative with a more liberal license?
  • Mar 04, 2010
    issue 11 (adding a trailing / into uri at the end in line 140 ) reported by phamductri   -   line 140 of restful_lib.py u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path) this will add a trailing '/' into the end of uri, even though if I specifically make a uri that does not have a '/' (i.e request is http://locahost/resource becomes http://localhost/resource/ This pose a significant problem if the server does validate uri patterns for resource. I'm not an expert on REST, but can you please provide explanation for adding that '/' ? Thanks,
    line 140 of restful_lib.py u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path) this will add a trailing '/' into the end of uri, even though if I specifically make a uri that does not have a '/' (i.e request is http://locahost/resource becomes http://localhost/resource/ This pose a significant problem if the server does validate uri patterns for resource. I'm not an expert on REST, but can you please provide explanation for adding that '/' ? Thanks,

Older

  • Dec 07, 2009
    issue 10 (Is it possible to change the licensing or dual license it so...) reported by r.infimate   -   Current it is GPL. Is it possible to MIT or BSD the license so that i can use it in a commercial app.
    Current it is GPL. Is it possible to MIT or BSD the license so that i can use it in a commercial app.
  • Nov 10, 2009
    issue 9 (A patch to make this module distributable) reported by jfunk+go...@funktronics.ca   -   Here's a patch that makes this module distributable, and installable.
    Here's a patch that makes this module distributable, and installable.
  • Oct 12, 2009
    issue 8 (Packaging request) reported by drkjam   -   Any chance of packaging this release as a distutils and/or setuptools package?
    Any chance of packaging this release as a distutils and/or setuptools package?
  • Oct 12, 2009
    issue 7 (Usability issue with failing TCP connections) reported by drkjam   -   What steps will reproduce the problem? 1. Assuming nothing listening on 127.0.0.1 port 80 ... 2. Run the following sample code ... >>> from restful_lib import Connection >>> c = Connection('http://localhost' >>> print c.request('/api/foo/', method='GET') What is the expected output? Some kind of error message/exception stating 'connection refused' or 'connection failed'. What do you see instead? The rather cryptic AttributeError (with traceback) :- Traceback (most recent call last): File "/tmp/test2.py", line 4, in <module> print c.request('/api/foo/', method='GET') File "/tmp/restful_lib.py", line 127, in request resp, content = self.h.request(u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path)), method.upper(), body=body, headers=headers ) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 1101, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 887, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 859, in _conn_request response = conn.getresponse() File "/usr/lib/python2.5/httplib.py", line 926, in getresponse method=self._method) File "/usr/lib/python2.5/httplib.py", line 324, in __init__ self.fp = sock.makefile('rb', 0) AttributeError: 'NoneType' object has no attribute 'makefile' What version of the product are you using? Release 0.2 Any other information? This does not occur when an HTTP server is up and listening for connections ;-) Not sure if this is a problem with underlying httplib2 library or the way in which it is being called.
    What steps will reproduce the problem? 1. Assuming nothing listening on 127.0.0.1 port 80 ... 2. Run the following sample code ... >>> from restful_lib import Connection >>> c = Connection('http://localhost' >>> print c.request('/api/foo/', method='GET') What is the expected output? Some kind of error message/exception stating 'connection refused' or 'connection failed'. What do you see instead? The rather cryptic AttributeError (with traceback) :- Traceback (most recent call last): File "/tmp/test2.py", line 4, in <module> print c.request('/api/foo/', method='GET') File "/tmp/restful_lib.py", line 127, in request resp, content = self.h.request(u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path)), method.upper(), body=body, headers=headers ) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 1101, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 887, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "/usr/lib/python2.5/site-packages/httplib2/__init__.py", line 859, in _conn_request response = conn.getresponse() File "/usr/lib/python2.5/httplib.py", line 926, in getresponse method=self._method) File "/usr/lib/python2.5/httplib.py", line 324, in __init__ self.fp = sock.makefile('rb', 0) AttributeError: 'NoneType' object has no attribute 'makefile' What version of the product are you using? Release 0.2 Any other information? This does not occur when an HTTP server is up and listening for connections ;-) Not sure if this is a problem with underlying httplib2 library or the way in which it is being called.
  • Oct 11, 2009
    issue 6 (User-Agent header is hardcoded) reported by eero.afheurlin   -   It should be possible to override the User-Agent header. Something along the following should do it if not headers.get('User-Agent', None): headers['User-Agent'] = 'Basic Agent'
    It should be possible to override the User-Agent header. Something along the following should do it if not headers.get('User-Agent', None): headers['User-Agent'] = 'Basic Agent'
  • Oct 10, 2009
    issue 5 (__init__.py missing) reported by eero.afheurlin   -   Thus cannot install as site package and import. the following line in the file should be enough: from restful_lib import *
    Thus cannot install as site package and import. the following line in the file should be enough: from restful_lib import *
  • Oct 06, 2009
    issue 4 (Patch for POST body) reported by tarasm   -   I made the following changes 1. Added ability to POST body 2. Added test case 3. I change keywords in some functions to **kwards ( I don't think I needed to do that, but I did)
    I made the following changes 1. Added ability to POST body 2. Added test case 3. I change keywords in some functions to **kwards ( I don't think I needed to do that, but I did)
  • Sep 30, 2009
    REST_for_Google_App_Engine (REST client based on the Google app engine's 'urlfetch' clas...) Wiki page commented on by yinjunjun   -   dsfsdf
    dsfsdf
  • Sep 09, 2009
    issue 3 (Problem with file uploading) reported by nicolaslara   -   It is not possible to upload files along with other parameters. I did a simple hack to get it working. I omitted some style issues (like having the parameter filename keep its name even though it actually receives a file object now) because I don't know how those things are supposed to interact with the rest of the code. I am sorry I'm sending the whole file instead of a patch but I'm not tracking the repo. I hope this helps, Cheers Nicolas
    It is not possible to upload files along with other parameters. I did a simple hack to get it working. I omitted some style issues (like having the parameter filename keep its name even though it actually receives a file object now) because I don't know how those things are supposed to interact with the rest of the code. I am sorry I'm sending the whole file instead of a patch but I'm not tracking the repo. I hope this helps, Cheers Nicolas
  • Jul 22, 2009
    issue 1 (simple HTTPS request fails with TypeError: a float is requir...) commented on by portnoy   -   This issue belongs to httplib2 and python 2.6. It is resolved by patching httplib2. See here: http://code.google.com/p/httplib2/issues/detail?id=39
    This issue belongs to httplib2 and python 2.6. It is resolved by patching httplib2. See here: http://code.google.com/p/httplib2/issues/detail?id=39
  • Jun 29, 2009
    issue 2 (request method ignores User-Agent header) reported by bradley.p.allen   -   Connection.request() overwrites any value for User-Agent supplied in a dict value for the headers parameter with 'Basic Agent'. It should instead test for the presence of a value for key 'User-Agent' before writing a default value.
    Connection.request() overwrites any value for User-Agent supplied in a dict value for the headers parameter with 'Basic Agent'. It should instead test for the presence of a value for key 'User-Agent' before writing a default value.
  • May 26, 2009
    issue 1 (simple HTTPS request fails with TypeError: a float is requir...) commented on by jar...@jaraco.com   -   This appears to be fixed in the trunk of httplib2.
    This appears to be fixed in the trunk of httplib2.
  • May 26, 2009
    issue 1 (simple HTTPS request fails with TypeError: a float is requir...) reported by jar...@jaraco.com   -   What steps will reproduce the problem? >>> from restful_lib import Connection >>> conn = Connection('https://www.google.com' >>> conn.request_get('foo') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "restful_lib.py", line 62, in request_get return self.request(resource, "get", args, headers=headers) File "restful_lib.py", line 140, in request resp, content = self.h.request(u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path)), method.upper(), body=body, headers=headers ) File "httplib2\__init__.py", line 1051, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "httplib2\__init__.py", line 855, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "httplib2\__init__.py", line 824, in _conn_request conn.request(method, request_uri, body, headers) File "C:\python\lib\httplib.py", line 874, in request self._send_request(method, url, body, headers) File "C:\python\lib\httplib.py", line 911, in _send_request self.endheaders() File "C:\python\lib\httplib.py", line 868, in endheaders self._send_output() File "C:\python\lib\httplib.py", line 740, in _send_output self.send(msg) File "C:\python\lib\httplib.py", line 699, in send self.connect() File "httplib2\__init__.py", line 737, in connect sock.settimeout(self.timeout) File "<string>", line 1, in settimeout TypeError: a float is required This is a checkout of the latest SVN trunk running on Windows Vista 64-bit Python 2.6 64-bit. This problem doesn't seem to happen with an HTTP request because the order in which the httplib2.HTTPConnectionWithTimout.timeout member is set.
    What steps will reproduce the problem? >>> from restful_lib import Connection >>> conn = Connection('https://www.google.com' >>> conn.request_get('foo') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "restful_lib.py", line 62, in request_get return self.request(resource, "get", args, headers=headers) File "restful_lib.py", line 140, in request resp, content = self.h.request(u"%s://%s%s" % (self.scheme, self.host, u'/'.join(request_path)), method.upper(), body=body, headers=headers ) File "httplib2\__init__.py", line 1051, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "httplib2\__init__.py", line 855, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "httplib2\__init__.py", line 824, in _conn_request conn.request(method, request_uri, body, headers) File "C:\python\lib\httplib.py", line 874, in request self._send_request(method, url, body, headers) File "C:\python\lib\httplib.py", line 911, in _send_request self.endheaders() File "C:\python\lib\httplib.py", line 868, in endheaders self._send_output() File "C:\python\lib\httplib.py", line 740, in _send_output self.send(msg) File "C:\python\lib\httplib.py", line 699, in send self.connect() File "httplib2\__init__.py", line 737, in connect sock.settimeout(self.timeout) File "<string>", line 1, in settimeout TypeError: a float is required This is a checkout of the latest SVN trunk running on Windows Vista 64-bit Python 2.6 64-bit. This problem doesn't seem to happen with an HTTP request because the order in which the httplib2.HTTPConnectionWithTimout.timeout member is set.
 
Powered by Google Project Hosting