question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

utf-8 passwords in url don't work

See original GitHub issue

Summary:

curl -s --url http://user1:enganação@127.0.0.1:8080 --data '{"method": "help"}' works

#!/usr/bin/env python2
import requests
import json
payload = {'method': 'help'}
url = 'http://user1:enganação@127.0.0.1:8080'
requests.post(url, headers={'Content-type': 'text/plain; charset=utf-8'}, data=json.dumps(payload))

also works.

But… use #!/usr/bin/env python3 instead, and it doesn’t work anymore. requests messes things up.

Expected Result

Work as curl and requests in python2 do.

Actual Result

requests in python3 messes with encoding.

Reproduction Steps

import requests
import json
payload = {'method': 'help'}
url = 'http://user1:enganação@127.0.0.1:8080'
requests.post(url, headers={'Content-type': 'text/plain; charset=utf-8'}, data=json.dumps(payload))

System Information

Python 3.5.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rozuurcommented, Oct 3, 2018

I was asking to work on fixing it. Nevermind, you have closed it.

0reactions
emmnxcommented, Oct 3, 2018

@rozuur what do you mean?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can urls have UTF-8 characters? - Stack Overflow
1 Answer 1 · You probably mean "Unicode" when you write "UTF-8". · Actually they both amount to "no". · +1 @deceze (-:...
Read more >
PuTTy Windows SSH doesn't accept UTF-8 password
I'm unable to login through ssh using PuTTy on windows. Everything works fine on linux and mac. Any idea or good alternative?
Read more >
Pages with utf-8 name don't work properly under SSR #10084
As a workaround you can use dynamic page [page and switch case on pages names in utf8 pages name.
Read more >
UTF8 username/password failing to authenticate with JAAS ...
With UTF8 characters outside the ASCII range the username/password flowed from the login form doesn't seem to reach the JAAS module as UTF8....
Read more >
261929 - Consider sending urls in UTF-8 by default (images ...
Unchecking the "Always send URLs as UTF-8" makes it not work in MSIE6. ... Setting network.standard-url.encode-utf8 makes it work in Mozilla.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found