trungn1992 / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

httplib2.Http fails if given a unicode cache path under Python 2.x #136

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
httplib2 assumes that all paths are instances of str. While this holds true on 
Python 3.x and seems to hold true on Linux, it bit me on Windows under Python 
2.x when setting the cache.

The solution is to (with whatever Py3 compatibility approach you prefer) check 
against basestring rather than str when running under Python 2.x.

What steps will reproduce the problem?
1. Install httplib2 
2. Instantiate httplib2.Http with a unicode cache path
3. Try to load a URL using Http.request().

What is the expected output? What do you see instead?
Under Linux, this works as expected. On Windows, it errors out on line 1025 
because unicode objects don't have .get().

What version of the product are you using? On what operating system?
httplib2 0.6.0 on both Gentoo Linux and Windows XP. (Because I don't feel like 
buying a newer version of Windows just to run py2exe in VirtualBox)

Original issue reported on code.google.com by stephan....@gmail.com on 23 Mar 2011 at 1:36

GoogleCodeExporter commented 8 years ago

Original comment by joe.gregorio@gmail.com on 6 Jun 2011 at 8:59