Mh, looks like a bug. Could you file an issue for that?

thanks a lot,
robert

On Mon, May 16, 2011 at 1:54 AM, IgorNovak <[email protected]> wrote:

> Hi. Recently I've faced with the same problem. It appeared in v1.4.3
> firstly but since it didn't bother me a lot I did nothing hoping it
> would be fixed in v1.5.0. However it still isn't.
>
> The error appears in this place:
>
> urlfetch_stub.py (Version 1.5.0)
> 293 if payload is not None:
> 294   escaped_payload = payload.encode('string_escape')
> 295 else:
> 296   escaped_payload = payload
> 297 logging.debug('Making HTTP request: host = %s, '
> 298               'url = %s, payload = %s, headers = %s',
> 299               host, url, escaped_payload, adjusted_headers)
>
> In my case the type of payload variable is unicode, that's why the
> TypeError appears. There was no problem before v1.4.3 because the
> encode method wasn't used:
>
> urlfetch_stub.py (Version 1.4.2)
> 228 logging.debug('Making HTTP request: host = %s, '
> 229               'url = %s, payload = %s, headers = %s',
> 230               host, url, payload, adjusted_headers)
>
> As you can see this code doesn't play an important role, so I can just
> comment out it and everything will work fine. However I'm afraid this
> can cause more serious problems in future.
>
> So the question: is it a bug or new behavior? In first case I can just
> wait for fixing it. In second case I have to change my code in order
> to avoid this problem.
>
> On Mar 31, 3:15 am, Dave Peck <[email protected]> wrote:
> > Looking at this further, it looks like Braintree is using
> > httplib.HTTPSConnection().request() with a unicode body. My read of
> > the documentation is that the body should be bytes by the time you
> > call request, so I think this is a Braintree API error rather than an
> > App Engine SDK error.
> >
> > Does this sound like a reasonable conclusion?
> >
> > Thanks,
> > Dave
> >
> > On Mar 30, 4:54 pm, Dave Peck <[email protected]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > I just updgraded to 1.4.3, and now see this error when performing URL
> > > fetches:
> >
> > > TypeError
> > > Exception Value:
> > > escape_encode() argument 1 must be string, not unicode
> > > Exception Location:
> /Applications/GoogleAppEngineLauncher.app/Contents/
> > > Resources/GoogleAppEngine-default.bundle/Contents/Resources/
> > > google_appengine/google/appengine/api/urlfetch_stub.py in
> > > _RetrieveURL, line 283
> >
> > > This is happening inside app engine SDK code, which is in turn being
> > > tickled by Braintree's payment API. This was not a problem in previous
> > > versions of the App Engine SDK, though potentially it is a problem
> > > with Braintree, not the SDK.
> >
> > > Could someone investigate and advise?
> >
> > > Thanks,
> > > Dave
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to