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
5.9.0 made changes to the way gitignore is handled (see 927cf7e and 4f32c44), but unfortunately doesn't take into account that a typical project could easily have many thousands of files. The following line then blows up:
In our project, git tracks 214 files. But, running glob.glob() on the same directory gives me:
$ python3 -c 'import glob; print(sum(1 for _ in glob.glob("./**/*", recursive=True)))'
8677
8677 is way too many arguments to pass to a single command. Our project happens to include a Node.js component and so has a node_modules subfolder (ignored), accounting for 7.3k files in that total.
The code should either be reverted, or updated to handle a large number of files in batches, or use the --stdin to pipe through the filenames over stdin.
E.g. the following code works for our project without breaking command-line length:
Note: in addition to switching to --stdin, I also added LANG=C.UTF-8 to the environment (should make the codecs.escape_decode() call obsolete on Windows), and used .splitlines() to remove the need to handle an empty last line result.
The text was updated successfully, but these errors were encountered:
Fantastic, thanks for the fast turn-around! I was looking into why escape_decode() (an unsupported legacy function) was being used and found out about git’s octal escapes. These can be disabled by passing -c core.quotePath= to git commands. Add -z to use NUL delimiters should eliminate all remaining quoting reasons.
5.9.0 made changes to the way gitignore is handled (see 927cf7e and 4f32c44), but unfortunately doesn't take into account that a typical project could easily have many thousands of files. The following line then blows up:
isort/isort/settings.py
Line 546 in 0ccefec
with:
In our project, git tracks 214 files. But, running
glob.glob()
on the same directory gives me:8677 is way too many arguments to pass to a single command. Our project happens to include a Node.js component and so has a
node_modules
subfolder (ignored), accounting for 7.3k files in that total.The code should either be reverted, or updated to handle a large number of files in batches, or use the
--stdin
to pipe through the filenames over stdin.E.g. the following code works for our project without breaking command-line length:
Note: in addition to switching to
--stdin
, I also addedLANG=C.UTF-8
to the environment (should make thecodecs.escape_decode()
call obsolete on Windows), and used.splitlines()
to remove the need to handle an empty last line result.The text was updated successfully, but these errors were encountered: