[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread STINNER Victor
STINNER Victor added the comment: > Sure, that's obvious for `datetime` and `sys`. Less obvious for unexpected > conflicts with stdlib modules that begin with an underscore... Yeah, sadly, these modules are less known, but cause the same kind of issues :-( -- __

[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread mmckerns
mmckerns added the comment: Sure, that's obvious for `datetime` and `sys`. Less obvious for unexpected conflicts with stdlib modules that begin with an underscore... -- ___ Python tracker _

[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread STINNER Victor
STINNER Victor added the comment: This issue is not a bug. You should not use the same module name, than a stdlib module. For example, if you have a "sys.py" file in your Python path (PYTHONPATH), you will get big troubles. -- nosy: +vstinner resolution: -> not a bug stage: -> reso

[issue39230] fail on datetime import if _datetime.py exists in PATH

2020-01-06 Thread mmckerns
New submission from mmckerns : In Lib/datetime.py, there's an import: `from _datetime import *` which will fail if `_datetime.py` exists in the current directory, or earlier in the path than Lib. For reference, see: https://github.com/numpy/numpy/issues/15257 -- components: Library (L