python / python/cpython

sockets and asyncio on Windows depend on SYSTEMROOT env var

オープン
#118,234 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

docs easy topic-socket
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug report

Bug description:
os.environ.clear() # THIS WAS THE CAUSE!!!
import asyncio

This causes the following:

Traceback (most recent call last):
  File "c:\Users\user\Documents\Development\main\main.py", line 3, in <module>
    import asyncio
  File "C:\Program Files\Python311\Lib\asyncio\__init__.py", line 42, in <module>
    from .windows_events import *
  File "C:\Program Files\Python311\Lib\asyncio\windows_events.py", line 8, in <module>
    import _overlapped
OSError: [WinError 10106] The requested service provider could not be loaded or initialized

It took me a whole day to figure out that os.environ.clear() causes this bug to occur. I'm not sure if this is supposed to occur, I just thought I would post this in case other people are struggling with this.

CPython versions tested on:

3.8, 3.9, 3.10, 3.11

Operating systems tested on:

Windows

Linked PRs
  • gh-134363
  • gh-134435

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、報告された asyncio/init.py と asyncio/windows_events.py を経由するインポートパスを確認し、次に関連する PR の gh-134363 と gh-134435 を調査します。asyncio をインポートする前に os.environ.clear() を使用して Windows で障害を再現し、既存の議論を使って期待される動作と完了条件を判断します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
networking, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。