kennethreitz/requests — pull request #720 by erlichmen (2012-07-12 20:04:32+00:00)
Title: Workaround for an ImportError on AppEngine

On Google App Engine (runtime 2.7 thread safe) there is a ImportError
when ever calling get_netrc_auth (stacktrace at the end of the comment)
I'm adding a except pass on the Import error to workaround that error. I
will open an issues on the App Engine tracker so that will fix that on
thier end also.

File "/base/data/home/apps/.../requests/api.py", line 87, in post
return request('post', url, data=data, **kwargs)
File "/base/data/home/apps/.../requests/safe_mode.py", line 37, in
wrapped
return function(method, url, **kwargs)
File "/base/data/home/apps/.../requests/api.py", line 42, in request
return s.request(method=method, url=url, **kwargs)
File "/base/data/home/apps/.../requests/sessions.py", line 230, in
request
r.send(prefetch=prefetch)
File "/base/data/home/apps/.../requests/models.py", line 483, in send
self.auth = get_netrc_auth(url)
File "/base/data/home/apps/.../requests/utils.py", line 79, in
get_netrc_auth
for loc in locations:
File "/base/data/home/apps/.../requests/utils.py", line 76, in
locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES)
File "/base/python27_runtime/python27_dist/lib/python2.7/posixpath.py",
line 259, in expanduser
import pwd
ImportError: No module named pwd