Author Antony.Lee
Recipients Antony.Lee
Date 2015-10-07.03:06:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The docs of pkgutil.get_data say "The resource argument should be in the form of a relative filename, using / as the path separator. The parent directory name .. is not allowed, and nor is a rooted name (starting with a /)."

In fact (on Python 3.5 at least):
* pkgutil.get_data("logging", "/") works, but simply chops off the first slash, returning the contents of the stdlib's logging/
* pkgutil.get_data("logging", "../") works, returning the contents of the stdlib's

People who actually thought about the implications of get_data/zipimport/etc. can decide whether to remove this functionality or to update the docs, I'm just reporting it.

Also, it would be nice if get_data gained a "text mode" (i.e. returning str instead of bytes and with support for universal newlines).
Date User Action Args
2015-10-07 03:06:14Antony.Leesetrecipients: + Antony.Lee
2015-10-07 03:06:14Antony.Leesetmessageid: <>
2015-10-07 03:06:14Antony.Leelinkissue25330 messages
2015-10-07 03:06:13Antony.Leecreate