Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1913374 - sudo fails to build with Python 3.10: test failures
Summary: sudo fails to build with Python 3.10: test failures
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zoltan Fridrich
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-01-06 15:34 UTC by Tomáš Hrnčiar
Modified: 2021-02-11 10:45 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-11 10:45:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-01-06 15:34:03 UTC
sudo fails to build with Python 3.10.0a4.

Expectation failed at ./regress/check_python_examples.c:510:
  actual is <<(TypeError) expected 1 argument, got 0
>>: data.stderr_str
  expected to be <<>>: ""
FAILED: testcase check_example_group_plugin_is_able_to_debug() at ./regress/check_python_examples.c:1533

The output of the plugin:

The error output of the plugin:
(TypeError) expected 1 argument, got 0
Running test check_plugin_unload() ... 
Running test check_loading_fails_with_missing_path() ... 
Running test check_loading_succeeds_with_missing_classname() ... 
Running test check_loading_fails_with_missing_classname() ... 
Running test check_loading_fails_with_wrong_classname() ... 
Running test check_loading_fails_with_wrong_path() ... 
Running test check_loading_fails_plugin_is_not_owned_by_root() ... 
Running test check_plugin_unload() ... 
Running test check_example_conversation_plugin_reason_log(false, "without_suspend") ... 
Expectation failed at ./regress/check_python_examples.c:656:
  actual is <<-1>>: python_io->open((((1) << 16) | (16)), conversation, fake_printf, data.settings, data.user_info, data.command_info, data.plugin_argc, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_conversation_plugin_reason_log(false, "without_suspend") at ./regress/check_python_examples.c:1544

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_conversation.py", line 36, in open
    sudo.log_info("Please provide your reason "


The error output of the plugin:
(TypeError) tuple.__new__(X): X is not a type object (str)
Running test check_example_conversation_plugin_reason_log(true, "with_suspend") ... 
Expectation failed at ./regress/check_python_examples.c:656:
  actual is <<-1>>: python_io->open((((1) << 16) | (16)), conversation, fake_printf, data.settings, data.user_info, data.command_info, data.plugin_argc, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_conversation_plugin_reason_log(true, "with_suspend") at ./regress/check_python_examples.c:1545

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_conversation.py", line 36, in open
    sudo.log_info("Please provide your reason "


The error output of the plugin:
(TypeError) tuple.__new__(X): X is not a type object (str)
Running test check_example_conversation_plugin_user_interrupts() ... 
Expectation failed at ./regress/check_python_examples.c:682:
  actual is <<-1>>: python_io->open((((1) << 16) | (16)), fake_conversation, fake_printf, data.settings, data.user_info, data.command_info, data.plugin_argc, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<0>>: SUDO_RC_REJECT
FAILED: testcase check_example_conversation_plugin_user_interrupts() at ./regress/check_python_examples.c:1546

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_conversation.py", line 36, in open
    sudo.log_info("Please provide your reason "


The error output of the plugin:
(TypeError) tuple.__new__(X): X is not a type object (str)
Running test check_plugin_unload() ... 
Running test check_example_policy_plugin_version_display(true) ... 
Running test check_example_policy_plugin_version_display(false) ... 
Running test check_example_policy_plugin_accepted_execution() ... 
Running test check_example_policy_plugin_failed_execution() ... 
Running test check_example_policy_plugin_denied_execution() ... 
Running test check_example_policy_plugin_list() ... 
Running test check_example_policy_plugin_validate_invalidate() ... 
Running test check_policy_plugin_callbacks_are_optional() ... 
Running test check_policy_plugin_reports_error() ... 
Running test check_plugin_unload() ... 
Running test check_example_audit_plugin_receives_accept() ... 
Running test check_example_audit_plugin_receives_reject() ... 
Running test check_example_audit_plugin_receives_error() ... 
Running test check_example_audit_plugin_workflow_multiple() ... 
Running test check_example_audit_plugin_version_display() ... 
Running test check_audit_plugin_callbacks_are_optional() ... 
Running test check_audit_plugin_reports_error() ... 
Running test check_plugin_unload() ... 
Running test check_example_approval_plugin( "2020-02-10T07:55:23", "That is not allowed outside the business hours!") ... 
Expectation failed at ./regress/check_python_examples.c:1356:
  actual is <<-1>>: python_approval->open((((1) << 16) | (16)), fake_conversation, fake_printf, data.settings, data.user_info, 0, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_approval_plugin( "2020-02-10T07:55:23", "That is not allowed outside the business hours!") at ./regress/check_python_examples.c:1570

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_approval_plugin.py", line 3, in <module>
    from datetime import datetime
  File "/usr/lib64/python3.10/datetime.py", line 757, in <module>
    timedelta.min = timedelta(-999999999)
  File "/usr/lib64/python3.10/datetime.py", line 536, in __new__
    microseconds = round(microseconds + usdouble)


The error output of the plugin:
Failed during loading plugin class: (TypeError) float.__new__(): not enough arguments
Running test check_example_approval_plugin("2020-02-10T08:05:23", NULL) ... 
Expectation failed at ./regress/check_python_examples.c:1356:
  actual is <<-1>>: python_approval->open((((1) << 16) | (16)), fake_conversation, fake_printf, data.settings, data.user_info, 0, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_approval_plugin("2020-02-10T08:05:23", NULL) at ./regress/check_python_examples.c:1573

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_approval_plugin.py", line 3, in <module>
    from datetime import datetime
  File "/usr/lib64/python3.10/datetime.py", line 757, in <module>
    timedelta.min = timedelta(-999999999)
  File "/usr/lib64/python3.10/datetime.py", line 536, in __new__
    microseconds = round(microseconds + usdouble)


The error output of the plugin:
Failed during loading plugin class: (TypeError) float.__new__(): not enough arguments
Running test check_example_approval_plugin("2020-02-14T17:59:23", NULL) ... 
Expectation failed at ./regress/check_python_examples.c:1356:
  actual is <<-1>>: python_approval->open((((1) << 16) | (16)), fake_conversation, fake_printf, data.settings, data.user_info, 0, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_approval_plugin("2020-02-14T17:59:23", NULL) at ./regress/check_python_examples.c:1575

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_approval_plugin.py", line 3, in <module>
    from datetime import datetime
  File "/usr/lib64/python3.10/datetime.py", line 757, in <module>
    timedelta.min = timedelta(-999999999)
  File "/usr/lib64/python3.10/datetime.py", line 536, in __new__
    microseconds = round(microseconds + usdouble)


The error output of the plugin:
Failed during loading plugin class: (TypeError) float.__new__(): not enough arguments
Running test check_example_approval_plugin( "2020-02-10T18:05:23", "That is not allowed outside the business hours!") ... 
Expectation failed at ./regress/check_python_examples.c:1356:
  actual is <<-1>>: python_approval->open((((1) << 16) | (16)), fake_conversation, fake_printf, data.settings, data.user_info, 0, data.plugin_argv, data.user_env, data.plugin_options, &errstr)
  expected to be <<1>>: SUDO_RC_OK
FAILED: testcase check_example_approval_plugin( "2020-02-10T18:05:23", "That is not allowed outside the business hours!") at ./regress/check_python_examples.c:1577

The output of the plugin:
Traceback:
  File "/builddir/build/BUILD/sudo-1.9.3p1/plugins/python/example_approval_plugin.py", line 3, in <module>
    from datetime import datetime
  File "/usr/lib64/python3.10/datetime.py", line 757, in <module>
    timedelta.min = timedelta(-999999999)
  File "/usr/lib64/python3.10/datetime.py", line 536, in __new__
    microseconds = round(microseconds + usdouble)


ThFatal Python error: compiler_make_closure: lookup '__class__' in ApprovalTestPlugin 5 -1
freevars of __init__: ('__class__',)

Python runtime state: initialized

Thread 0x00007faef00ff740 (most recent call first):
  File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 897 in source_to_code
  File "<frozen importlib._bootstrap_external>", line 967 in get_code
  File "<frozen importlib._bootstrap_external>", line 829 in exec_module
  File "<frozen importlib._bootstrap>", line 698 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1005 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1026 in _find_and_load
/bin/sh: line 2: 40032 Aborted                 (core dumped) ./check_python_examples ".libs/python_plugin.so"
make[1]: *** [Makefile:222: check] Error 134
make[1]: Leaving directory '/builddir/build/BUILD/sudo-1.9.3p1/plugins/python'
make: *** [Makefile:114: check] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.xoDZKw (%check)
    Bad exit status from /var/tmp/rpm-tmp.xoDZKw (%check)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01862796-sudo/

For all our attempts to build sudo with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/sudo/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Cotton 2021-02-09 15:37:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Tomáš Hrnčiar 2021-02-11 10:45:30 UTC
This bug is not present anymore with 5th alpha of Python 3.10.

https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/sudo/


Note You need to log in before you can comment on or make changes to this bug.