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

OSError on long command-line args #662

Closed
mjk4 opened this issue Oct 10, 2018 · 4 comments
Closed

OSError on long command-line args #662

mjk4 opened this issue Oct 10, 2018 · 4 comments
Labels

Comments

@mjk4
Copy link

mjk4 commented Oct 10, 2018

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.

@blueyed
Copy link
Contributor

blueyed commented Oct 10, 2018

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.

@blueyed blueyed added the bug label Oct 10, 2018
@blueyed
Copy link
Contributor

blueyed commented Oct 10, 2018

/cc @voidus for the pathlib change that appears to trigger this

@voidus
Copy link
Contributor

voidus commented Oct 16, 2018

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! 🙇‍♂️

@mjk4
Copy link
Author

mjk4 commented Oct 19, 2018

Thanks a lot for fixing so fast!

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

No branches or pull requests

3 participants