You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in #15654, these attributes were made less typesafe by changing their type from IO[AnyStr] to IO[Any]:
fromsubprocessimportPIPE, PopenwithPopen(["echo", "hi"], stdout=PIPE, text=True) asprocess:
ifprocess.stdout:
forlineinprocess.stdout:
line.asdfasdf# no type error, crashes at runtime
there didn't seem to be any explanation for this change in that PR which is why i'm opening a new issue. is there a reason the types can't be IO[AnyStr]?
I reproduced the loss of the Popen[str] and Popen[bytes] stream types on current main. I’ll restore the attributes to use the class type parameter and run the subprocess stub checks.
Activity
nightcityblade commentedon Aug 12, 2026
Hi, I'd like to work on this. I'll submit a focused PR shortly.
nightcityblade commentedon Aug 12, 2026
I took a closer look and won't be able to complete this within the current contribution batch. Releasing it for someone else—sorry for the noise.
srittau commentedon Aug 12, 2026
I'm actually not sure why I changed this, this seems more like an accident and should be restored.
Boulea7 commentedon Aug 13, 2026
I reproduced the loss of the
Popen[str]andPopen[bytes]stream types on current main. I’ll restore the attributes to use the class type parameter and run the subprocess stub checks.