amoffat / sh

Python process launching
https://sh.readthedocs.io/en/latest/
MIT License
6.98k stars 506 forks source link

Monkey patch of glob.glob breaks root_dir kwarg #725

Closed AaronDMarasco closed 5 months ago

AaronDMarasco commented 5 months ago

MWE:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob("*steam*", root_dir="/tmp/")
['steam_chrome_shmem_uid1000_spid18613', 'steamHMDDCa', 'steam']
>>> import sh
>>> sh.__version__
'2.0.6'
>>> glob.glob("*steam*", root_dir="/tmp/")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: glob() got an unexpected keyword argument 'root_dir'
>>> 

From what I can tell looking at the source, the library simply forwards all kwargs but I don't know enough to trace it.

Encountered in python 3.10.5 and 3.10.12.

AaronDMarasco commented 5 months ago

The "you seem to forward kwargs" seems to be talking about develop which I saw here on github. When I edit the file locally, it doesn't do that. So maybe this is already fixed in develop but not yet released.

AaronDMarasco commented 5 months ago

Yep fixed in 2e60b9032e12a105edaefba58059990f5d9e18df thanks to @Pistahh please release a new version. 😅

AaronDMarasco commented 5 months ago

Dupe of #708 I guess.

amoffat commented 5 months ago

Thanks for bringing this to my attention. Version 2.0.7 is released with the glob fix