-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
test fails in ntpath.py when LocalPath has no len #651
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
Comments
Original comment by Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco): I've noticed other failures if I attempt to use a LocalPath, such as with an invocation of subprocess.Popen:
That will fail with TypeError: argument of type 'LocalPath' is not iterable. In general, it seems that a LocalPath is not a string, so can't be used in place of where a string path would be used. |
I think it's intentional that
So I think this can be closed if you agree, @jaraco 😄 |
That seems reasonable, I guess. It's slightly surprising, and ugly, to have to cast a path to a I guess my objection lies in the tradeoff. It seems like a pretty unfortunate tradeoff for But if that's the design of the authors, I'll roll with it. Thanks for the info. And yes, please close. |
@jaraco please keep in mind that path objects have all methods for path manipulation and file interaction, so one doesn't have to use the legacy functions of the stdlib no making it a string is very intentional, but i guess we should document conversion a bit more there are plans to create a pathlib based variant in future which should be more agreeable with the stdlib interaction but thats a long term goal, nothing closeby |
Originally reported by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)
Consider this simple test:
Invoke that test on Windows in pytest 2.6.4, and you'll get a failure:
Should LocalPath support join operations or should the tester expect to convert the LocalPath to a
str
before invoking join?Probably the preferred usage is to use the
.join()
method on LocalPath, but that's less obvious.The text was updated successfully, but these errors were encountered: