In the logic of django_find_project there exist these lines:
def find_django_path(args):
args = map(str, args)
args = [arg_to_path(x) for x in args if not x.startswith("-")]
args = [p for p in args if p.is_dir()]
...
Unfortunately, this means that if there are really long command-line args that this can get a OSError: [Errno 36] File name too long: ... which prevents me from, for example, using really long args to pytest's -k option.
Thanks for looking into this.
Please consider creating a failing test and fix for this yourself.
I assume the args = [p for p in args if p.is_dir()] should be turned into a loop that try/catches any OSError and ignores it.
/cc @voidus for the pathlib change that appears to trigger this
I'm sorry that my change caused these bugs and that I usually take a while to look into them. Definitely keep cc'ing me though! :bowing_man:
Thanks a lot for fixing so fast!