Ramin Farajpour Cami added the comment:
no close plz,
i using python 2.7.3 i get this output without "\n"?
code:
json_obj='{"userName": "admin", "password": "admin"}'
enc = json_obj.encode("base64")
print enc
enc_sec = re.sub('\n$','',enc)
print enc_sec
sec = enc_sec.encode("base64")
print sec
Output:
{"userName": "admin", "password": "admin"}
eyJ1c2VyTmFtZSI6ICJhZG1pbiIsICJwYXNzd29yZCI6ICJhZG1pbiJ9
ZXlKMWMyVnlUbUZ0WlNJNklDSmhaRzFwYmlJc0lDSndZWE56ZDI5eVpDSTZJQ0poWkcxcGJpSjk=
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25075>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com