Mark Lawrence added the comment:

Hardly a good start :-(  From the IDLE shell.

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit 
(Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from pkgutil import walk_packages
>>> packages = list(walk_packages())
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    packages = list(walk_packages())
  File "C:\Python34\lib\pkgutil.py", line 86, in walk_packages
    __import__(name)
  File "C:\Python34\lib\site-packages\pip\__init__.py", line 9, in <module>
    from pip.log import logger
  File "C:\Python34\lib\site-packages\pip\log.py", line 8, in <module>
    from pip import backwardcompat
  File "C:\Python34\lib\site-packages\pip\backwardcompat\__init__.py", line 27, 
in <module>
    console_encoding = sys.__stdout__.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'

Then from the command line.

C:\Users\Mark\MyPython>type wptest.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from pkgutil import walk_packages

packages = list(walk_packages())

C:\Users\Mark\MyPython>wptest.py
c:\python34\lib\site-packages\wx\core.py:22: UserWarning: wxPython/wxWidgets 
release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
C:\Users\Mark\MyPython\wptest.py in <module>()
      4 from pkgutil import walk_packages
      5
----> 6 packages = list(walk_packages())

c:\python34\lib\pkgutil.py in walk_packages(path, prefix, onerror)
     99                 path = [p for p in path if not seen(p)]
    100
--> 101                 yield from walk_packages(path, name+'.', onerror)
    102
    103

c:\python34\lib\pkgutil.py in walk_packages(path, prefix, onerror)
     99                 path = [p for p in path if not seen(p)]
    100
--> 101                 yield from walk_packages(path, name+'.', onerror)
    102
    103

c:\python34\lib\pkgutil.py in walk_packages(path, prefix, onerror)
     99                 path = [p for p in path if not seen(p)]
    100
--> 101                 yield from walk_packages(path, name+'.', onerror)
    102
    103

c:\python34\lib\pkgutil.py in walk_packages(path, prefix, onerror)
     99                 path = [p for p in path if not seen(p)]
    100
--> 101                 yield from walk_packages(path, name+'.', onerror)
    102
    103

c:\python34\lib\pkgutil.py in walk_packages(path, prefix, onerror)
     84         if ispkg:
     85             try:
---> 86                 __import__(name)
     87             except ImportError:
     88                 if onerror is not None:

c:\python34\lib\site-packages\wx\lib\pubsub\core\arg1\__init__.py in <module>()
     14
     15 msg = 'Should not import this directly, used by pubsub.core if 
applicable'
---> 16 raise RuntimeError(msg)

RuntimeError: Should not import this directly, used by pubsub.core if applicable

But then.

C:\Users\Mark\MyPython>cd c:\cpython\pcbuild

c:\cpython\PCbuild>python_d.exe C:\Users\Mark\MyPython\wptest.py

c:\cpython\PCbuild>

No problems above!!!

Given Brett's comment in msg165456 "But if we do this then I want to deprecate 
pkgutil in Python 3.4" I don't believe that this is worth pursuing, or have I 
missed something?

----------
nosy: +brett.cannon

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15358>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to