forked from pool/python-tblib
Compare commits
23 Commits
Author | SHA256 | Date | |
---|---|---|---|
269bf91926 | |||
c31eeed2fd | |||
e2f652064b | |||
2eb4d7ec82 | |||
5eaa30b4c2 | |||
727b5fc8f4 | |||
4c10e0a116 | |||
0b675b4971 | |||
8662559037 | |||
a978dfee45 | |||
acd3a0468b | |||
3cd2f11ef3 | |||
c4fcdfab2d | |||
1dcb816449 | |||
c1ff8eff80 | |||
|
2e64fc9c76 | ||
1d53e1da87 | |||
|
6022fcd26c | ||
8a8068b3e0 | |||
189f152bae | |||
de2ca649f6 | |||
|
3d475712b3 | ||
|
5a163db66e |
@ -1,44 +0,0 @@
|
|||||||
From 66e14cdd101e4214cca6acca8f48b9abe4f75729 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= <contact@ionelmc.ro>
|
|
||||||
Date: Fri, 15 Dec 2023 16:52:07 +0200
|
|
||||||
Subject: [PATCH] More aggressive location stripping. Ref #74.
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/test_pickle_exception.py | 12 ++++++------
|
|
||||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
Index: tblib-3.0.0/tests/test_pickle_exception.py
|
|
||||||
===================================================================
|
|
||||||
--- tblib-3.0.0.orig/tests/test_pickle_exception.py
|
|
||||||
+++ tblib-3.0.0/tests/test_pickle_exception.py
|
|
||||||
@@ -29,6 +29,10 @@ class CustomError(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
+def strip_locations(tb_text):
|
|
||||||
+ return tb_text.replace(' ~~^~~\n', '').replace(' ^^^^^^^^^^^^^^^^^\n', '')
|
|
||||||
+
|
|
||||||
+
|
|
||||||
@pytest.mark.parametrize('protocol', [None, *list(range(1, pickle.HIGHEST_PROTOCOL + 1))])
|
|
||||||
@pytest.mark.parametrize('how', ['global', 'instance', 'class'])
|
|
||||||
def test_install(clear_dispatch_table, how, protocol):
|
|
||||||
@@ -58,8 +62,8 @@ def test_install(clear_dispatch_table, h
|
|
||||||
else:
|
|
||||||
raise AssertionError
|
|
||||||
|
|
||||||
- expected_format_exception = ''.join(format_exception(type(exc), exc, exc.__traceback__))
|
|
||||||
- print(expected_format_exception)
|
|
||||||
+ expected_format_exception = strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__)))
|
|
||||||
+
|
|
||||||
# Populate Exception.__dict__, which is used in some cases
|
|
||||||
exc.x = 1
|
|
||||||
exc.__cause__.x = 2
|
|
||||||
@@ -88,7 +92,7 @@ def test_install(clear_dispatch_table, h
|
|
||||||
if has_python311:
|
|
||||||
assert exc.__notes__ == ['note 1', 'note 2']
|
|
||||||
|
|
||||||
- assert expected_format_exception == ''.join(format_exception(type(exc), exc, exc.__traceback__))
|
|
||||||
+ assert expected_format_exception == strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__)))
|
|
||||||
|
|
||||||
|
|
||||||
@tblib.pickling_support.install
|
|
@ -1,3 +1,19 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 17 02:37:45 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add missing BuildRequires on pytest-benchmark for running the test suite.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 10 12:43:29 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
- Update to 3.1.0
|
||||||
|
* Improved performance of ``as_traceback`` by a large factor.
|
||||||
|
* Dropped support for now-EOL Python 3.8 and added 3.13 in the
|
||||||
|
test grid.
|
||||||
|
- Drop more-aggressive-location-stripping.patch, fixed upstream
|
||||||
|
- Drop vendore-reraise-from-six.patch, merged upstream
|
||||||
|
- Renumber patches
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Sep 9 12:30:08 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
Mon Sep 9 12:30:08 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-tblib
|
# spec file for package python-tblib
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -26,19 +26,14 @@
|
|||||||
%endif
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-tblib%{?psuffix}
|
Name: python-tblib%{?psuffix}
|
||||||
Version: 3.0.0
|
Version: 3.1.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Traceback serialization library
|
Summary: Traceback serialization library
|
||||||
License: BSD-2-Clause
|
License: BSD-2-Clause
|
||||||
Group: Development/Languages/Python
|
|
||||||
URL: https://github.com/ionelmc/python-tblib
|
URL: https://github.com/ionelmc/python-tblib
|
||||||
Source: https://files.pythonhosted.org/packages/source/t/tblib/tblib-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/t/tblib/tblib-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM https://github.com/ionelmc/python-tblib/pull/77 vendore reraise() from six
|
|
||||||
Patch0: vendore-reraise-from-six.patch
|
|
||||||
# PATCH-FIX-UPSTREAM https://github.com/ionelmc/python-tblib/issues/74 More aggressive location stripping. Ref #74.
|
|
||||||
Patch1: more-aggressive-location-stripping.patch
|
|
||||||
# PATCH-FIX-FEDORA https://src.fedoraproject.org/rpms/python-tblib/blob/rawhide/f/0001-test_pickle_exception-even-harder-location-stripping.patch
|
# PATCH-FIX-FEDORA https://src.fedoraproject.org/rpms/python-tblib/blob/rawhide/f/0001-test_pickle_exception-even-harder-location-stripping.patch
|
||||||
Patch2: test_pickle_exception-even-harder-location-stripping.patch
|
Patch1: test_pickle_exception-even-harder-location-stripping.patch
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
@ -47,6 +42,7 @@ BuildRequires: python-rpm-macros
|
|||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: %{python_module Twisted}
|
BuildRequires: %{python_module Twisted}
|
||||||
|
BuildRequires: %{python_module pytest-benchmark}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module tblib == %{version}}
|
BuildRequires: %{python_module tblib == %{version}}
|
||||||
%endif
|
%endif
|
||||||
@ -93,7 +89,7 @@ the pickle support.
|
|||||||
%doc AUTHORS.rst CHANGELOG.rst README.rst
|
%doc AUTHORS.rst CHANGELOG.rst README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/tblib
|
%{python_sitelib}/tblib
|
||||||
%{python_sitelib}/tblib-%{version}*-info
|
%{python_sitelib}/tblib-%{version}.dist-info
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
BIN
tblib-3.0.0.tar.gz
(Stored with Git LFS)
BIN
tblib-3.0.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
tblib-3.1.0.tar.gz
Normal file
3
tblib-3.1.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:06404c2c9f07f66fee2d7d6ad43accc46f9c3361714d9b8426e7f47e595cd652
|
||||||
|
size 30766
|
@ -1,63 +0,0 @@
|
|||||||
From 9f6f864f7de6ce6640bab6d962f00b956da75361 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alexandre Detiste <alexandre.detiste@gmail.com>
|
|
||||||
Date: Wed, 1 May 2024 13:43:53 +0200
|
|
||||||
Subject: [PATCH] vendore reraise() from six
|
|
||||||
|
|
||||||
---
|
|
||||||
ci/requirements.txt | 1 -
|
|
||||||
setup.py | 2 +-
|
|
||||||
src/tblib/decorators.py | 14 ++++++++++++--
|
|
||||||
3 files changed, 13 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/ci/requirements.txt b/ci/requirements.txt
|
|
||||||
index a1708f4..b4f1852 100644
|
|
||||||
--- a/ci/requirements.txt
|
|
||||||
+++ b/ci/requirements.txt
|
|
||||||
@@ -1,6 +1,5 @@
|
|
||||||
virtualenv>=16.6.0
|
|
||||||
pip>=19.1.1
|
|
||||||
setuptools>=18.0.1
|
|
||||||
-six>=1.14.0
|
|
||||||
tox
|
|
||||||
twine
|
|
||||||
diff --git a/setup.py b/setup.py
|
|
||||||
index c5364a1..c09d4c3 100755
|
|
||||||
--- a/setup.py
|
|
||||||
+++ b/setup.py
|
|
||||||
@@ -64,7 +64,7 @@ def read(*names, **kwargs):
|
|
||||||
],
|
|
||||||
python_requires='>=3.8',
|
|
||||||
install_requires=[
|
|
||||||
- # eg: "aspectlib==1.1.1", "six>=1.7",
|
|
||||||
+ # eg: "aspectlib==1.1.1",
|
|
||||||
],
|
|
||||||
extras_require={
|
|
||||||
# eg:
|
|
||||||
diff --git a/src/tblib/decorators.py b/src/tblib/decorators.py
|
|
||||||
index 38d0675..a1ace45 100644
|
|
||||||
--- a/src/tblib/decorators.py
|
|
||||||
+++ b/src/tblib/decorators.py
|
|
||||||
@@ -1,11 +1,21 @@
|
|
||||||
import sys
|
|
||||||
from functools import wraps
|
|
||||||
|
|
||||||
-from six import reraise
|
|
||||||
-
|
|
||||||
from . import Traceback
|
|
||||||
|
|
||||||
|
|
||||||
+def reraise(tp, value, tb=None):
|
|
||||||
+ try:
|
|
||||||
+ if value is None:
|
|
||||||
+ value = tp()
|
|
||||||
+ if value.__traceback__ is not tb:
|
|
||||||
+ raise value.with_traceback(tb)
|
|
||||||
+ raise value
|
|
||||||
+ finally:
|
|
||||||
+ value = None
|
|
||||||
+ tb = None
|
|
||||||
+
|
|
||||||
+
|
|
||||||
class Error:
|
|
||||||
def __init__(self, exc_type, exc_value, traceback):
|
|
||||||
self.exc_type = exc_type
|
|
Loading…
x
Reference in New Issue
Block a user