How can I escape @ symbol in mail ID while using extra-index-url

Viewed 28

Here suppose, I'm using one mail id like xyz.companyname@gmail.com then when I'm trying to access this mail id for authentication, @ symbol is getting converted to %40.

But here, I need @ symbol to use my mail id as it is.

1 Answers

Just use the urllib.parse.unquote to replace %xx escapes with their single-character equivalent.

Try the following code:

import urllib.parse
escapedEmail = 'xyz.companyname%40gmail.com'
print(urllib.parse.unquote(escapedEmail))
# Prints: 'xyz.companyname@gmail.com'
Related