# HG changeset patch # User Sebastien Jodogne # Date 1618820923 -7200 # Node ID 686f189a903d7b47d9e320971dac48a0e5f5c06f # Parent 6adeaff62b427404fec001219d544fed5e0e9d5c# Parent 844ec5ecb6ef1321e73985255776a63eea276a8b integration mainline->db-changes diff -r 6adeaff62b42 -r 686f189a903d NEWS --- a/NEWS Fri Apr 16 17:45:02 2021 +0200 +++ b/NEWS Mon Apr 19 10:28:43 2021 +0200 @@ -26,6 +26,7 @@ ----------- * Use the local timezone for query/retrieve in the Orthanc Explorer interface (was UTC before) +* Fix "OrthancServer/Resources/Samples/Python/Replicate.py" for Python 3.x * Upgraded dependencies for static builds (notably on Windows and LSB): - civetweb 1.14 diff -r 6adeaff62b42 -r 686f189a903d OrthancServer/Resources/Samples/Python/Replicate.py --- a/OrthancServer/Resources/Samples/Python/Replicate.py Fri Apr 16 17:45:02 2021 +0200 +++ b/OrthancServer/Resources/Samples/Python/Replicate.py Mon Apr 19 10:28:43 2021 +0200 @@ -51,7 +51,12 @@ # Authentication (for some weird reason, this method does not # always work) # http://en.wikipedia.org/wiki/Basic_access_authentication - headers['authorization'] = 'Basic ' + base64.b64encode(username + ':' + password) + + # The ".encode()" and ".decode()" below fix the following issue: + # https://groups.google.com/g/orthanc-users/c/KZ_iYOet5IQ/m/AUQWiSiAAQAJ + credentials = (username + ':' + password) + credentials_base64 = base64.b64encode(credentials.encode("ascii")).decode("ascii") + headers['authorization'] = 'Basic ' + credentials_base64 return headers