This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients Michael.Felt, martin.panter
Date 2016-07-29.15:43:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469806997.37.0.474504957387.issue27643@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
History
Date User Action Args
2016-07-29 15:43:17Michael.Feltsetrecipients: + Michael.Felt, martin.panter
2016-07-29 15:43:17Michael.Feltsetmessageid: <1469806997.37.0.474504957387.issue27643@psf.upfronthosting.co.za>
2016-07-29 15:43:17Michael.Feltlinkissue27643 messages
2016-07-29 15:43:16Michael.Feltcreate