Michael Felt added the comment:

> I presume this also affects Python 3.

I presume this as well - however, harder to verify...

michael@x071:[/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test]../../../python
 test_bitfield.py
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Failed to import the site module
Traceback (most recent call last):
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 571, in <module>
    main()
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 557, in main
    known_paths = addusersitepackages(known_paths)
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 281, in addusersitepackages
    user_site = getusersitepackages()
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 257, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File 
"/data/prj/aixtools/python/python-3.6.0.162/Lib/ctypes/test/../../../Lib/site.py",
 line 247, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 587, 
in get_config_var
    return get_config_vars().get(name)
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 536, 
in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/data/prj/aixtools/python/python-3.6.0.162/Lib/sysconfig.py", line 408, 
in _init_posix
    from _sysconfigdata import build_time_vars
ImportError: No module named '_sysconfigdata'

I guess I will have to install it, rather than only work from a test directory.

> The test seems to be comparing ctypes and native C bit-field structures, 
> c_int and c_short versus native int and short. ... int always means signed 
> int.

I believe int means signed on AIX as well - as the comment from the compiler is 
that type "unsigned" is assumed for a bitfield.

Note: the single line of code is:
  +382      short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;

And from your comments I am wondering if the fix is 'simple' - to:

  +382      unsigned short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;


I can at least try that.

Looking at Python-3.6.0.0a2:

the line concerned is identical - so that is the verification (for now) that it 
is also in Python3

----------

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

Reply via email to