Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monkey patch of glob.glob breaks root_dir kwarg #725

Closed
AaronDMarasco opened this issue May 30, 2024 · 4 comments
Closed

Monkey patch of glob.glob breaks root_dir kwarg #725

AaronDMarasco opened this issue May 30, 2024 · 4 comments

Comments

@AaronDMarasco
Copy link

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
Copy link
Author

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
Copy link
Author

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

@AaronDMarasco
Copy link
Author

Dupe of #708 I guess.

@amoffat
Copy link
Owner

amoffat commented Jun 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants