DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead

Bug #1987191 reported by Takashi Natsume
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Takashi Natsume
OpenStack Compute (nova)
Fix Released
Undecided
Takashi Natsume

Bug Description

Running "tox -e py310", the following warning appear.

-------------------------------------------------------------------------------------------
{1} nova.tests.unit.virt.hyperv.test_serialproxy.SerialProxyTestCase.test_accept_connection [0.368902s] ... ok

Captured stderr:

~~~~~~~~~~~~~~~~

    /tmp/nova/nova/virt/hyperv/serialproxy.py:49: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead

  self.setDaemon(True)
-------------------------------------------------------------------------------------------

Python 3.8 document says that setDaemon(): Old getter/setter API for daemon; use it directly as a property instead.
Python 3.10 document says that Deprecated since version 3.10.

[1] https://docs.python.org/3.8/library/threading.html#threading.Thread.setDaemon
[2] https://docs.python.org/3.10/library/threading.html#threading.Thread.setDaemon

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/853869

Changed in nova:
status: New → In Progress
Changed in glance:
assignee: nobody → Takashi Natsume (natsume-takashi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/glance/+/853874

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/853869
Committed: https://opendev.org/openstack/nova/commit/18d9c85aa4cbdbc471c6c7916ca6f1367c7ab4e5
Submitter: "Zuul (22348)"
Branch: master

commit 18d9c85aa4cbdbc471c6c7916ca6f1367c7ab4e5
Author: Takashi Natsume <email address hidden>
Date: Sun Aug 21 14:47:14 2022 +0900

    Fix a deprecation warning about threading.Thread

    Fix the following deprecation warning.

    * DeprecationWarning: setDaemon() is deprecated,
      set the daemon attribute instead

    Change-Id: I208bd1bef002ce91e57798f3475bbe64d3b81329
    Closes-Bug: 1987191
    Signed-off-by: Takashi Natsume <email address hidden>

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/854653

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/c/openstack/glance/+/853874
Committed: https://opendev.org/openstack/glance/commit/1b08481491624dbaa90b59c34b2c29d47f006346
Submitter: "Zuul (22348)"
Branch: master

commit 1b08481491624dbaa90b59c34b2c29d47f006346
Author: Takashi Natsume <email address hidden>
Date: Sun Aug 21 21:07:52 2022 +0900

    Fix a deprecation warning about threading.Thread

    Fix the following deprecation warning.

    * DeprecationWarning: setDaemon() is deprecated,
      set the daemon attribute instead

    Change-Id: I7af41eddf597e1ac78e8835a5af2e029d65a302a
    Closes-Bug: 1987191
    Signed-off-by: Takashi Natsume <email address hidden>

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 25.0.0.0b3

This issue was fixed in the openstack/glance 25.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 26.0.0.0rc1

This issue was fixed in the openstack/nova 26.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/854653
Committed: https://opendev.org/openstack/nova/commit/628e1c152cc7c5e89d5261fc6f25ec72ac24c1df
Submitter: "Zuul (22348)"
Branch: master

commit 628e1c152cc7c5e89d5261fc6f25ec72ac24c1df
Author: Takashi Natsume <email address hidden>
Date: Fri Aug 26 00:53:00 2022 +0900

    Add a hacking rule for the setDaemon method

    Add the following hacking rule.

    * N372: Don't use the setDaemon method.
            Use the daemon attribute instead.

    Change-Id: Idb45421205f76d2d3b0576bd0504d261ed249edd
    Related-Bug: 1987191
    Signed-off-by: Takashi Natsume <email address hidden>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.