Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13 support #2213

Open
xrmx opened this issue Feb 6, 2025 · 2 comments · May be fixed by #2216
Open

Python 3.13 support #2213

xrmx opened this issue Feb 6, 2025 · 2 comments · May be fixed by #2216

Comments

@xrmx
Copy link
Member

xrmx commented Feb 6, 2025

Python 3.13 raises an exception with how we buffer things to send to the apm server. When the gzip object is closed it raises an exception because the BytesIO used as its backing storage is already gone.

Filed an upstream issue python/cpython#129726 so waiting for some feedback here before reworking our code.

@xrmx xrmx linked a pull request Feb 7, 2025 that will close this issue
@Maksych
Copy link

Maksych commented Feb 11, 2025

How to produce this ignored exception:

import elasticapm

elasticapm.Client({})

Then got output:

No custom SERVICE_NAME was set -- using non-descript default 'unknown-python-service'
Could not register elasticapm.metrics.sets.cpu.CPUMetricSet metricset: psutil not found. Install it to get system and process metrics
Exception ignored in: <gzip on 0x10443e590>
Traceback (most recent call last):
  File "/Users/maksych/.local/share/uv/python/cpython-3.13.0-macos-aarch64-none/lib/python3.13/gzip.py", line 378, in close
    fileobj.write(self.compress.flush())
ValueError: I/O operation on closed file.

@josecsotomorales
Copy link

josecsotomorales commented Feb 12, 2025

Following up, is there any workaround on this one? I see a draft PR with 3.13 support though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants