projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a4e23d4
)
getbinpkg: fix base64 usage for python3
author
Zac Medico
<zmedico@gentoo.org>
Mon, 14 May 2012 03:29:07 +0000
(20:29 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Mon, 14 May 2012 03:29:07 +0000
(20:29 -0700)
pym/portage/getbinpkg.py
patch
|
blob
|
history
diff --git
a/pym/portage/getbinpkg.py
b/pym/portage/getbinpkg.py
index 579a46f9b7eb9a5a6c316aa47012d31cfa185280..7dec20a4418a46ea0b7cf25c6996fd0f5044d4fc 100644
(file)
--- a/
pym/portage/getbinpkg.py
+++ b/
pym/portage/getbinpkg.py
@@
-158,11
+158,16
@@
def create_conn(baseurl,conn=None):
http_headers = {}
http_params = {}
if username and password:
+ try:
+ encodebytes = base64.encodebytes
+ except AttributeError:
+ # Python 2
+ encodebytes = base64.encodestring
http_headers = {
- "Authorization": "Basic %s" %
-
base64.encodestring("%s:%s" % (username, password
)).replace(
- "\012",
- ""
+ b"Authorization": "Basic %s" % \
+
encodebytes(_unicode_encode("%s:%s" % (username, password)
)).replace(
+
b
"\012",
+
b
""
),
}