changeset 610:ec657d1a62a6 Orthanc-1.12.3

fix compatibility with python3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 31 Jan 2024 12:18:20 +0100
parents a8e49d30f634
children 09fc76fbd46d
files Plugins/CGet/Run.py Plugins/Recycling/Run.py Plugins/WebDav/Run.py Tests/CheckDicomTls.py Tests/CheckHttpServerSecurity.py Tests/CheckIngestTranscoding.py Tests/CheckScuTranscoding.py Tests/CheckZipStreams.py
diffstat 8 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/CGet/Run.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Plugins/CGet/Run.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Plugins/Recycling/Run.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Plugins/Recycling/Run.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Plugins/WebDav/Run.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Plugins/WebDav/Run.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
@@ -415,7 +415,7 @@
 
 
     def test_upload_zip(self):
-        f = StringIO()
+        f = BytesIO()
         with zipfile.ZipFile(f, 'w') as z:
             z.writestr('hello/world/invalid.txt', 'Hello world')
             with open(GetDatabasePath('DummyCT.dcm'), 'rb') as g:
--- a/Tests/CheckDicomTls.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Tests/CheckDicomTls.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Tests/CheckHttpServerSecurity.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Tests/CheckHttpServerSecurity.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Tests/CheckIngestTranscoding.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Tests/CheckIngestTranscoding.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Tests/CheckScuTranscoding.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Tests/CheckScuTranscoding.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
--- a/Tests/CheckZipStreams.py	Wed Jan 31 11:36:37 2024 +0100
+++ b/Tests/CheckZipStreams.py	Wed Jan 31 12:18:20 2024 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.7
+#!/usr/bin/env python3
 
 # Orthanc - A Lightweight, RESTful DICOM Store
 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
@@ -136,7 +136,7 @@
 
             except Exception as e:
                 Assert(streaming == False)
-                Assert(e[0] == 500)  # HTTP status code 500
+                Assert(e.args[0] == 500)  # HTTP status code 500
                 print('ok, got none archive')
                 queue.put(True)