[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread R. David Murray
R. David Murray added the comment: The pkguitil.get_data function is the *right* way to access package-relative data (because in the general case the data may not be on the file system), and IMO it would not be a good idea to make it easier to do things the "wrong" way. Any deficiencies with

[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Martin Panter
Martin Panter added the comment: There is also pkgutil.get_data(), but that returns the file contents rather than file path, which has rarely been useful to me. -- ___ Python tracker __

[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Martin Panter
Martin Panter added the comment: This feature could be handy for finding test files in test suites. However I don’t think the abspath() step is necessary. We kind of want a urljoin() for OS paths, that automatically removes the current file name. As a new feature I think it would be too late

[issue24396] Provide convenience function for paths relative to the current module

2015-06-06 Thread Madison May
New submission from Madison May: I often find myself trying to access a file relative to the module I'm working on. When this occurs, I'll often use something like the following: ``` os.path.abspath(os.path.join(os.path.dirname(__file__), "data/resource.pkl")) ``` I have good reason to believ