Skip to content

Conversation

@rhettinger
Copy link
Contributor

@rhettinger rhettinger commented Nov 13, 2025

Greg, does this seem like a reasonable fix?

@rhettinger rhettinger requested a review from gpshead November 13, 2025 20:59
@rhettinger rhettinger added type-bug An unexpected behavior, bug, or error stdlib Standard Library Python modules in the Lib/ directory needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Nov 13, 2025
expected = self.func(data)
self.assertEqual(self.func(iter(data)), expected)


Copy link
Member

@picnixz picnixz Nov 13, 2025

Choose a reason for hiding this comment

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

I think this line removal wasn't intended.

rhettinger and others added 6 commits November 14, 2025 13:19
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…XsHHv.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…XsHHv.rst

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@gpshead gpshead enabled auto-merge (squash) November 14, 2025 22:53
@gpshead gpshead merged commit f0a8bc7 into python:main Nov 14, 2025
50 checks passed
@miss-islington-app
Copy link

Thanks @rhettinger for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 14, 2025
…pythonGH-141531)

Raise ValueError for infinite inputs to stdev/pstdev
(cherry picked from commit f0a8bc737ab2f04d4196eee154cb1e17e26ad585)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>

---

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Nov 14, 2025

GH-141575 is a backport of this pull request to the 3.14 branch.

@miss-islington-app
Copy link

Sorry, @rhettinger and @gpshead, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f0a8bc737ab2f04d4196eee154cb1e17e26ad585 3.13

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 14, 2025
gpshead added a commit that referenced this pull request Nov 15, 2025
GH-141531) (#141575)

gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531)

Raise ValueError for infinite inputs to stdev/pstdev
(cherry picked from commit f0a8bc7)



---

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gpshead added a commit to gpshead/cpython that referenced this pull request Nov 15, 2025
…pythonGH-141531)

Raise ValueError for infinite inputs to stdev/pstdev

---

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
(cherry picked from commit f0a8bc7)
@bedevere-app
Copy link

bedevere-app bot commented Nov 15, 2025

GH-141584 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 15, 2025
gpshead added a commit that referenced this pull request Nov 15, 2025
GH-141531) (#141584)

gh-140938: Raise ValueError for infinite inputs to stdev/pstdev (GH-141531)

Raise ValueError for infinite inputs to stdev/pstdev

---

(cherry picked from commit f0a8bc7)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-bot
Copy link

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

Hi! The buildbot ARM64 macOS 3.13 (tier-2) has failed when building commit b693037.

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/#/builders/1404/builds/1404) and take a look at the build logs.
  4. Check if the failure is related to this commit (b693037) 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/#/builders/1404/builds/1404

Failed tests:

  • test_urllib2net

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/__init__.py", line 845, in gc_collect
    gc.collect()
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62595), raddr=('68.183.26.59', 21)>


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=6, family=2, type=1, proto=6, laddr=('192.168.0.101', 62526), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62528), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62528), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62571), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62573), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62573), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62539), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62541), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62541), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/socket_helper.py", line 225, in transient_internet
    captured_errnos = [getattr(errno, name, num)
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62575), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62582), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/socket_helper.py", line 225, in transient_internet
    captured_errnos = [getattr(errno, name, num)
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62582), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62588), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/support/socket_helper.py", line 225, in transient_internet
    captured_errnos = [getattr(errno, name, num)
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62588), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62590), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62590), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62593), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62593), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62584), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=10, family=2, type=1, proto=6, laddr=('192.168.0.101', 62586), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=10, family=2, type=1, proto=6, laddr=('192.168.0.101', 62586), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62546), raddr=('68.183.26.59', 21)>
Timeout (0:20:00)!
Thread 0x00000001f9324800 (most recent call first):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 849 in create_connection
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/ftplib.py", line 354 in ntransfercmd
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 2458 in retrfile
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 1548 in ftp_open
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 466 in _call_chain
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 506 in _open
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 489 in open
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/urllib/request.py", line 189 in urlopen
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 21 in _retry_thrice
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 29 in wrapped
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/test_urllib2net.py", line 373 in test_ftp_timeout
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 606 in _callTestMethod
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 651 in run
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/case.py", line 707 in __call__
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122 in run
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84 in __call__
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 122 in run
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/suite.py", line 84 in __call__
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/unittest/runner.py", line 240 in run
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 57 in _run_suite
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 37 in run_unittest
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 135 in test_func
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 91 in regrtest_runner
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 138 in _load_run_test
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 181 in _runtest_env_changed_exc
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 281 in _runtest
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/single.py", line 310 in run_single_test
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/worker.py", line 84 in worker_process
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/worker.py", line 119 in main
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/test/libregrtest/worker.py", line 123 in <module>
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/runpy.py", line 88 in _run_code
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/runpy.py", line 198 in _run_module_as_main


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62577), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62580), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=9, family=2, type=1, proto=6, laddr=('192.168.0.101', 62580), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('192.168.0.101', 62533), raddr=('68.183.26.59', 21)>
Warning -- Unraisable exception
Exception ignored in: <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62535), raddr=('68.183.26.59', 21)>
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.13.pablogsal-macos-m1.macos-with-brew/build/Lib/socket.py", line 790, in close
    self._sock = None
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.101', 62535), raddr=('68.183.26.59', 21)>
skipped "Resource 'ftp://www.pythontest.net/' is not available"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Standard Library Python modules in the Lib/ directory type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants