[issue28425] Python3 ignores __init__.py that are links to /dev/null

2017-02-28 Thread Douglas Greiman
Douglas Greiman added the comment: Bazel has been updated to no longer create symlinks to /dev/null https://github.com/bazelbuild/bazel/issues/1458 -- ___ Python tracker

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-10 Thread Brett Cannon
Brett Cannon added the comment: Those results are expected as passing in a file by path means it's just read by open() and then passed to exec() while the others pass through import itself which has the os.path.isfile() check. Since this is a change from Python 2.7 I would be willing to look

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-09 Thread Douglas Greiman
Douglas Greiman added the comment: To be thorough, I looked at non __init__.py source files as well, with erratic results. And who knows what would happen on other OS's. So a blanket "must be a regular file" seems reasonable. $ ls -l b.* lrwxrwxrwx 1 dgreiman eng 9 Dec 9 16:05 b.py ->

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-09 Thread Brett Cannon
Brett Cannon added the comment: There's probably a place to mention it in the language spec for import and/or importlib. -- ___ Python tracker ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-12-08 Thread Douglas Greiman
Douglas Greiman added the comment: Is there a reasonable place to document that __init__.py (and probably source files in general) must be a "regular file" by the Unix definition, and not a device file, socket, etc? -- ___ Python tracker

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-14 Thread Brett Cannon
Brett Cannon added the comment: Since /dev/null is not a file according to os.path.isfile(), I'm going to close this as not a bug. And to answer Antti's question, it's because the semantics come from the original C code where EAFP is not pleasant. -- nosy: +brett.cannon resolution:

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-14 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> test needed versions: +Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-13 Thread Douglas Greiman
Douglas Greiman added the comment: See associated bug filed against Bazel: https://github.com/bazelbuild/bazel/issues/1458 As for why Bazel does that, it's related to the sandboxing implementation but I don't know any details beyond that. -- ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-13 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-13 Thread Antti Haapala
Antti Haapala added the comment: One question is why doesn't it just try to `open`, but wants to stat first, when the python principle has always been EAFP. -- nosy: +ztane ___ Python tracker

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-13 Thread Senthil Kumaran
Senthil Kumaran added the comment: I wanted to ask, Do you know why bazel does that? -- ___ Python tracker ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-13 Thread Senthil Kumaran
Senthil Kumaran added the comment: Linking __init__.py to /dev/null is very odd. Do you know bazel does that? -- nosy: +orsenthil ___ Python tracker ___

[issue28425] Python3 ignores __init__.py that are links to /dev/null

2016-10-12 Thread Douglas Greiman
New submission from Douglas Greiman: This manifests in the following way: A package directory containing an __init__.py that is a symlink to /dev/null is treated as a namespace package instead of a regular package. The Bazel build tool creates many __init__.py files in this way, which is how