Commit d3d505a
authored
Fix tests with python 3.13 (#2216)
* elasticapm: properly cleanup buffer and data views
With Python 3.13 our pattern of buffering revealed some issues because
the underlying BytesIO fileobj may get released before gzip.GzipFile.
This requires a fix in CPython but also some improvements on our side by
properly closing the GzipFile in case of error and also releasing the
memoryview we can from the BytesIO buffer.
These problems manifests as following warnings from unraisable exceptions
running tests:
The closing of the gzip buffer helps with:
Traceback (most recent call last):
File "/usr/lib/python3.13/gzip.py", line 362, in close
fileobj.write(self.compress.flush())
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
ValueError: I/O operation on closed file.
Exception ignored in: <_io.BytesIO object at 0x7fbc4335fbf0>
Traceback (most recent call last):
File "/venv313/lib/python3.13/site-packages/ecs_logging/_stdlib.py", line 272, in _record_attribute
def _record_attribute(
BufferError: Existing exports of data: object cannot be re-sized
Python 3.12 shows the same warnings with the `-X dev` flag.
* Fix get_name_from_func for partialmethod in Python 3.13
Handle _partialmethod moving to __partialmethod__ in Python 3.131 parent 73d04c4 commit d3d505a
File tree
3 files changed
+17
-5
lines changed- elasticapm
- transport
- utils
- tests/transports
3 files changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
| |||
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
| 265 | + | |
| 266 | + | |
264 | 267 | | |
265 | 268 | | |
266 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
0 commit comments