From 4bd5e2ecd1f24045e8ac9aa7e79c898dc3a780ea Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Thu, 18 Sep 2025 10:58:41 +0200 Subject: [PATCH] extras: breakpad: use io types for IO classes typing.io doesn't seem to exist anymore. typing.io was in Python 3.5 [^1] but not in 3.6 [^2]. ``` Traceback (most recent call last): File "/builds/robUx4/vlc/./extras/breakpad/symb_upload.py", line 146, in class OutputStore: def store(self, dump: typing.io.TextIO, meta): assert(False) File "/builds/robUx4/vlc/./extras/breakpad/symb_upload.py", line 147, in OutputStore def store(self, dump: typing.io.TextIO, meta): ^^^^^^^^^ File "/usr/lib/python3.13/typing.py", line 3817, in __getattr__ raise AttributeError(f"module {__name__!r} has no attribute {attr!r}") AttributeError: module 'typing' has no attribute 'io'. Did you mean: 'IO'? ``` [^1]: https://docs.python.org/3.5/library/typing.html#typing.io [^2]: https://docs.python.org/3.6/library/typing.html --- extras/breakpad/symb_upload.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extras/breakpad/symb_upload.py b/extras/breakpad/symb_upload.py index bb46d1376f..73a08a2d1b 100755 --- a/extras/breakpad/symb_upload.py +++ b/extras/breakpad/symb_upload.py @@ -7,7 +7,6 @@ import logging import requests import io import shutil -import typing class Dumper: @@ -147,7 +146,7 @@ class MacDumper(Dumper): class OutputStore: - def store(self, dump: typing.io.TextIO, meta): + def store(self, dump: io.TextIOBase, meta): assert (False) @@ -161,7 +160,7 @@ class HTTPOutputStore(OutputStore): if prod: self.extra_args["prod"] = prod - def store(self, dump: typing.io.TextIO, meta): + def store(self, dump: io.TextIOBase, meta): post_args = {**meta, **self.extra_args} r = requests.post(self.url, post_args, files={"symfile": dump}) if not r.ok: @@ -174,7 +173,7 @@ class LocalDirOutputStore(OutputStore): super().__init__() self.rootdir = rootdir - def store(self, dump: typing.io, meta): + def store(self, dump: io.IOBase, meta): basepath = os.path.join(self.rootdir, meta["debug_file"], meta["debug_identifier"]) if not os.path.exists(basepath): os.makedirs(basepath)