Author Michael.Felt
Recipients David.Edelsohn, Michael.Felt, aixtools@gmail.com, martin.panter, python-dev
Date 2016-10-04.20:13:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475612038.77.0.893838211426.issue26439@psf.upfronthosting.co.za>
In-reply-to
Content
Curious.

When in 32-bit mode changing line 15 of _aix.py to

   +14  import re, os, sys
   +15  # from . import util

The Lib/ctypes/util.py works.

In 64-bit mode it does not:
instead:

root@x064:[/data/prj/python/python-3.6.0.177/Lib/ctypes]../../python util.py
m       :: None
c       :: libc.a(shr_64.o)
Traceback (most recent call last):
  File "util.py", line 355, in <module>
    test()
  File "util.py", line 330, in test
    print("bz2\t:: %s" % find_library("bz2"))
  File "util.py", line 104, in find_library
    return aix.find_library(name)
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/_aix.py", line 255, in find_library
    (base, member) = find_shared(libpaths, name)
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/_aix.py", line 247, in find_shared
    member = get_member(re.escape(name), members)
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/_aix.py", line 189, in get_member
    member = get_version(name, members)
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/_aix.py", line 170, in get_version
    return util._last_version(versions, '.')
NameError: name 'util' is not defined

+++++
When the comment is removed, i.e.
from . import util

both 32 and 64-bit report:
root@x064:[/data/prj/python/python-3.6.0.177/Lib/ctypes]../../python util.py
Traceback (most recent call last):
  File "util.py", line 102, in <module>
    import ctypes._aix as aix
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/_aix.py", line 15, in <module>
    from . import util
  File "/data/prj/python/python-3.6.0.177/Lib/ctypes/util.py", line 102, in <module>
    import ctypes._aix as aix
AttributeError: module 'ctypes' has no attribute '_aix'

This last condition also occurs in Python2
History
Date User Action Args
2016-10-04 20:13:58Michael.Feltsetrecipients: + Michael.Felt, python-dev, martin.panter, David.Edelsohn, aixtools@gmail.com
2016-10-04 20:13:58Michael.Feltsetmessageid: <1475612038.77.0.893838211426.issue26439@psf.upfronthosting.co.za>
2016-10-04 20:13:58Michael.Feltlinkissue26439 messages
2016-10-04 20:13:58Michael.Feltcreate