Skip to content

Conversation

@hbq1
Copy link
Contributor

@hbq1 hbq1 commented Feb 8, 2021

When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it.

https://bugs.python.org/issue43176

Automerge-Triggered-By: GH:ericvsmith

@hbq1 hbq1 requested a review from ericvsmith as a code owner February 8, 2021 21:38
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@hbq1

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@ericvsmith
Copy link
Member

Please add an issue at bugs.python.org, and reference it here. See https://devguide.python.org/pullrequest/#quick-guide

@hbq1 hbq1 changed the title Fix processing of empty dataclasses bpo-43176: Fix processing of empty dataclasses Feb 9, 2021
@hbq1
Copy link
Contributor Author

hbq1 commented Feb 9, 2021

I created a bug and referenced it here, thanks for the link to the guide! (this is my first PR in cpython)

Test failures do not seem to be related to the added changes (test_ssl and test_asyncio failed). Please let me know if I'm wrong.

Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable

@github-actions
Copy link

github-actions bot commented Apr 3, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Apr 3, 2021
Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@miss-islington miss-islington merged commit 376ffc6 into python:master Apr 6, 2021
@miss-islington
Copy link
Contributor

Thanks @hbq1 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 6, 2021
When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it. Automerge-Triggered-By: GH:ericvsmith (cherry picked from commit 376ffc6) Co-authored-by: Iurii Kemaev <6885137+hbq1@users.noreply.github.com>
@bedevere-bot
Copy link

GH-25205 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 6, 2021
When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it. Automerge-Triggered-By: GH:ericvsmith (cherry picked from commit 376ffc6) Co-authored-by: Iurii Kemaev <6885137+hbq1@users.noreply.github.com>
@bedevere-bot
Copy link

GH-25206 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Apr 6, 2021
When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it. Automerge-Triggered-By: GH:ericvsmith (cherry picked from commit 376ffc6) Co-authored-by: Iurii Kemaev <6885137+hbq1@users.noreply.github.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 RHEL7 LTO 3.x has failed when building commit 376ffc6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/507/builds/945) and take a look at the build logs.
  4. Check if the failure is related to this commit (376ffc6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/507/builds/945

Failed tests:

  • test_asyncio

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 9, done.  remote: Counting objects: 11% (1/9)  remote: Counting objects: 22% (2/9)  remote: Counting objects: 33% (3/9)  remote: Counting objects: 44% (4/9)  remote: Counting objects: 55% (5/9)  remote: Counting objects: 66% (6/9)  remote: Counting objects: 77% (7/9)  remote: Counting objects: 88% (8/9)  remote: Counting objects: 100% (9/9)  remote: Counting objects: 100% (9/9), done.  remote: Compressing objects: 20% (1/5)  remote: Compressing objects: 40% (2/5)  remote: Compressing objects: 60% (3/5)  remote: Compressing objects: 80% (4/5)  remote: Compressing objects: 100% (5/5)  remote: Compressing objects: 100% (5/5), done.  remote: Total 11 (delta 4), reused 4 (delta 4), pack-reused 2  From https://github.com/python/cpython * branch master -> FETCH_HEAD Reset branch 'master' Python/ceval.c: In function ‘PyEval_EvalCodeEx’: Python/ceval.c:5187:19: warning: ‘newargs’ may be used uninitialized in this function [-Wmaybe-uninitialized] PyMem_Free(newargs); ^ /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import log /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Modules/socketmodule.c: In function ‘sock_connect’: /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Modules/socketmodule.c:3209:18: warning: ‘addrlen’ may be used uninitialized in this function [-Wmaybe-uninitialized] res = connect(s->sock_fd, addr, addrlen); ^ /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Modules/socketmodule.c:3274:9: note: ‘addrlen’ was declared here int addrlen; ^ /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Modules/socketmodule.c: In function ‘sock_bind’: /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Modules/socketmodule.c:3116:15: warning: ‘addrlen’ may be used uninitialized in this function [-Wmaybe-uninitialized] res = bind(s->sock_fd, SAS2SA(&addrbuf), addrlen); ^ /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import log /home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import log test_kqueue skipped -- test works only on BSD test_ossaudiodev skipped -- [Errno 2] No such file or directory: '/dev/dsp' test_badargs (__main__.GeneralTest) ... ok test_bound_methods (__main__.GeneralTest) ... ok test_clear (__main__.GeneralTest) ... ok test_exit (__main__.GeneralTest) ... ok test_order (__main__.GeneralTest) ... ok test_raise (__main__.GeneralTest) ... ok test_raise_unnormalized (__main__.GeneralTest) ... ok test_stress (__main__.GeneralTest) ... ok test_unregister (__main__.GeneralTest) ... ok ---------------------------------------------------------------------- Ran 9 tests in 0.001s OK test_devpoll skipped -- test works only on Solaris OS family test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_startfile skipped -- object <module 'os' from '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/os.py'> has no attribute 'startfile' test_winsound skipped -- No module named 'winsound' test_winconsoleio skipped -- test only relevant on win32 test_tix skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...] test_msilib skipped -- No module named '_msi' test_gdb skipped -- Couldn't find gdb on the path test_tk skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...] test_ttk_guionly skipped -- Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...] test_ioctl skipped -- Unable to open /dev/tty test_winreg skipped -- No module named 'winreg' test_flock (__main__.FNTLEINTRTest) ... ok test_lockf (__main__.FNTLEINTRTest) ... ok test_read (__main__.OSEINTRTest) ... ok test_wait (__main__.OSEINTRTest) ... ok test_wait3 (__main__.OSEINTRTest) ... ok test_wait4 (__main__.OSEINTRTest) ... ok test_waitpid (__main__.OSEINTRTest) ... ok test_write (__main__.OSEINTRTest) ... ok test_devpoll (__main__.SelectEINTRTest) ... skipped 'need select.devpoll' test_epoll (__main__.SelectEINTRTest) ... ok test_kqueue (__main__.SelectEINTRTest) ... skipped 'need select.kqueue' test_poll (__main__.SelectEINTRTest) ... ok test_select (__main__.SelectEINTRTest) ... ok test_sigtimedwait (__main__.SignalEINTRTest) ... ok test_sigwaitinfo (__main__.SignalEINTRTest) ... ok test_accept (__main__.SocketEINTRTest) ... ok test_open (__main__.SocketEINTRTest) ... ok test_os_open (__main__.SocketEINTRTest) ... ok test_recv (__main__.SocketEINTRTest) ... ok test_recvmsg (__main__.SocketEINTRTest) ... ok test_send (__main__.SocketEINTRTest) ... ok test_sendall (__main__.SocketEINTRTest) ... ok test_sendmsg (__main__.SocketEINTRTest) ... ok test_sleep (__main__.TimeEINTRTest) ... ok ---------------------------------------------------------------------- Ran 24 tests in 7.366s OK (skipped=2) /tmp/tmpoy5uio_k.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.util import byte_compile /tmp/tmpc34j9vd6.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.util import byte_compile Timeout (0:15:00)! Thread 0x00007f7f9055b740 (most recent call first): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/selectors.py", line 469 in select File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 1845 in _run_once File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 595 in run_forever File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 628 in run_until_complete File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/test_asyncio/test_subprocess.py", line 442 in test_cancel_make_subprocess_transport_exec File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 592 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 652 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/runner.py", line 176 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/__init__.py", line 959 in _run_suite File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/__init__.py", line 1082 in run_unittest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 210 in _test_module File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 141 in _runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest_mp.py", line 81 in run_tests_worker File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 661 in _main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 641 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 719 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/regrtest.py", line 43 in _main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/regrtest.py", line 47 in <module> File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/runpy.py", line 86 in _run_code File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/runpy.py", line 196 in _run_module_as_main Timeout (0:15:00)! Thread 0x00007f92c13de740 (most recent call first): File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/selectors.py", line 469 in select File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 1845 in _run_once File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 595 in run_forever File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/asyncio/base_events.py", line 628 in run_until_complete File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/test_asyncio/test_subprocess.py", line 442 in test_cancel_make_subprocess_transport_exec File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 549 in _callTestMethod File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 592 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/case.py", line 652 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 122 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/suite.py", line 84 in __call__ File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/unittest/runner.py", line 176 in run File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/__init__.py", line 959 in _run_suite File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/support/__init__.py", line 1082 in run_unittest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 210 in _test_module File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 246 in _runtest_inner2 File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 282 in _runtest_inner File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 154 in _runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/runtest.py", line 194 in runtest File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 321 in rerun_failed_tests File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 698 in _main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 641 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/libregrtest/main.py", line 719 in main File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/test/__main__.py", line 2 in <module> File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/runpy.py", line 86 in _run_code File "/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/Lib/runpy.py", line 196 in _run_module_as_main make: *** [buildbottest] Error 1 Cannot open file '/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64.lto/build/test-results.xml' for upload
ericvsmith pushed a commit that referenced this pull request Apr 6, 2021
When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it. Automerge-Triggered-By: GH:ericvsmith (cherry picked from commit 376ffc6) Co-authored-by: Iurii Kemaev <6885137+hbq1@users.noreply.github.com> Co-authored-by: Iurii Kemaev <6885137+hbq1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PR or inactive for long period of time.

6 participants