From 3e558385a5ef0b98f6a85e1d4ac982f58affa0be Mon Sep 17 00:00:00 2001 From: pommfresser Date: Sun, 19 Apr 2026 11:57:00 +0200 Subject: [PATCH 1/3] Fix fd and filename init errors --- testcode/BenchmarkTest00006.py | 3 +++ testcode/BenchmarkTest00007.py | 3 +++ testcode/BenchmarkTest00085.py | 3 +++ testcode/BenchmarkTest00086.py | 3 +++ testcode/BenchmarkTest00175.py | 3 +++ testcode/BenchmarkTest00176.py | 3 +++ testcode/BenchmarkTest00177.py | 3 +++ testcode/BenchmarkTest00178.py | 3 +++ testcode/BenchmarkTest00355.py | 3 +++ testcode/BenchmarkTest00356.py | 3 +++ testcode/BenchmarkTest00441.py | 3 +++ testcode/BenchmarkTest00442.py | 3 +++ testcode/BenchmarkTest00521.py | 3 +++ testcode/BenchmarkTest00522.py | 3 +++ testcode/BenchmarkTest00741.py | 3 +++ testcode/BenchmarkTest00831.py | 3 +++ testcode/BenchmarkTest00832.py | 3 +++ testcode/BenchmarkTest00833.py | 3 +++ testcode/BenchmarkTest00914.py | 3 +++ testcode/BenchmarkTest00915.py | 3 +++ testcode/BenchmarkTest00916.py | 3 +++ testcode/BenchmarkTest00917.py | 3 +++ testcode/BenchmarkTest01008.py | 3 +++ testcode/BenchmarkTest01108.py | 3 +++ testcode/BenchmarkTest01179.py | 3 +++ testcode/BenchmarkTest01180.py | 3 +++ testcode/BenchmarkTest01222.py | 3 +++ 27 files changed, 81 insertions(+) diff --git a/testcode/BenchmarkTest00006.py b/testcode/BenchmarkTest00006.py index 4f4d7574..f9621fc3 100644 --- a/testcode/BenchmarkTest00006.py +++ b/testcode/BenchmarkTest00006.py @@ -49,6 +49,9 @@ def BenchmarkTest00006_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00007.py b/testcode/BenchmarkTest00007.py index fdbbc5e9..8fb3a3bb 100644 --- a/testcode/BenchmarkTest00007.py +++ b/testcode/BenchmarkTest00007.py @@ -45,6 +45,9 @@ def BenchmarkTest00007_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00085.py b/testcode/BenchmarkTest00085.py index 5be9c786..5717d1c0 100644 --- a/testcode/BenchmarkTest00085.py +++ b/testcode/BenchmarkTest00085.py @@ -40,6 +40,9 @@ def BenchmarkTest00085_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00086.py b/testcode/BenchmarkTest00086.py index 4810222f..07d2137c 100644 --- a/testcode/BenchmarkTest00086.py +++ b/testcode/BenchmarkTest00086.py @@ -41,6 +41,9 @@ def BenchmarkTest00086_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00175.py b/testcode/BenchmarkTest00175.py index 2510f13e..a6a83b87 100644 --- a/testcode/BenchmarkTest00175.py +++ b/testcode/BenchmarkTest00175.py @@ -44,6 +44,9 @@ def BenchmarkTest00175_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00176.py b/testcode/BenchmarkTest00176.py index 07bcf800..62595023 100644 --- a/testcode/BenchmarkTest00176.py +++ b/testcode/BenchmarkTest00176.py @@ -48,6 +48,9 @@ def BenchmarkTest00176_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00177.py b/testcode/BenchmarkTest00177.py index cb8d5fd9..013f3677 100644 --- a/testcode/BenchmarkTest00177.py +++ b/testcode/BenchmarkTest00177.py @@ -40,6 +40,9 @@ def BenchmarkTest00177_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00178.py b/testcode/BenchmarkTest00178.py index c1698997..29863c50 100644 --- a/testcode/BenchmarkTest00178.py +++ b/testcode/BenchmarkTest00178.py @@ -40,6 +40,9 @@ def BenchmarkTest00178_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00355.py b/testcode/BenchmarkTest00355.py index 8361dfc4..eed91696 100644 --- a/testcode/BenchmarkTest00355.py +++ b/testcode/BenchmarkTest00355.py @@ -45,6 +45,9 @@ def BenchmarkTest00355_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00356.py b/testcode/BenchmarkTest00356.py index 6d25ae45..81a9a2f2 100644 --- a/testcode/BenchmarkTest00356.py +++ b/testcode/BenchmarkTest00356.py @@ -42,6 +42,9 @@ def BenchmarkTest00356_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00441.py b/testcode/BenchmarkTest00441.py index d426d264..78431d1a 100644 --- a/testcode/BenchmarkTest00441.py +++ b/testcode/BenchmarkTest00441.py @@ -38,6 +38,9 @@ def BenchmarkTest00441_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00442.py b/testcode/BenchmarkTest00442.py index c1a3a433..3a8c9e96 100644 --- a/testcode/BenchmarkTest00442.py +++ b/testcode/BenchmarkTest00442.py @@ -46,6 +46,9 @@ def BenchmarkTest00442_post(): ) return RESPONSE + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00521.py b/testcode/BenchmarkTest00521.py index bc8eab37..dcd3639f 100644 --- a/testcode/BenchmarkTest00521.py +++ b/testcode/BenchmarkTest00521.py @@ -45,6 +45,9 @@ def BenchmarkTest00521_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00522.py b/testcode/BenchmarkTest00522.py index e2d9ad9b..8ab77230 100644 --- a/testcode/BenchmarkTest00522.py +++ b/testcode/BenchmarkTest00522.py @@ -49,6 +49,9 @@ def BenchmarkTest00522_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00741.py b/testcode/BenchmarkTest00741.py index 54e977ad..add87756 100644 --- a/testcode/BenchmarkTest00741.py +++ b/testcode/BenchmarkTest00741.py @@ -39,6 +39,9 @@ def BenchmarkTest00741_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00831.py b/testcode/BenchmarkTest00831.py index ea4eaa08..dfa13522 100644 --- a/testcode/BenchmarkTest00831.py +++ b/testcode/BenchmarkTest00831.py @@ -43,6 +43,9 @@ def BenchmarkTest00831_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00832.py b/testcode/BenchmarkTest00832.py index 2eb86dd0..9219b951 100644 --- a/testcode/BenchmarkTest00832.py +++ b/testcode/BenchmarkTest00832.py @@ -50,6 +50,9 @@ def BenchmarkTest00832_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00833.py b/testcode/BenchmarkTest00833.py index 5eb20be3..b262000c 100644 --- a/testcode/BenchmarkTest00833.py +++ b/testcode/BenchmarkTest00833.py @@ -42,6 +42,9 @@ def BenchmarkTest00833_post(): import helpers.utils + fileName = None + fd = None + if '../' in bar: RESPONSE += ( 'File name must not contain \'../\'' diff --git a/testcode/BenchmarkTest00914.py b/testcode/BenchmarkTest00914.py index 832234f0..5665fe8d 100644 --- a/testcode/BenchmarkTest00914.py +++ b/testcode/BenchmarkTest00914.py @@ -52,6 +52,9 @@ def BenchmarkTest00914_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00915.py b/testcode/BenchmarkTest00915.py index e2da59c2..19ef9423 100644 --- a/testcode/BenchmarkTest00915.py +++ b/testcode/BenchmarkTest00915.py @@ -49,6 +49,9 @@ def BenchmarkTest00915_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00916.py b/testcode/BenchmarkTest00916.py index b8c03c1a..c5e9fb50 100644 --- a/testcode/BenchmarkTest00916.py +++ b/testcode/BenchmarkTest00916.py @@ -48,6 +48,9 @@ def BenchmarkTest00916_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest00917.py b/testcode/BenchmarkTest00917.py index dfb1816d..5532605a 100644 --- a/testcode/BenchmarkTest00917.py +++ b/testcode/BenchmarkTest00917.py @@ -51,6 +51,9 @@ def BenchmarkTest00917_post(): ) return RESPONSE + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest01008.py b/testcode/BenchmarkTest01008.py index 46cafb30..74844b45 100644 --- a/testcode/BenchmarkTest01008.py +++ b/testcode/BenchmarkTest01008.py @@ -44,6 +44,9 @@ def BenchmarkTest01008_post(): import helpers.utils + fd = None + fileName = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest01108.py b/testcode/BenchmarkTest01108.py index 9549336e..04e5fbde 100644 --- a/testcode/BenchmarkTest01108.py +++ b/testcode/BenchmarkTest01108.py @@ -38,6 +38,9 @@ def BenchmarkTest01108_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{bar}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest01179.py b/testcode/BenchmarkTest01179.py index 92d77e52..dae3c182 100644 --- a/testcode/BenchmarkTest01179.py +++ b/testcode/BenchmarkTest01179.py @@ -35,6 +35,9 @@ def BenchmarkTest01179_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{param}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest01180.py b/testcode/BenchmarkTest01180.py index ba9b3d40..2a972d0a 100644 --- a/testcode/BenchmarkTest01180.py +++ b/testcode/BenchmarkTest01180.py @@ -41,6 +41,9 @@ def BenchmarkTest01180_post(): ) return RESPONSE + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{param}' fd = open(fileName, 'wb') diff --git a/testcode/BenchmarkTest01222.py b/testcode/BenchmarkTest01222.py index f956be40..cc26b2d9 100644 --- a/testcode/BenchmarkTest01222.py +++ b/testcode/BenchmarkTest01222.py @@ -36,6 +36,9 @@ def BenchmarkTest01222_post(): import helpers.utils + fileName = None + fd = None + try: fileName = f'{helpers.utils.TESTFILES_DIR}/{param}' fd = open(fileName, 'wb') From 62ab0c0184e65d3446b51e3c536d046501397c1c Mon Sep 17 00:00:00 2001 From: pommfresser Date: Sun, 19 Apr 2026 11:55:55 +0200 Subject: [PATCH 2/3] Fix errors with fileName and OSError --- testcode/BenchmarkTest00009.py | 4 ++-- testcode/BenchmarkTest00010.py | 4 ++-- testcode/BenchmarkTest00092.py | 4 ++-- testcode/BenchmarkTest00093.py | 4 ++-- testcode/BenchmarkTest00094.py | 4 ++-- testcode/BenchmarkTest00182.py | 4 ++-- testcode/BenchmarkTest00361.py | 4 ++-- testcode/BenchmarkTest00447.py | 4 ++-- testcode/BenchmarkTest00448.py | 4 ++-- testcode/BenchmarkTest00525.py | 4 ++-- testcode/BenchmarkTest00526.py | 4 ++-- testcode/BenchmarkTest00527.py | 4 ++-- testcode/BenchmarkTest00528.py | 4 ++-- testcode/BenchmarkTest00616.py | 4 ++-- testcode/BenchmarkTest00617.py | 4 ++-- testcode/BenchmarkTest00664.py | 4 ++-- testcode/BenchmarkTest00745.py | 4 ++-- testcode/BenchmarkTest00746.py | 4 ++-- testcode/BenchmarkTest00747.py | 4 ++-- testcode/BenchmarkTest00748.py | 4 ++-- testcode/BenchmarkTest00920.py | 4 ++-- testcode/BenchmarkTest00921.py | 4 ++-- testcode/BenchmarkTest01011.py | 4 ++-- testcode/BenchmarkTest01012.py | 4 ++-- testcode/BenchmarkTest01013.py | 4 ++-- testcode/BenchmarkTest01113.py | 4 ++-- testcode/BenchmarkTest01192.py | 4 ++-- testcode/BenchmarkTest01214.py | 4 ++-- 28 files changed, 56 insertions(+), 56 deletions(-) diff --git a/testcode/BenchmarkTest00009.py b/testcode/BenchmarkTest00009.py index b4073926..dcf56de5 100644 --- a/testcode/BenchmarkTest00009.py +++ b/testcode/BenchmarkTest00009.py @@ -57,9 +57,9 @@ def BenchmarkTest00009_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00010.py b/testcode/BenchmarkTest00010.py index bdc88b37..89c1486f 100644 --- a/testcode/BenchmarkTest00010.py +++ b/testcode/BenchmarkTest00010.py @@ -59,9 +59,9 @@ def BenchmarkTest00010_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00092.py b/testcode/BenchmarkTest00092.py index 1ea5b43f..356c8a9f 100644 --- a/testcode/BenchmarkTest00092.py +++ b/testcode/BenchmarkTest00092.py @@ -48,9 +48,9 @@ def BenchmarkTest00092_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00093.py b/testcode/BenchmarkTest00093.py index a3f88715..025ce692 100644 --- a/testcode/BenchmarkTest00093.py +++ b/testcode/BenchmarkTest00093.py @@ -55,9 +55,9 @@ def BenchmarkTest00093_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00094.py b/testcode/BenchmarkTest00094.py index ff4652ad..b4d1af8d 100644 --- a/testcode/BenchmarkTest00094.py +++ b/testcode/BenchmarkTest00094.py @@ -53,9 +53,9 @@ def BenchmarkTest00094_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00182.py b/testcode/BenchmarkTest00182.py index da4e65db..7731ef80 100644 --- a/testcode/BenchmarkTest00182.py +++ b/testcode/BenchmarkTest00182.py @@ -48,9 +48,9 @@ def BenchmarkTest00182_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00361.py b/testcode/BenchmarkTest00361.py index ec8e92c5..d6db4881 100644 --- a/testcode/BenchmarkTest00361.py +++ b/testcode/BenchmarkTest00361.py @@ -52,9 +52,9 @@ def BenchmarkTest00361_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00447.py b/testcode/BenchmarkTest00447.py index 6a3bcca3..0aeccc58 100644 --- a/testcode/BenchmarkTest00447.py +++ b/testcode/BenchmarkTest00447.py @@ -51,9 +51,9 @@ def BenchmarkTest00447_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00448.py b/testcode/BenchmarkTest00448.py index adb2d2b8..434c7b14 100644 --- a/testcode/BenchmarkTest00448.py +++ b/testcode/BenchmarkTest00448.py @@ -58,9 +58,9 @@ def BenchmarkTest00448_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00525.py b/testcode/BenchmarkTest00525.py index cbe1fd3a..ba2da1c6 100644 --- a/testcode/BenchmarkTest00525.py +++ b/testcode/BenchmarkTest00525.py @@ -51,9 +51,9 @@ def BenchmarkTest00525_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00526.py b/testcode/BenchmarkTest00526.py index 7a9ef136..9d352898 100644 --- a/testcode/BenchmarkTest00526.py +++ b/testcode/BenchmarkTest00526.py @@ -49,9 +49,9 @@ def BenchmarkTest00526_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00527.py b/testcode/BenchmarkTest00527.py index f68a2ec9..c466e7de 100644 --- a/testcode/BenchmarkTest00527.py +++ b/testcode/BenchmarkTest00527.py @@ -55,9 +55,9 @@ def BenchmarkTest00527_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00528.py b/testcode/BenchmarkTest00528.py index 48c5ecb7..0713cf4f 100644 --- a/testcode/BenchmarkTest00528.py +++ b/testcode/BenchmarkTest00528.py @@ -60,9 +60,9 @@ def BenchmarkTest00528_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00616.py b/testcode/BenchmarkTest00616.py index d7b557a4..3c3893df 100644 --- a/testcode/BenchmarkTest00616.py +++ b/testcode/BenchmarkTest00616.py @@ -65,9 +65,9 @@ def BenchmarkTest00616_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00617.py b/testcode/BenchmarkTest00617.py index 6adef636..73cab685 100644 --- a/testcode/BenchmarkTest00617.py +++ b/testcode/BenchmarkTest00617.py @@ -61,9 +61,9 @@ def BenchmarkTest00617_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00664.py b/testcode/BenchmarkTest00664.py index a2e61302..902d3a6a 100644 --- a/testcode/BenchmarkTest00664.py +++ b/testcode/BenchmarkTest00664.py @@ -58,9 +58,9 @@ def BenchmarkTest00664_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00745.py b/testcode/BenchmarkTest00745.py index a92167c7..19ef6358 100644 --- a/testcode/BenchmarkTest00745.py +++ b/testcode/BenchmarkTest00745.py @@ -52,9 +52,9 @@ def BenchmarkTest00745_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00746.py b/testcode/BenchmarkTest00746.py index f45c023f..78cb6fc3 100644 --- a/testcode/BenchmarkTest00746.py +++ b/testcode/BenchmarkTest00746.py @@ -58,9 +58,9 @@ def BenchmarkTest00746_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00747.py b/testcode/BenchmarkTest00747.py index ae49bc1a..b3d91c58 100644 --- a/testcode/BenchmarkTest00747.py +++ b/testcode/BenchmarkTest00747.py @@ -63,9 +63,9 @@ def BenchmarkTest00747_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00748.py b/testcode/BenchmarkTest00748.py index d5b31910..a334cd1a 100644 --- a/testcode/BenchmarkTest00748.py +++ b/testcode/BenchmarkTest00748.py @@ -54,9 +54,9 @@ def BenchmarkTest00748_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00920.py b/testcode/BenchmarkTest00920.py index 6caa8b15..6983a747 100644 --- a/testcode/BenchmarkTest00920.py +++ b/testcode/BenchmarkTest00920.py @@ -60,9 +60,9 @@ def BenchmarkTest00920_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest00921.py b/testcode/BenchmarkTest00921.py index 04b967ac..995da345 100644 --- a/testcode/BenchmarkTest00921.py +++ b/testcode/BenchmarkTest00921.py @@ -62,9 +62,9 @@ def BenchmarkTest00921_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01011.py b/testcode/BenchmarkTest01011.py index 4a843d51..0e6617a4 100644 --- a/testcode/BenchmarkTest01011.py +++ b/testcode/BenchmarkTest01011.py @@ -59,9 +59,9 @@ def BenchmarkTest01011_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01012.py b/testcode/BenchmarkTest01012.py index 0072d748..05d737ea 100644 --- a/testcode/BenchmarkTest01012.py +++ b/testcode/BenchmarkTest01012.py @@ -58,9 +58,9 @@ def BenchmarkTest01012_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01013.py b/testcode/BenchmarkTest01013.py index 30460257..074bb8d5 100644 --- a/testcode/BenchmarkTest01013.py +++ b/testcode/BenchmarkTest01013.py @@ -55,9 +55,9 @@ def BenchmarkTest01013_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01113.py b/testcode/BenchmarkTest01113.py index 36b29260..476183e0 100644 --- a/testcode/BenchmarkTest01113.py +++ b/testcode/BenchmarkTest01113.py @@ -53,9 +53,9 @@ def BenchmarkTest01113_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(bar)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01192.py b/testcode/BenchmarkTest01192.py index bd9fafb5..f0ee305a 100644 --- a/testcode/BenchmarkTest01192.py +++ b/testcode/BenchmarkTest01192.py @@ -45,9 +45,9 @@ def BenchmarkTest01192_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(param)}\': ' f'{escape_for_html(e.strerror)}' ) diff --git a/testcode/BenchmarkTest01214.py b/testcode/BenchmarkTest01214.py index 04770e09..db086733 100644 --- a/testcode/BenchmarkTest01214.py +++ b/testcode/BenchmarkTest01214.py @@ -46,9 +46,9 @@ def BenchmarkTest01214_post(): f'The beginning of file: \'{escape_for_html(str(p))}\' is:\n\n' f'{escape_for_html(p.read_text()[:1000])}' ) - except OSError: + except OSError as e: RESPONSE += ( - f'Problem reading from file \'{{escape_for_html(fileName)}}\': ' + f'Problem reading from file \'{escape_for_html(param)}\': ' f'{escape_for_html(e.strerror)}' ) From 155f7eef44d888436883861e760faa0e5fd65931 Mon Sep 17 00:00:00 2001 From: pommfresser Date: Sun, 19 Apr 2026 11:57:02 +0200 Subject: [PATCH 3/3] Return error message in case of error in xpath query --- testcode/BenchmarkTest00199.py | 4 ++-- testcode/BenchmarkTest00200.py | 4 ++-- testcode/BenchmarkTest00201.py | 4 ++-- testcode/BenchmarkTest00202.py | 4 ++-- testcode/BenchmarkTest00537.py | 4 ++-- testcode/BenchmarkTest00675.py | 4 ++-- testcode/BenchmarkTest00676.py | 4 ++-- testcode/BenchmarkTest00677.py | 4 ++-- testcode/BenchmarkTest00756.py | 4 ++-- testcode/BenchmarkTest00757.py | 4 ++-- testcode/BenchmarkTest00845.py | 4 ++-- testcode/BenchmarkTest00846.py | 4 ++-- testcode/BenchmarkTest00847.py | 4 ++-- testcode/BenchmarkTest00927.py | 4 ++-- testcode/BenchmarkTest01023.py | 4 ++-- testcode/BenchmarkTest01117.py | 4 ++-- testcode/BenchmarkTest01118.py | 4 ++-- testcode/BenchmarkTest01225.py | 4 ++-- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/testcode/BenchmarkTest00199.py b/testcode/BenchmarkTest00199.py index 59af28de..abd233ca 100644 --- a/testcode/BenchmarkTest00199.py +++ b/testcode/BenchmarkTest00199.py @@ -49,9 +49,9 @@ def BenchmarkTest00199_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00200.py b/testcode/BenchmarkTest00200.py index 08e889e0..f3cd26d7 100644 --- a/testcode/BenchmarkTest00200.py +++ b/testcode/BenchmarkTest00200.py @@ -51,9 +51,9 @@ def BenchmarkTest00200_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00201.py b/testcode/BenchmarkTest00201.py index 304923fc..e1e19e47 100644 --- a/testcode/BenchmarkTest00201.py +++ b/testcode/BenchmarkTest00201.py @@ -52,9 +52,9 @@ def BenchmarkTest00201_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00202.py b/testcode/BenchmarkTest00202.py index b820c142..e728ab9b 100644 --- a/testcode/BenchmarkTest00202.py +++ b/testcode/BenchmarkTest00202.py @@ -51,9 +51,9 @@ def BenchmarkTest00202_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00537.py b/testcode/BenchmarkTest00537.py index c32dd9a3..0046456f 100644 --- a/testcode/BenchmarkTest00537.py +++ b/testcode/BenchmarkTest00537.py @@ -52,9 +52,9 @@ def BenchmarkTest00537_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00675.py b/testcode/BenchmarkTest00675.py index 078f4006..b4b55f31 100644 --- a/testcode/BenchmarkTest00675.py +++ b/testcode/BenchmarkTest00675.py @@ -50,9 +50,9 @@ def BenchmarkTest00675_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00676.py b/testcode/BenchmarkTest00676.py index cec771bc..bc62e45a 100644 --- a/testcode/BenchmarkTest00676.py +++ b/testcode/BenchmarkTest00676.py @@ -55,9 +55,9 @@ def BenchmarkTest00676_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00677.py b/testcode/BenchmarkTest00677.py index 326bf801..a92c4d5a 100644 --- a/testcode/BenchmarkTest00677.py +++ b/testcode/BenchmarkTest00677.py @@ -51,9 +51,9 @@ def BenchmarkTest00677_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00756.py b/testcode/BenchmarkTest00756.py index 78e07055..e92070b7 100644 --- a/testcode/BenchmarkTest00756.py +++ b/testcode/BenchmarkTest00756.py @@ -56,9 +56,9 @@ def BenchmarkTest00756_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00757.py b/testcode/BenchmarkTest00757.py index 9a7e3ec9..3a35c035 100644 --- a/testcode/BenchmarkTest00757.py +++ b/testcode/BenchmarkTest00757.py @@ -53,9 +53,9 @@ def BenchmarkTest00757_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00845.py b/testcode/BenchmarkTest00845.py index f22a7f84..38d0986f 100644 --- a/testcode/BenchmarkTest00845.py +++ b/testcode/BenchmarkTest00845.py @@ -58,9 +58,9 @@ def BenchmarkTest00845_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00846.py b/testcode/BenchmarkTest00846.py index 45a1d561..f050f6f6 100644 --- a/testcode/BenchmarkTest00846.py +++ b/testcode/BenchmarkTest00846.py @@ -62,9 +62,9 @@ def BenchmarkTest00846_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00847.py b/testcode/BenchmarkTest00847.py index d1e6dd5e..590aa3af 100644 --- a/testcode/BenchmarkTest00847.py +++ b/testcode/BenchmarkTest00847.py @@ -62,9 +62,9 @@ def BenchmarkTest00847_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest00927.py b/testcode/BenchmarkTest00927.py index c7c02022..1cd8e8d7 100644 --- a/testcode/BenchmarkTest00927.py +++ b/testcode/BenchmarkTest00927.py @@ -57,9 +57,9 @@ def BenchmarkTest00927_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest01023.py b/testcode/BenchmarkTest01023.py index 1d7f9ab0..7af8799b 100644 --- a/testcode/BenchmarkTest01023.py +++ b/testcode/BenchmarkTest01023.py @@ -60,9 +60,9 @@ def BenchmarkTest01023_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest01117.py b/testcode/BenchmarkTest01117.py index dc38b3d4..72c63285 100644 --- a/testcode/BenchmarkTest01117.py +++ b/testcode/BenchmarkTest01117.py @@ -54,9 +54,9 @@ def BenchmarkTest01117_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest01118.py b/testcode/BenchmarkTest01118.py index dcb65be8..d6e9ed22 100644 --- a/testcode/BenchmarkTest01118.py +++ b/testcode/BenchmarkTest01118.py @@ -52,9 +52,9 @@ def BenchmarkTest01118_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' ) diff --git a/testcode/BenchmarkTest01225.py b/testcode/BenchmarkTest01225.py index 0c74a917..a138a391 100644 --- a/testcode/BenchmarkTest01225.py +++ b/testcode/BenchmarkTest01225.py @@ -48,9 +48,9 @@ def BenchmarkTest01225_post(): RESPONSE += ( f'Your XPATH query results are:
[ {', '.join(node_strings)} ]' ) - except: + except Exception as e: RESPONSE += ( - f'Error parsing XPath Query: \'{escape_for_html(query)}\'' + f'Error parsing XPath Query: \'{escape_for_html(str(e))}\'' )