Skip to content

Handle optional TimeoutError attributes - #85

Merged
ionelmc merged 1 commit into
ionelmc:masterfrom
jacobtomlinson:fix/OSError
Nov 12, 2025
Merged

Handle optional TimeoutError attributes#85
ionelmc merged 1 commit into
ionelmc:masterfrom
jacobtomlinson:fix/OSError

Conversation

@jacobtomlinson

@jacobtomlinson jacobtomlinson commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

In dask/distributed#9140 we are seeing a problem in our CI with newer versions of tblib.

It looks like this was partially fixed in #83 but the same applies to other attributes of OSError subclasses like TimeoutError, e.g errorno and strerror. If the value of them is None they should not be set at all otherwise it will break the string representation.

@codecov

codecov Bot commented Nov 12, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.78%. Comparing base (b197023) to head (059066e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/tblib/pickling_support.py 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
- Coverage   97.03%   96.78%   -0.26%     
==========================================
  Files           9        9              
  Lines         743      746       +3     
  Branches       51       53       +2     
==========================================
+ Hits          721      722       +1     
  Misses         17       17              
- Partials        5        7       +2     
Flag Coverage Δ
py310 (macos/arm64) 78.65% <50.00%> (-0.19%) ⬇️
py310 (ubuntu/x64) 78.65% <50.00%> (-0.19%) ⬇️
py310 (windows/x64) 78.65% <50.00%> (-0.19%) ⬇️
py311 (macos/arm64) 96.37% <50.00%> (-0.26%) ⬇️
py311 (ubuntu/x64) 96.37% <50.00%> (-0.26%) ⬇️
py311 (windows/x64) 96.37% <50.00%> (-0.26%) ⬇️
py312 (macos/arm64) 96.37% <50.00%> (-0.26%) ⬇️
py312 (ubuntu/x64) 96.37% <50.00%> (-0.26%) ⬇️
py312 (windows/x64) 96.37% <50.00%> (-0.26%) ⬇️
py313 (macos/arm64) 96.37% <50.00%> (-0.26%) ⬇️
py313 (ubuntu/x64) 96.37% <50.00%> (-0.26%) ⬇️
py313 (windows/x64) 96.37% <50.00%> (-0.26%) ⬇️
py314 (macos/arm64) 96.10% <50.00%> (-0.26%) ⬇️
py314 (ubuntu/x64) 96.10% <50.00%> (-0.26%) ⬇️
py314 (windows/x64) 96.10% <50.00%> (-0.26%) ⬇️
py39 (macos/arm64) 78.41% <50.00%> (-0.19%) ⬇️
py39 (ubuntu/x64) 78.41% <50.00%> (-0.19%) ⬇️
py39 (windows/x64) 78.41% <50.00%> (-0.19%) ⬇️
pypy310 (macos/arm64) 76.51% <50.00%> (-0.18%) ⬇️
pypy310 (ubuntu/x64) 76.51% <50.00%> (-0.18%) ⬇️
pypy310 (windows/x64) 76.51% <50.00%> (-0.18%) ⬇️
pypy311 (macos/arm64) 94.22% <50.00%> (-0.25%) ⬇️
pypy311 (ubuntu/x64) 94.22% <50.00%> (-0.25%) ⬇️
pypy311 (windows/x64) 94.22% <50.00%> (-0.25%) ⬇️
pypy39 (macos/arm64) 76.27% <50.00%> (-0.18%) ⬇️
pypy39 (ubuntu/x64) 76.27% <50.00%> (-0.18%) ⬇️
pypy39 (windows/x64) 76.27% <50.00%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ionelmc
ionelmc merged commit df6185d into ionelmc:master Nov 12, 2025
46 of 61 checks passed
ionelmc added a commit that referenced this pull request Nov 12, 2025
@ionelmc

ionelmc commented Nov 12, 2025

Copy link
Copy Markdown
Owner

Released 3.2.2.

@jacobtomlinson
jacobtomlinson deleted the fix/OSError branch November 12, 2025 13:47
iboiko-habana added a commit to vllm-project/vllm-gaudi that referenced this pull request Aug 13, 2026
Bumps [tblib](https://github.com/ionelmc/python-tblib) from 3.1.0 to
3.2.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/ionelmc/python-tblib/blob/master/CHANGELOG.rst">tblib's
changelog</a>.</em></p>
<blockquote>
<p>3.2.2 (2025-11-12)</p>
<pre><code>
* Fixed regression occurring with ``TimeoutError`` exceptions. They
should be represented now exactly as the original when unpickling.
Contributed by Jacob Tomlinson in
`[#85](ionelmc/python-tblib#85)
&lt;https://github.com/ionelmc/python-tblib/pull/85&gt;`_.
<p>3.2.1 (2025-10-31)
</code></pre></p>
<ul>
<li>Fixed regression occurring with <code>ExceptionGroup</code>
exceptions. That exception type is now handled specifically in the new
<code>unpickle_exception_with_attrs</code> function (just like
<code>OSError</code>).</li>
</ul>
<p>3.2.0 (2025-10-21)</p>
<pre><code>
* Changed ``tblib.pickling_support.install`` to support exceptions with
``__init__`` that does match the default
``BaseException.__reduce__`` (as it expects the positional arguments to
``__init__`` to match the ``args`` attribute).
<p>Special handling for OSError (and subclasses) is also included. The
errno, strerror, winerror, filename and filename2 attributes will be
added in the reduce structure (if set).</p>
<p>This will support exception subclasses that do this without defining
a custom <code>__reduce__</code>:</p>
<p>.. code-block:: python</p>
<pre><code>def __init__(self):
    super().__init__('mistery argument')

def __init__(self, mistery_argument):
    super().__init__()
    self.mistery_argument = mistery_argument
</code></pre>
<p>Tests and POC contributed by Oldřich Jedlička in
<code>[#73](ionelmc/python-tblib#73)
&amp;lt;https://github.com/ionelmc/python-tblib/pull/73&amp;gt;</code>_.</p>
<ul>
<li>Fixed some doctest and coverage config. Contributed by Colin Watson
in <code>[#79](ionelmc/python-tblib#79)
&amp;lt;https://github.com/ionelmc/python-tblib/pull/79&amp;gt;</code>_.
</code></pre></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/d88606aab343749dfeccf16a813f63cbe2dae11e"><code>d88606a</code></a>
Bump version: 3.2.1 → 3.2.2</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/530f8743f1ed322f220621d8491e660636065279"><code>530f874</code></a>
Add test for timeouterror regression. Ref <a
href="https://redirect.github.com/ionelmc/python-tblib/issues/85">#85</a>.</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/9c8f2ca0e7c061cc423207986af6f06aaa76cfee"><code>9c8f2ca</code></a>
Update changelog.</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/df6185d4b942a37d48a0e082b885380b8c5cc5ad"><code>df6185d</code></a>
Handle optional OSError attributes</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/b197023aa86b831834393fdd89c6439fe2ffaf0c"><code>b197023</code></a>
Bump version: 3.2.0 → 3.2.1</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/d71e1edc9da5a86e326406ea4372cce5c075b4f4"><code>d71e1ed</code></a>
Update changelog.</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/74ec64570acb0d6ce708c695ab98d52d08f8b066"><code>74ec645</code></a>
Specifically handle ExceptionGroup in the new
unpickle_exception_with_attrs. ...</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/580d57921a6e93660bf47771f70c0bfbe70e9c97"><code>580d579</code></a>
Ooops, forgot to update these.</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/ebc83e93b6342950cb93cf296991fb99ce4aa13a"><code>ebc83e9</code></a>
Bump version: 3.1.0 → 3.2.0</li>
<li><a
href="https://github.com/ionelmc/python-tblib/commit/abec37d4526fb86f95c7567644f1fd6c2cec4215"><code>abec37d</code></a>
Update changelog and add one more test.</li>
<li>Additional commits viewable in <a
href="https://github.com/ionelmc/python-tblib/compare/v3.1.0...v3.2.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tblib&package-manager=pip&previous-version=3.1.0&new-version=3.2.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Iryna Boiko <iryna.boiko@intel.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iryna Boiko <iryna.boiko@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants