##// END OF EJS Templates
py3: ensure the HTTP password manager returns strings, not bytes...
Matt Harbison -
r41730:349c8879 default
parent child Browse files
Show More
@@ -65,7 +65,7 b' class passwordmgr(object):'
65 user, passwd = pycompat.bytesurl(user), pycompat.bytesurl(passwd)
65 user, passwd = pycompat.bytesurl(user), pycompat.bytesurl(passwd)
66 if user and passwd:
66 if user and passwd:
67 self._writedebug(user, passwd)
67 self._writedebug(user, passwd)
68 return (user, passwd)
68 return (pycompat.strurl(user), pycompat.strurl(passwd))
69
69
70 if not user or not passwd:
70 if not user or not passwd:
71 res = httpconnectionmod.readauthforuri(self.ui, authuri, user)
71 res = httpconnectionmod.readauthforuri(self.ui, authuri, user)
@@ -93,7 +93,7 b' class passwordmgr(object):'
93
93
94 self.passwddb.add_password(realm, authuri, user, passwd)
94 self.passwddb.add_password(realm, authuri, user, passwd)
95 self._writedebug(user, passwd)
95 self._writedebug(user, passwd)
96 return (user, passwd)
96 return (pycompat.strurl(user), pycompat.strurl(passwd))
97
97
98 def _writedebug(self, user, passwd):
98 def _writedebug(self, user, passwd):
99 msg = _('http auth: user %s, password %s\n')
99 msg = _('http auth: user %s, password %s\n')
@@ -225,9 +225,8 b' test http authentication'
225 > return opener
225 > return opener
226 > EOF
226 > EOF
227
227
228 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py || true
228 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
229 abort: HTTP Error 403: bad user (py3 !)
229 5fed3813f7f5
230 5fed3813f7f5 (no-py3 !)
231
230
232 #if no-reposimplestore
231 #if no-reposimplestore
233 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
232 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
@@ -383,14 +382,13 b' test http authentication'
383 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
382 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
384 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
383 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
385 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
384 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
386 "GET /?cmd=capabilities HTTP/1.1" 403 - x-hgtest-authtype:Digest (py3 !)
385 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
387 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest (no-py3 !)
386 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
388 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
387 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
389 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
388 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
390 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
389 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
390 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
392 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
393 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest (no-py3 !)
394 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
392 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
395 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
393 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
396 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
394 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
@@ -461,7 +459,6 b' check error log'
461 $ cat error.log
459 $ cat error.log
462
460
463 $ cat errors2.log
461 $ cat errors2.log
464 $LOCALIP - - [$ERRDATE$] HG error: No hash found for user/realm "b'user'/mercurial" (glob) (py3 !)
465
462
466 check abort error reporting while pulling/cloning
463 check abort error reporting while pulling/cloning
467
464
General Comments 0
You need to be logged in to leave comments. Login now