nixbot

builds

succeeded python3.14-speechrecognition-3.17.0 checks.x86_64-linux.pkgs-hindsight · build #10775 · raw

1bld1: building 2x0dd15akghb07w0bsh7gj882jbwsjd4-python3.14-speechrecognition-3.17.0.drv2Sourcing python-remove-tests-dir-hook3Sourcing python-catch-conflicts-hook.sh4Sourcing python-remove-bin-bytecode-hook.sh5Sourcing pypa-build-hook6Using pypaBuildPhase7Sourcing python-runtime-deps-check-hook8Using pythonRuntimeDepsCheckHook9Sourcing pypa-install-hook10Using pypaInstallPhase11Sourcing python-imports-check-hook.sh12Using pythonImportsCheckPhase13Sourcing python-metadata-check-hook.sh14Using pythonMetadataCheckPhase15Sourcing python-namespaces-hook16Sourcing python-catch-conflicts-hook.sh17Sourcing pytest-check-hook18Using pytestCheckPhase
unpackPhase
19unpacking source archive /nix/store/6pq7kyqwxqj7p4v46kh94y3lg07ajphq-source20source root is source21setting SOURCE_DATE_EPOCH to timestamp 315619200 of file "source/third-party/irstlm-master.zip"
configurePhase
22no configure script, doing nothing
buildPhase
23Executing pypaBuildPhase24Creating a wheel...25pypa build flags: --no-isolation --outdir dist/ --wheel26* Getting build dependencies for wheel...27running egg_info28creating SpeechRecognition.egg-info29writing SpeechRecognition.egg-info/PKG-INFO30writing dependency_links to SpeechRecognition.egg-info/dependency_links.txt31writing entry points to SpeechRecognition.egg-info/entry_points.txt32writing requirements to SpeechRecognition.egg-info/requires.txt33writing top-level names to SpeechRecognition.egg-info/top_level.txt34writing manifest file 'SpeechRecognition.egg-info/SOURCES.txt'35reading manifest file 'SpeechRecognition.egg-info/SOURCES.txt'36reading manifest template 'MANIFEST.in'37warning: no previously-included files matching '*.pyc' found under directory 'speech_recognition'38adding license file 'LICENSE.txt'39adding license file 'LICENSE-FLAC.txt'40writing manifest file 'SpeechRecognition.egg-info/SOURCES.txt'41* Building wheel...42running bdist_wheel43running build44running build_py45creating build/lib/speech_recognition46copying speech_recognition/cli.py -> build/lib/speech_recognition47copying speech_recognition/__main__.py -> build/lib/speech_recognition48copying speech_recognition/audio.py -> build/lib/speech_recognition49copying speech_recognition/exceptions.py -> build/lib/speech_recognition50copying speech_recognition/__init__.py -> build/lib/speech_recognition51creating build/lib/speech_recognition/recognizers52copying speech_recognition/recognizers/pocketsphinx.py -> build/lib/speech_recognition/recognizers53copying speech_recognition/recognizers/vosk.py -> build/lib/speech_recognition/recognizers54copying speech_recognition/recognizers/__init__.py -> build/lib/speech_recognition/recognizers55copying speech_recognition/recognizers/google.py -> build/lib/speech_recognition/recognizers56copying speech_recognition/recognizers/google_cloud.py -> build/lib/speech_recognition/recognizers57copying speech_recognition/recognizers/cohere_api.py -> build/lib/speech_recognition/recognizers58creating build/lib/speech_recognition/recognizers/whisper_api59copying speech_recognition/recognizers/whisper_api/base.py -> build/lib/speech_recognition/recognizers/whisper_api60copying speech_recognition/recognizers/whisper_api/__init__.py -> build/lib/speech_recognition/recognizers/whisper_api61copying speech_recognition/recognizers/whisper_api/groq.py -> build/lib/speech_recognition/recognizers/whisper_api62copying speech_recognition/recognizers/whisper_api/openai.py -> build/lib/speech_recognition/recognizers/whisper_api63creating build/lib/speech_recognition/recognizers/whisper_local64copying speech_recognition/recognizers/whisper_local/whisper.py -> build/lib/speech_recognition/recognizers/whisper_local65copying speech_recognition/recognizers/whisper_local/__init__.py -> build/lib/speech_recognition/recognizers/whisper_local66copying speech_recognition/recognizers/whisper_local/base.py -> build/lib/speech_recognition/recognizers/whisper_local67copying speech_recognition/recognizers/whisper_local/faster_whisper.py -> build/lib/speech_recognition/recognizers/whisper_local68copying speech_recognition/version.txt -> build/lib/speech_recognition69creating build/lib/speech_recognition/pocketsphinx-data/en-US70copying speech_recognition/pocketsphinx-data/en-US/language-model.lm.bin -> build/lib/speech_recognition/pocketsphinx-data/en-US71copying speech_recognition/pocketsphinx-data/en-US/pronounciation-dictionary.dict -> build/lib/speech_recognition/pocketsphinx-data/en-US72copying speech_recognition/pocketsphinx-data/en-US/LICENSE.txt -> build/lib/speech_recognition/pocketsphinx-data/en-US73creating build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model74copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/mdef -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model75copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/variances -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model76copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/transition_matrices -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model77copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/means -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model78copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/noisedict -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model79copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/feat.params -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model80copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/sendump -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model81copying speech_recognition/pocketsphinx-data/en-US/acoustic-model/README -> build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model82installing to build/bdist.linux-x86_64/wheel83running install84running install_lib85creating build/bdist.linux-x86_64/wheel86creating build/bdist.linux-x86_64/wheel/speech_recognition87copying build/lib/speech_recognition/version.txt -> build/bdist.linux-x86_64/wheel/./speech_recognition88copying build/lib/speech_recognition/__main__.py -> build/bdist.linux-x86_64/wheel/./speech_recognition89copying build/lib/speech_recognition/audio.py -> build/bdist.linux-x86_64/wheel/./speech_recognition90creating build/bdist.linux-x86_64/wheel/speech_recognition/pocketsphinx-data91creating build/bdist.linux-x86_64/wheel/speech_recognition/pocketsphinx-data/en-US92copying build/lib/speech_recognition/pocketsphinx-data/en-US/LICENSE.txt -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US93creating build/bdist.linux-x86_64/wheel/speech_recognition/pocketsphinx-data/en-US/acoustic-model94copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/feat.params -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model95copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/mdef -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model96copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/transition_matrices -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model97copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/means -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model98copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/variances -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model99copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/noisedict -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model100copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/README -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model101copying build/lib/speech_recognition/pocketsphinx-data/en-US/acoustic-model/sendump -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US/acoustic-model102copying build/lib/speech_recognition/pocketsphinx-data/en-US/language-model.lm.bin -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US103copying build/lib/speech_recognition/pocketsphinx-data/en-US/pronounciation-dictionary.dict -> build/bdist.linux-x86_64/wheel/./speech_recognition/pocketsphinx-data/en-US104copying build/lib/speech_recognition/__init__.py -> build/bdist.linux-x86_64/wheel/./speech_recognition105copying build/lib/speech_recognition/cli.py -> build/bdist.linux-x86_64/wheel/./speech_recognition106copying build/lib/speech_recognition/exceptions.py -> build/bdist.linux-x86_64/wheel/./speech_recognition107creating build/bdist.linux-x86_64/wheel/speech_recognition/recognizers108copying build/lib/speech_recognition/recognizers/vosk.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers109creating build/bdist.linux-x86_64/wheel/speech_recognition/recognizers/whisper_api110copying build/lib/speech_recognition/recognizers/whisper_api/groq.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_api111copying build/lib/speech_recognition/recognizers/whisper_api/__init__.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_api112copying build/lib/speech_recognition/recognizers/whisper_api/base.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_api113copying build/lib/speech_recognition/recognizers/whisper_api/openai.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_api114copying build/lib/speech_recognition/recognizers/google.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers115copying build/lib/speech_recognition/recognizers/google_cloud.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers116copying build/lib/speech_recognition/recognizers/cohere_api.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers117copying build/lib/speech_recognition/recognizers/__init__.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers118creating build/bdist.linux-x86_64/wheel/speech_recognition/recognizers/whisper_local119copying build/lib/speech_recognition/recognizers/whisper_local/whisper.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_local120copying build/lib/speech_recognition/recognizers/whisper_local/__init__.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_local121copying build/lib/speech_recognition/recognizers/whisper_local/faster_whisper.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_local122copying build/lib/speech_recognition/recognizers/whisper_local/base.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers/whisper_local123copying build/lib/speech_recognition/recognizers/pocketsphinx.py -> build/bdist.linux-x86_64/wheel/./speech_recognition/recognizers124running install_egg_info125running egg_info126writing SpeechRecognition.egg-info/PKG-INFO127writing dependency_links to SpeechRecognition.egg-info/dependency_links.txt128writing entry points to SpeechRecognition.egg-info/entry_points.txt129writing requirements to SpeechRecognition.egg-info/requires.txt130writing top-level names to SpeechRecognition.egg-info/top_level.txt131reading manifest file 'SpeechRecognition.egg-info/SOURCES.txt'132reading manifest template 'MANIFEST.in'133warning: no previously-included files matching '*.pyc' found under directory 'speech_recognition'134adding license file 'LICENSE.txt'135adding license file 'LICENSE-FLAC.txt'136writing manifest file 'SpeechRecognition.egg-info/SOURCES.txt'137Copying SpeechRecognition.egg-info to build/bdist.linux-x86_64/wheel/./SpeechRecognition-3.17.0-py3.14.egg-info138running install_scripts139creating build/bdist.linux-x86_64/wheel/speechrecognition-3.17.0.dist-info/WHEEL140creating '/build/source/dist/.tmp-g7sd12aq/speechrecognition-3.17.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it141adding 'speech_recognition/__init__.py'142adding 'speech_recognition/__main__.py'143adding 'speech_recognition/audio.py'144adding 'speech_recognition/cli.py'145adding 'speech_recognition/exceptions.py'146adding 'speech_recognition/version.txt'147adding 'speech_recognition/pocketsphinx-data/en-US/LICENSE.txt'148adding 'speech_recognition/pocketsphinx-data/en-US/language-model.lm.bin'149adding 'speech_recognition/pocketsphinx-data/en-US/pronounciation-dictionary.dict'150adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/README'151adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/feat.params'152adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/mdef'153adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/means'154adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/noisedict'155adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/sendump'156adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/transition_matrices'157adding 'speech_recognition/pocketsphinx-data/en-US/acoustic-model/variances'158adding 'speech_recognition/recognizers/__init__.py'159adding 'speech_recognition/recognizers/cohere_api.py'160adding 'speech_recognition/recognizers/google.py'161adding 'speech_recognition/recognizers/google_cloud.py'162adding 'speech_recognition/recognizers/pocketsphinx.py'163adding 'speech_recognition/recognizers/vosk.py'164adding 'speech_recognition/recognizers/whisper_api/__init__.py'165adding 'speech_recognition/recognizers/whisper_api/base.py'166adding 'speech_recognition/recognizers/whisper_api/groq.py'167adding 'speech_recognition/recognizers/whisper_api/openai.py'168adding 'speech_recognition/recognizers/whisper_local/__init__.py'169adding 'speech_recognition/recognizers/whisper_local/base.py'170adding 'speech_recognition/recognizers/whisper_local/faster_whisper.py'171adding 'speech_recognition/recognizers/whisper_local/whisper.py'172adding 'speechrecognition-3.17.0.dist-info/licenses/LICENSE-FLAC.txt'173adding 'speechrecognition-3.17.0.dist-info/licenses/LICENSE.txt'174adding 'speechrecognition-3.17.0.dist-info/METADATA'175adding 'speechrecognition-3.17.0.dist-info/WHEEL'176adding 'speechrecognition-3.17.0.dist-info/entry_points.txt'177adding 'speechrecognition-3.17.0.dist-info/top_level.txt'178adding 'speechrecognition-3.17.0.dist-info/RECORD'179removing build/bdist.linux-x86_64/wheel180Successfully built speechrecognition-3.17.0-py3-none-any.whl181Finished creating a wheel...182Finished executing pypaBuildPhase
pythonRuntimeDepsCheckHook
183Executing pythonRuntimeDepsCheck184Checking runtime dependencies for speechrecognition-3.17.0-py3-none-any.whl185Finished executing pythonRuntimeDepsCheck
installPhase
186Executing pypaInstallPhase187Successfully installed speechrecognition-3.17.0-py3-none-any.whl188Finished executing pypaInstallPhase
pythonOutputDistPhase
189Executing pythonOutputDistPhase190Finished executing pythonOutputDistPhase
fixupPhase
191shrinking RPATHs of ELF executables and libraries in /nix/store/2wnghd4ly9xc183cid0gri3i2fj2cn4x-python3.14-speechrecognition-3.17.0-dist192checking for references to /build/ in /nix/store/2wnghd4ly9xc183cid0gri3i2fj2cn4x-python3.14-speechrecognition-3.17.0-dist...193patching script interpreter paths in /nix/store/2wnghd4ly9xc183cid0gri3i2fj2cn4x-python3.14-speechrecognition-3.17.0-dist194shrinking RPATHs of ELF executables and libraries in /nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0195checking for references to /build/ in /nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0...196patching script interpreter paths in /nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0197stripping (with command strip and flags -S -p) in /nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0/lib /nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0/bin198Rewriting #!/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/bin/python3.14 to #!/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10199wrapping `/nix/store/zqqz618hy32x819q9pp1fjsgjinzwiz1-python3.14-speechrecognition-3.17.0/bin/sprc'...200Executing pythonRemoveTestsDir201Finished executing pythonRemoveTestsDir
installCheckPhase
202no Makefile or custom installCheckPhase, doing nothing
pythonImportsCheckPhase
203Executing pythonImportsCheckPhase204Check whether the following modules can be imported: speech_recognition
pythonMetadataCheckPhase
205Executing pythonMetadataCheckPhase
pytestCheckPhase
206Executing pytestCheckPhase207pytest flags: -m pytest --ignore-glob=tests/recognizers/test_vosk.py -k not\ \(test_sphinx_keywords\)208============================= test session starts ==============================209platform linux -- Python 3.14.10, pytest-9.1.1, pluggy-1.7.0210rootdir: /build/source211configfile: pyproject.toml212plugins: anyio-4.15.1, pytest_httpserver-1.1.5, respx-0.23.1213collected 66 items / 1 deselected / 65 selected 214215tests/recognizers/test_cohere_api.py .. [ 3%]216tests/recognizers/test_google.py ........ [ 15%]217tests/recognizers/test_google_cloud.py .... [ 21%]218tests/recognizers/whisper_api/test_groq.py . [ 23%]219tests/recognizers/whisper_api/test_openai.py FFF [ 27%]220tests/recognizers/whisper_api/test_openai_compatible.py . [ 29%]221tests/recognizers/whisper_local/test_faster_whisper.py ssss [ 35%]222tests/recognizers/whisper_local/test_whisper.py sss [ 40%]223tests/test_audio.py ......................s.ssssssss [ 89%]224tests/test_recognition.py ssss..s [100%]225226=================================== FAILURES ===================================227_____________________ test_transcribe_with_openai_whisper ______________________228229 @contextlib.contextmanager230 def map_httpcore_exceptions() -> Generator[None]:231 global HTTPCORE_EXC_MAP232 if len(HTTPCORE_EXC_MAP) == 0:233 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()234 try:235> yield236237/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:98: 238_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 239/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:245: in handle_request240 resp = self._pool.handle_request(req)241 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^242/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:242: in handle_request243 raise exc from None244/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:224: in handle_request245 response = connection.handle_request(pool_request.request)246 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^247/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:94: in handle_request248 raise exc249/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:74: in handle_request250 stream = self._connect(request)251 ^^^^^^^^^^^^^^^^^^^^^^252/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:117: in _connect253 stream = self._network_backend.connect_tcp(**kwargs)254 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^255/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_backends/sync.py:203: in connect_tcp256 with map_exceptions(exc_map):257 ^^^^^^^^^^^^^^^^^^^^^^^258/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__259 self.gen.throw(value)260_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 261262map = {<class 'TimeoutError'>: <class 'httpcore2.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore2.ConnectError'>}263264 @contextlib.contextmanager265 def map_exceptions(map: ExceptionMapping) -> Generator[None]:266 try:267 yield268 except Exception as exc: # noqa: PIE786269 for from_exc, to_exc in map.items():270 if isinstance(exc, from_exc):271> raise to_exc(exc) from exc272E httpcore2.ConnectError: [Errno -3] Temporary failure in name resolution273274/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_exceptions.py:17: ConnectError275276The above exception was the direct cause of the following exception:277278self = <openai.OpenAI object at 0x7ffcc373bb60>279cast_to = <class 'openai.types.audio.transcription.Transcription'>280options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...{'bearer_auth': True}, synthesize_event_and_data=None, content=None, json_data={'model': 'whisper-1'}, extra_json=None)281stream = False282stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]283284 def request(285 self,286 cast_to: Type[ResponseT],287 options: FinalRequestOptions,288 *,289 stream: bool = False,290 stream_cls: type[_StreamT] | None = None,291 ) -> ResponseT | _StreamT:292 cast_to = self._maybe_override_cast_to(cast_to, options)293 294 # create a copy of the options we were given so that if the295 # options are mutated later & we then retry, the retries are296 # given the original options297 input_options = model_copy(options)298 if input_options.idempotency_key is None and input_options.method.lower() != "get":299 # ensure the idempotency key is reused between requests300 input_options.idempotency_key = self._idempotency_key()301 302 response: httpx2.Response | None = None303 max_retries = input_options.get_max_retries(self.max_retries)304 self._validate_max_retries(max_retries)305 306 retries_taken = 0307 for retries_taken in range(max_retries + 1):308 options = model_copy(input_options)309 options = self._prepare_options(options)310 311 remaining_retries = max_retries - retries_taken312 request = self._build_request(options, retries_taken=retries_taken)313 self._prepare_request(request)314 315 kwargs: HttpxSendArgs = {}316 custom_auth = self._custom_auth(options.security)317 if custom_auth is not None:318 kwargs["auth"] = (319 normalize_httpx2_auth(custom_auth)320 if is_httpx2_sync_client(self._client)321 else normalize_legacy_httpx_auth(custom_auth)322 )323 324 if options.follow_redirects is not None:325 kwargs["follow_redirects"] = options.follow_redirects326 327 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))328 329 response = None330 try:331> response = self._send_request(332 request,333 stream=stream or self._should_stream_response_body(request=request),334 **kwargs,335 )336337/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1086: 338_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 339/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:599: in _send_request340 response = self._send_with_auth_retry(request, stream=stream, **kwargs)341 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^342/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:578: in _send_with_auth_retry343 response = super()._send_request(request, stream=stream, **kwargs)344 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^345/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1008: in _send_request346 return self._client.send(request, stream=stream, **kwargs)347 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^348/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:980: in send349 response = self._send_handling_auth(350/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1008: in _send_handling_auth351 response = self._send_handling_redirects(352/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1043: in _send_handling_redirects353 response = self._send_single_request(request)354 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^355/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1076: in _send_single_request356 response = transport.handle_request(request)357 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^358/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:244: in handle_request359 with map_httpcore_exceptions():360 ^^^^^^^^^^^^^^^^^^^^^^^^^361/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__362 self.gen.throw(value)363_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 364365 @contextlib.contextmanager366 def map_httpcore_exceptions() -> Generator[None]:367 global HTTPCORE_EXC_MAP368 if len(HTTPCORE_EXC_MAP) == 0:369 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()370 try:371 yield372 except Exception as exc:373 mapped_exc = None374 375 for from_exc, to_exc in HTTPCORE_EXC_MAP.items():376 if not isinstance(exc, from_exc):377 continue378 # We want to map to the most specific exception we can find.379 # Eg if `exc` is an `httpcore2.ReadTimeout`, we want to map to380 # `httpx2.ReadTimeout`, not just `httpx2.TimeoutException`.381 if mapped_exc is None or issubclass(to_exc, mapped_exc):382 mapped_exc = to_exc383 384 if mapped_exc is None: # pragma: no cover385 raise386 387 message = str(exc)388> raise mapped_exc(message) from exc389E httpx2.ConnectError: [Errno -3] Temporary failure in name resolution390391/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:115: ConnectError392393The above exception was the direct cause of the following exception:394395respx_mock = <respx.router.MockRouter object at 0x7ffff04b6990>396setenv_openai_api_key = None397398 @respx.mock(assert_all_called=True, assert_all_mocked=True)399 def test_transcribe_with_openai_whisper(respx_mock, setenv_openai_api_key):400 respx_mock.post(401 "https://api.openai.com/v1/audio/transcriptions",402 headers__contains={"Authorization": "Bearer sk_openai_api_key"},403 data__contains={"model": "whisper-1"},404 ).mock(405 return_value=httpx.Response(406 200,407 json={"text": "Transcription by OpenAI Whisper"},408 )409 )410 411 audio_data = MagicMock(spec=AudioData)412 audio_data.get_wav_data.return_value = b"audio_data"413 414> actual = openai.recognize(MagicMock(spec=Recognizer), audio_data)415 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^416417tests/recognizers/whisper_api/test_openai.py:34: 418_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 419speech_recognition/recognizers/whisper_api/openai.py:58: in recognize420 return openai_recognizer.recognize(audio_data, model, **kwargs)421 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^422speech_recognition/recognizers/whisper_api/base.py:25: in recognize423 transcript = self.client.audio.transcriptions.create(424/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_utils/_utils.py:298: in wrapper425 return func(*args, **kwargs)426 ^^^^^^^^^^^^^^^^^^^^^427/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/resources/audio/transcriptions.py:525: in create428 return self._post( # type: ignore[return-value]429/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1378: in post430 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))431 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^432_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 433434self = <openai.OpenAI object at 0x7ffcc373bb60>435cast_to = <class 'openai.types.audio.transcription.Transcription'>436options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...{'bearer_auth': True}, synthesize_event_and_data=None, content=None, json_data={'model': 'whisper-1'}, extra_json=None)437stream = False438stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]439440 def request(441 self,442 cast_to: Type[ResponseT],443 options: FinalRequestOptions,444 *,445 stream: bool = False,446 stream_cls: type[_StreamT] | None = None,447 ) -> ResponseT | _StreamT:448 cast_to = self._maybe_override_cast_to(cast_to, options)449 450 # create a copy of the options we were given so that if the451 # options are mutated later & we then retry, the retries are452 # given the original options453 input_options = model_copy(options)454 if input_options.idempotency_key is None and input_options.method.lower() != "get":455 # ensure the idempotency key is reused between requests456 input_options.idempotency_key = self._idempotency_key()457 458 response: httpx2.Response | None = None459 max_retries = input_options.get_max_retries(self.max_retries)460 self._validate_max_retries(max_retries)461 462 retries_taken = 0463 for retries_taken in range(max_retries + 1):464 options = model_copy(input_options)465 options = self._prepare_options(options)466 467 remaining_retries = max_retries - retries_taken468 request = self._build_request(options, retries_taken=retries_taken)469 self._prepare_request(request)470 471 kwargs: HttpxSendArgs = {}472 custom_auth = self._custom_auth(options.security)473 if custom_auth is not None:474 kwargs["auth"] = (475 normalize_httpx2_auth(custom_auth)476 if is_httpx2_sync_client(self._client)477 else normalize_legacy_httpx_auth(custom_auth)478 )479 480 if options.follow_redirects is not None:481 kwargs["follow_redirects"] = options.follow_redirects482 483 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))484 485 response = None486 try:487 response = self._send_request(488 request,489 stream=stream or self._should_stream_response_body(request=request),490 **kwargs,491 )492 except timeout_exceptions() as err:493 log.debug("Encountered a timeout exception: %s", type(err).__name__)494 495 if remaining_retries > 0:496 self._sleep_for_retry(497 retries_taken=retries_taken,498 max_retries=max_retries,499 options=input_options,500 response=None,501 )502 continue503 504 log.debug("Raising timeout error")505 raise APITimeoutError(request=request) from err506 except OpenAIError as err:507 # Propagate OpenAIErrors as-is, without retrying or wrapping in APIConnectionError508 raise err509 except request_exceptions() as err:510 log.debug("Encountered exception: %s", type(err).__name__)511 512 if remaining_retries > 0:513 self._sleep_for_retry(514 retries_taken=retries_taken,515 max_retries=max_retries,516 options=input_options,517 response=None,518 )519 continue520 521 log.debug("Raising connection error")522> raise APIConnectionError(request=request) from err523E openai.APIConnectionError: Connection error.524525/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1121: APIConnectionError526___________________ test_transcribe_with_specified_language ____________________527528 @contextlib.contextmanager529 def map_httpcore_exceptions() -> Generator[None]:530 global HTTPCORE_EXC_MAP531 if len(HTTPCORE_EXC_MAP) == 0:532 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()533 try:534> yield535536/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:98: 537_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 538/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:245: in handle_request539 resp = self._pool.handle_request(req)540 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^541/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:242: in handle_request542 raise exc from None543/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:224: in handle_request544 response = connection.handle_request(pool_request.request)545 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^546/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:94: in handle_request547 raise exc548/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:74: in handle_request549 stream = self._connect(request)550 ^^^^^^^^^^^^^^^^^^^^^^551/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:117: in _connect552 stream = self._network_backend.connect_tcp(**kwargs)553 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^554/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_backends/sync.py:203: in connect_tcp555 with map_exceptions(exc_map):556 ^^^^^^^^^^^^^^^^^^^^^^^557/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__558 self.gen.throw(value)559_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 560561map = {<class 'TimeoutError'>: <class 'httpcore2.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore2.ConnectError'>}562563 @contextlib.contextmanager564 def map_exceptions(map: ExceptionMapping) -> Generator[None]:565 try:566 yield567 except Exception as exc: # noqa: PIE786568 for from_exc, to_exc in map.items():569 if isinstance(exc, from_exc):570> raise to_exc(exc) from exc571E httpcore2.ConnectError: [Errno -3] Temporary failure in name resolution572573/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_exceptions.py:17: ConnectError574575The above exception was the direct cause of the following exception:576577self = <openai.OpenAI object at 0x7ffcc2363610>578cast_to = <class 'openai.types.audio.transcription.Transcription'>579options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...ue}, synthesize_event_and_data=None, content=None, json_data={'model': 'whisper-1', 'language': 'en'}, extra_json=None)580stream = False581stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]582583 def request(584 self,585 cast_to: Type[ResponseT],586 options: FinalRequestOptions,587 *,588 stream: bool = False,589 stream_cls: type[_StreamT] | None = None,590 ) -> ResponseT | _StreamT:591 cast_to = self._maybe_override_cast_to(cast_to, options)592 593 # create a copy of the options we were given so that if the594 # options are mutated later & we then retry, the retries are595 # given the original options596 input_options = model_copy(options)597 if input_options.idempotency_key is None and input_options.method.lower() != "get":598 # ensure the idempotency key is reused between requests599 input_options.idempotency_key = self._idempotency_key()600 601 response: httpx2.Response | None = None602 max_retries = input_options.get_max_retries(self.max_retries)603 self._validate_max_retries(max_retries)604 605 retries_taken = 0606 for retries_taken in range(max_retries + 1):607 options = model_copy(input_options)608 options = self._prepare_options(options)609 610 remaining_retries = max_retries - retries_taken611 request = self._build_request(options, retries_taken=retries_taken)612 self._prepare_request(request)613 614 kwargs: HttpxSendArgs = {}615 custom_auth = self._custom_auth(options.security)616 if custom_auth is not None:617 kwargs["auth"] = (618 normalize_httpx2_auth(custom_auth)619 if is_httpx2_sync_client(self._client)620 else normalize_legacy_httpx_auth(custom_auth)621 )622 623 if options.follow_redirects is not None:624 kwargs["follow_redirects"] = options.follow_redirects625 626 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))627 628 response = None629 try:630> response = self._send_request(631 request,632 stream=stream or self._should_stream_response_body(request=request),633 **kwargs,634 )635636/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1086: 637_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 638/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:599: in _send_request639 response = self._send_with_auth_retry(request, stream=stream, **kwargs)640 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^641/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:578: in _send_with_auth_retry642 response = super()._send_request(request, stream=stream, **kwargs)643 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^644/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1008: in _send_request645 return self._client.send(request, stream=stream, **kwargs)646 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^647/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:980: in send648 response = self._send_handling_auth(649/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1008: in _send_handling_auth650 response = self._send_handling_redirects(651/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1043: in _send_handling_redirects652 response = self._send_single_request(request)653 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^654/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1076: in _send_single_request655 response = transport.handle_request(request)656 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^657/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:244: in handle_request658 with map_httpcore_exceptions():659 ^^^^^^^^^^^^^^^^^^^^^^^^^660/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__661 self.gen.throw(value)662_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 663664 @contextlib.contextmanager665 def map_httpcore_exceptions() -> Generator[None]:666 global HTTPCORE_EXC_MAP667 if len(HTTPCORE_EXC_MAP) == 0:668 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()669 try:670 yield671 except Exception as exc:672 mapped_exc = None673 674 for from_exc, to_exc in HTTPCORE_EXC_MAP.items():675 if not isinstance(exc, from_exc):676 continue677 # We want to map to the most specific exception we can find.678 # Eg if `exc` is an `httpcore2.ReadTimeout`, we want to map to679 # `httpx2.ReadTimeout`, not just `httpx2.TimeoutException`.680 if mapped_exc is None or issubclass(to_exc, mapped_exc):681 mapped_exc = to_exc682 683 if mapped_exc is None: # pragma: no cover684 raise685 686 message = str(exc)687> raise mapped_exc(message) from exc688E httpx2.ConnectError: [Errno -3] Temporary failure in name resolution689690/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:115: ConnectError691692The above exception was the direct cause of the following exception:693694respx_mock = <respx.router.MockRouter object at 0x7ffff09a4b00>695setenv_openai_api_key = None696697 @respx.mock(assert_all_called=True, assert_all_mocked=True)698 def test_transcribe_with_specified_language(respx_mock, setenv_openai_api_key):699 # https://github.com/Uberi/speech_recognition/issues/681700 respx_mock.post(701 "https://api.openai.com/v1/audio/transcriptions",702 data__contains={"language": "en"},703 ).respond(704 200,705 json={"text": "English transcription"},706 )707 708 audio_data = MagicMock(spec=AudioData)709 audio_data.get_wav_data.return_value = b"english_audio"710 711> actual = openai.recognize(712 MagicMock(spec=Recognizer), audio_data, language="en"713 )714715tests/recognizers/whisper_api/test_openai.py:54: 716_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 717speech_recognition/recognizers/whisper_api/openai.py:58: in recognize718 return openai_recognizer.recognize(audio_data, model, **kwargs)719 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^720speech_recognition/recognizers/whisper_api/base.py:25: in recognize721 transcript = self.client.audio.transcriptions.create(722/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_utils/_utils.py:298: in wrapper723 return func(*args, **kwargs)724 ^^^^^^^^^^^^^^^^^^^^^725/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/resources/audio/transcriptions.py:525: in create726 return self._post( # type: ignore[return-value]727/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1378: in post728 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))729 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^730_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 731732self = <openai.OpenAI object at 0x7ffcc2363610>733cast_to = <class 'openai.types.audio.transcription.Transcription'>734options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...ue}, synthesize_event_and_data=None, content=None, json_data={'model': 'whisper-1', 'language': 'en'}, extra_json=None)735stream = False736stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]737738 def request(739 self,740 cast_to: Type[ResponseT],741 options: FinalRequestOptions,742 *,743 stream: bool = False,744 stream_cls: type[_StreamT] | None = None,745 ) -> ResponseT | _StreamT:746 cast_to = self._maybe_override_cast_to(cast_to, options)747 748 # create a copy of the options we were given so that if the749 # options are mutated later & we then retry, the retries are750 # given the original options751 input_options = model_copy(options)752 if input_options.idempotency_key is None and input_options.method.lower() != "get":753 # ensure the idempotency key is reused between requests754 input_options.idempotency_key = self._idempotency_key()755 756 response: httpx2.Response | None = None757 max_retries = input_options.get_max_retries(self.max_retries)758 self._validate_max_retries(max_retries)759 760 retries_taken = 0761 for retries_taken in range(max_retries + 1):762 options = model_copy(input_options)763 options = self._prepare_options(options)764 765 remaining_retries = max_retries - retries_taken766 request = self._build_request(options, retries_taken=retries_taken)767 self._prepare_request(request)768 769 kwargs: HttpxSendArgs = {}770 custom_auth = self._custom_auth(options.security)771 if custom_auth is not None:772 kwargs["auth"] = (773 normalize_httpx2_auth(custom_auth)774 if is_httpx2_sync_client(self._client)775 else normalize_legacy_httpx_auth(custom_auth)776 )777 778 if options.follow_redirects is not None:779 kwargs["follow_redirects"] = options.follow_redirects780 781 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))782 783 response = None784 try:785 response = self._send_request(786 request,787 stream=stream or self._should_stream_response_body(request=request),788 **kwargs,789 )790 except timeout_exceptions() as err:791 log.debug("Encountered a timeout exception: %s", type(err).__name__)792 793 if remaining_retries > 0:794 self._sleep_for_retry(795 retries_taken=retries_taken,796 max_retries=max_retries,797 options=input_options,798 response=None,799 )800 continue801 802 log.debug("Raising timeout error")803 raise APITimeoutError(request=request) from err804 except OpenAIError as err:805 # Propagate OpenAIErrors as-is, without retrying or wrapping in APIConnectionError806 raise err807 except request_exceptions() as err:808 log.debug("Encountered exception: %s", type(err).__name__)809 810 if remaining_retries > 0:811 self._sleep_for_retry(812 retries_taken=retries_taken,813 max_retries=max_retries,814 options=input_options,815 response=None,816 )817 continue818 819 log.debug("Raising connection error")820> raise APIConnectionError(request=request) from err821E openai.APIConnectionError: Connection error.822823/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1121: APIConnectionError824____________________ test_transcribe_with_specified_prompt _____________________825826 @contextlib.contextmanager827 def map_httpcore_exceptions() -> Generator[None]:828 global HTTPCORE_EXC_MAP829 if len(HTTPCORE_EXC_MAP) == 0:830 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()831 try:832> yield833834/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:98: 835_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 836/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:245: in handle_request837 resp = self._pool.handle_request(req)838 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^839/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:242: in handle_request840 raise exc from None841/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection_pool.py:224: in handle_request842 response = connection.handle_request(pool_request.request)843 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^844/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:94: in handle_request845 raise exc846/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:74: in handle_request847 stream = self._connect(request)848 ^^^^^^^^^^^^^^^^^^^^^^849/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_sync/connection.py:117: in _connect850 stream = self._network_backend.connect_tcp(**kwargs)851 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^852/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_backends/sync.py:203: in connect_tcp853 with map_exceptions(exc_map):854 ^^^^^^^^^^^^^^^^^^^^^^^855/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__856 self.gen.throw(value)857_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 858859map = {<class 'TimeoutError'>: <class 'httpcore2.ConnectTimeout'>, <class 'OSError'>: <class 'httpcore2.ConnectError'>}860861 @contextlib.contextmanager862 def map_exceptions(map: ExceptionMapping) -> Generator[None]:863 try:864 yield865 except Exception as exc: # noqa: PIE786866 for from_exc, to_exc in map.items():867 if isinstance(exc, from_exc):868> raise to_exc(exc) from exc869E httpcore2.ConnectError: [Errno -3] Temporary failure in name resolution870871/nix/store/mqmnl3990417fhpyvxcwgq2mfi716x7l-python3.14-httpcore2-2.13.1/lib/python3.14/site-packages/httpcore2/_exceptions.py:17: ConnectError872873The above exception was the direct cause of the following exception:874875self = <openai.OpenAI object at 0x7ffcc2363110>876cast_to = <class 'openai.types.audio.transcription.Transcription'>877options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...nd_data=None, content=None, json_data={'model': 'whisper-1', 'prompt': 'Glossary: Aimee, Shawn, BBQ'}, extra_json=None)878stream = False879stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]880881 def request(882 self,883 cast_to: Type[ResponseT],884 options: FinalRequestOptions,885 *,886 stream: bool = False,887 stream_cls: type[_StreamT] | None = None,888 ) -> ResponseT | _StreamT:889 cast_to = self._maybe_override_cast_to(cast_to, options)890 891 # create a copy of the options we were given so that if the892 # options are mutated later & we then retry, the retries are893 # given the original options894 input_options = model_copy(options)895 if input_options.idempotency_key is None and input_options.method.lower() != "get":896 # ensure the idempotency key is reused between requests897 input_options.idempotency_key = self._idempotency_key()898 899 response: httpx2.Response | None = None900 max_retries = input_options.get_max_retries(self.max_retries)901 self._validate_max_retries(max_retries)902 903 retries_taken = 0904 for retries_taken in range(max_retries + 1):905 options = model_copy(input_options)906 options = self._prepare_options(options)907 908 remaining_retries = max_retries - retries_taken909 request = self._build_request(options, retries_taken=retries_taken)910 self._prepare_request(request)911 912 kwargs: HttpxSendArgs = {}913 custom_auth = self._custom_auth(options.security)914 if custom_auth is not None:915 kwargs["auth"] = (916 normalize_httpx2_auth(custom_auth)917 if is_httpx2_sync_client(self._client)918 else normalize_legacy_httpx_auth(custom_auth)919 )920 921 if options.follow_redirects is not None:922 kwargs["follow_redirects"] = options.follow_redirects923 924 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))925 926 response = None927 try:928> response = self._send_request(929 request,930 stream=stream or self._should_stream_response_body(request=request),931 **kwargs,932 )933934/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1086: 935_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 936/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:599: in _send_request937 response = self._send_with_auth_retry(request, stream=stream, **kwargs)938 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^939/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_client.py:578: in _send_with_auth_retry940 response = super()._send_request(request, stream=stream, **kwargs)941 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^942/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1008: in _send_request943 return self._client.send(request, stream=stream, **kwargs)944 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^945/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:980: in send946 response = self._send_handling_auth(947/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1008: in _send_handling_auth948 response = self._send_handling_redirects(949/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1043: in _send_handling_redirects950 response = self._send_single_request(request)951 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^952/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_client.py:1076: in _send_single_request953 response = transport.handle_request(request)954 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^955/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:244: in handle_request956 with map_httpcore_exceptions():957 ^^^^^^^^^^^^^^^^^^^^^^^^^958/nix/store/bya4ansy58az5133kryqp2cvrxbnz8qy-python3-3.14.10/lib/python3.14/contextlib.py:162: in __exit__959 self.gen.throw(value)960_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 961962 @contextlib.contextmanager963 def map_httpcore_exceptions() -> Generator[None]:964 global HTTPCORE_EXC_MAP965 if len(HTTPCORE_EXC_MAP) == 0:966 HTTPCORE_EXC_MAP = _load_httpcore_exceptions()967 try:968 yield969 except Exception as exc:970 mapped_exc = None971 972 for from_exc, to_exc in HTTPCORE_EXC_MAP.items():973 if not isinstance(exc, from_exc):974 continue975 # We want to map to the most specific exception we can find.976 # Eg if `exc` is an `httpcore2.ReadTimeout`, we want to map to977 # `httpx2.ReadTimeout`, not just `httpx2.TimeoutException`.978 if mapped_exc is None or issubclass(to_exc, mapped_exc):979 mapped_exc = to_exc980 981 if mapped_exc is None: # pragma: no cover982 raise983 984 message = str(exc)985> raise mapped_exc(message) from exc986E httpx2.ConnectError: [Errno -3] Temporary failure in name resolution987988/nix/store/wgmr1mxclpkq8mpvd87c26azx1fp3zwy-python3.14-httpx2-2.13.1/lib/python3.14/site-packages/httpx2/_transports/default.py:115: ConnectError989990The above exception was the direct cause of the following exception:991992respx_mock = <respx.router.MockRouter object at 0x7ffff03e1810>993setenv_openai_api_key = None994995 @respx.mock(assert_all_called=True, assert_all_mocked=True)996 def test_transcribe_with_specified_prompt(respx_mock, setenv_openai_api_key):997 # https://github.com/Uberi/speech_recognition/pull/676998 respx_mock.post(999 "https://api.openai.com/v1/audio/transcriptions",1000 # ref: https://cookbook.openai.com/examples/whisper_prompting_guide1001 data__contains={"prompt": "Glossary: Aimee, Shawn, BBQ"},1002 ).respond(1003 200,1004 json={"text": "Prompted transcription"},1005 )1006 1007 audio_data = MagicMock(spec=AudioData)1008 audio_data.get_wav_data.return_value = b"audio_data"1009 1010> actual = openai.recognize(1011 MagicMock(spec=Recognizer),1012 audio_data,1013 prompt="Glossary: Aimee, Shawn, BBQ",1014 )10151016tests/recognizers/whisper_api/test_openai.py:76: 1017_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1018speech_recognition/recognizers/whisper_api/openai.py:58: in recognize1019 return openai_recognizer.recognize(audio_data, model, **kwargs)1020 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^1021speech_recognition/recognizers/whisper_api/base.py:25: in recognize1022 transcript = self.client.audio.transcriptions.create(1023/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_utils/_utils.py:298: in wrapper1024 return func(*args, **kwargs)1025 ^^^^^^^^^^^^^^^^^^^^^1026/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/resources/audio/transcriptions.py:525: in create1027 return self._post( # type: ignore[return-value]1028/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1378: in post1029 return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))1030 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^1031_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 10321033self = <openai.OpenAI object at 0x7ffcc2363110>1034cast_to = <class 'openai.types.audio.transcription.Transcription'>1035options = FinalRequestOptions(method='post', url='/audio/transcriptions', params={}, headers={'Content-Type': 'multipart/form-da...nd_data=None, content=None, json_data={'model': 'whisper-1', 'prompt': 'Glossary: Aimee, Shawn, BBQ'}, extra_json=None)1036stream = False1037stream_cls = openai.Stream[typing.Annotated[openai.types.audio.transcription_text_segment_event.TranscriptionTextSegmentEvent | ope...ent.TranscriptionTextDoneEvent, PropertyInfo(alias='None', format=None, format_template='None', discriminator='type')]]10381039 def request(1040 self,1041 cast_to: Type[ResponseT],1042 options: FinalRequestOptions,1043 *,1044 stream: bool = False,1045 stream_cls: type[_StreamT] | None = None,1046 ) -> ResponseT | _StreamT:1047 cast_to = self._maybe_override_cast_to(cast_to, options)1048 1049 # create a copy of the options we were given so that if the1050 # options are mutated later & we then retry, the retries are1051 # given the original options1052 input_options = model_copy(options)1053 if input_options.idempotency_key is None and input_options.method.lower() != "get":1054 # ensure the idempotency key is reused between requests1055 input_options.idempotency_key = self._idempotency_key()1056 1057 response: httpx2.Response | None = None1058 max_retries = input_options.get_max_retries(self.max_retries)1059 self._validate_max_retries(max_retries)1060 1061 retries_taken = 01062 for retries_taken in range(max_retries + 1):1063 options = model_copy(input_options)1064 options = self._prepare_options(options)1065 1066 remaining_retries = max_retries - retries_taken1067 request = self._build_request(options, retries_taken=retries_taken)1068 self._prepare_request(request)1069 1070 kwargs: HttpxSendArgs = {}1071 custom_auth = self._custom_auth(options.security)1072 if custom_auth is not None:1073 kwargs["auth"] = (1074 normalize_httpx2_auth(custom_auth)1075 if is_httpx2_sync_client(self._client)1076 else normalize_legacy_httpx_auth(custom_auth)1077 )1078 1079 if options.follow_redirects is not None:1080 kwargs["follow_redirects"] = options.follow_redirects1081 1082 log.debug("Sending HTTP Request: %s", get_http_method_for_logging(request.method))1083 1084 response = None1085 try:1086 response = self._send_request(1087 request,1088 stream=stream or self._should_stream_response_body(request=request),1089 **kwargs,1090 )1091 except timeout_exceptions() as err:1092 log.debug("Encountered a timeout exception: %s", type(err).__name__)1093 1094 if remaining_retries > 0:1095 self._sleep_for_retry(1096 retries_taken=retries_taken,1097 max_retries=max_retries,1098 options=input_options,1099 response=None,1100 )1101 continue1102 1103 log.debug("Raising timeout error")1104 raise APITimeoutError(request=request) from err1105 except OpenAIError as err:1106 # Propagate OpenAIErrors as-is, without retrying or wrapping in APIConnectionError1107 raise err1108 except request_exceptions() as err:1109 log.debug("Encountered exception: %s", type(err).__name__)1110 1111 if remaining_retries > 0:1112 self._sleep_for_retry(1113 retries_taken=retries_taken,1114 max_retries=max_retries,1115 options=input_options,1116 response=None,1117 )1118 continue1119 1120 log.debug("Raising connection error")1121> raise APIConnectionError(request=request) from err1122E openai.APIConnectionError: Connection error.11231124/nix/store/g5mrx28a83raz0jm65c8akfclnls7vm9-python3.14-openai-3.14.1/lib/python3.14/site-packages/openai/_base_client.py:1121: APIConnectionError1125=============================== warnings summary ===============================1126speech_recognition/__init__.py:71127 /build/source/speech_recognition/__init__.py:7: DeprecationWarning: aifc was removed in Python 3.13. Please be aware that you are currently NOT using standard 'aifc', but instead a separately installed 'standard-aifc'.1128 import aifc11291130-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html1131=========================== short test summary info ============================1132FAILED tests/recognizers/whisper_api/test_openai.py::test_transcribe_with_openai_whisper - openai.APIConnectionError: Connection error.1133FAILED tests/recognizers/whisper_api/test_openai.py::test_transcribe_with_specified_language - openai.APIConnectionError: Connection error.1134FAILED tests/recognizers/whisper_api/test_openai.py::test_transcribe_with_specified_prompt - openai.APIConnectionError: Connection error.1135====== 3 failed, 41 passed, 21 skipped, 1 deselected, 1 warning in 20.53s ======