[issue29351] absolute imports for logging

2017-01-23 Thread Markus Gerstel

New submission from Markus Gerstel:

Running 'import logging' causes at minimum 46 failing 'open' and 12 failing 
'stat' calls because python looks for packages inside python/Lib/logging which 
will never be there, in particular: sys, os, time, cStringIO, traceback, 
warnings, weakref, collections, codecs, thread, threading, atexit.

The impact of this is limited when python is installed locally, but noticeable 
when run on a networked file system.


How to reproduce: 
run 
$ strace python -c "import logging;" 2>&1 | grep ENOENT | grep "\/logging\/"


How to fix:
Add 'from __future__ import absolute_import' to all files in the logging 
directory.
A relevant patch is attached.

--
components: Library (Lib)
files: 0001-absolute-import.patch
keywords: patch
messages: 286083
nosy: mgerstel
priority: normal
severity: normal
status: open
title: absolute imports for logging
type: resource usage
versions: Python 2.7
Added file: http://bugs.python.org/file46390/0001-absolute-import.patch

___
Python tracker 
<http://bugs.python.org/issue29351>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29351] absolute imports for logging

2017-01-23 Thread Markus Gerstel

Changes by Markus Gerstel :


--
nosy: +vinay.sajip

___
Python tracker 
<http://bugs.python.org/issue29351>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29351] absolute imports for logging

2017-01-23 Thread Markus Gerstel

Markus Gerstel added the comment:

Yes, this is indeed the same for other stdlib modules, too. Logging is just the 
first one that came to attention in our investigations.

I haven't prepared any other patches yet though, because your answer could 
easily be "No, we cannot consider these changes under any circumstances for 2.7 
because $reason".

--

___
Python tracker 
<http://bugs.python.org/issue29351>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com