-1

I am using Flask-OAuthlib and it works fine in my local development environment but as soon as I deploy the code to the live GAE environment I get the following error:

File "/base/data/home/apps/s~xxxx/test-20141215.381476653039842303/lib/oauthlib/common.py", line 129, in urldecode
    raise ValueError(error % (set(query) - urlencoded, query))
ValueError: Error trying to decode a non urlencoded string. Found invalid characters: set([u'!']) in the string: 

Using that same password which includes the ! character works fine locally, I don't understand what the issue is when the app is deployed.

I'm using Python 2.7.6 locally.

For the URL request I'm using: uri = add_params_to_uri(url, params) which is part of oauthlib.common

artooro
  • 1,479
  • 1
  • 8
  • 20

1 Answers1

0

One solution to this specific issue is to edit oauthlib/common.py line 110:

Change:

urlencoded = set(always_safe) | set('=&;%+~,*@')

To:

urlencoded = set(always_safe) | set('=&;%+~,*@!')

And then the ! character is accepted on the GAE live environment as well.

artooro
  • 1,479
  • 1
  • 8
  • 20
  • If you this that the original library should be improved you can make a pull request https://github.com/idan/oauthlib/blob/master/oauthlib/common.py#L110 – Dmytro Sadovnychyi Jan 13 '15 at 04:45