Bump cheroot from 10.0.0 to 10.0.1 (#2310)

* Bump cheroot from 10.0.0 to 10.0.1

Bumps [cheroot](https://github.com/cherrypy/cheroot) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/cherrypy/cheroot/releases)
- [Changelog](https://github.com/cherrypy/cheroot/blob/main/CHANGES.rst)
- [Commits](https://github.com/cherrypy/cheroot/compare/v10.0.0...v10.0.1)

---
updated-dependencies:
- dependency-name: cheroot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update cheroot==10.0.1

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2024-05-09 22:27:04 -07:00 committed by GitHub
parent bcac5b7897
commit 6414a0ba12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 534 additions and 128 deletions

View file

@ -157,7 +157,7 @@ QUOTED_SLASH = b'%2F'
QUOTED_SLASH_REGEX = re.compile(b''.join((b'(?i)', QUOTED_SLASH)))
_STOPPING_FOR_INTERRUPT = object() # sentinel used during shutdown
_STOPPING_FOR_INTERRUPT = Exception() # sentinel used during shutdown
comma_separated_headers = [
@ -209,7 +209,11 @@ class HeaderReader:
if not line.endswith(CRLF):
raise ValueError('HTTP requires CRLF terminators')
if line[0] in (SPACE, TAB):
if line[:1] in (SPACE, TAB):
# NOTE: `type(line[0]) is int` and `type(line[:1]) is bytes`.
# NOTE: The former causes a the following warning:
# NOTE: `BytesWarning('Comparison between bytes and int')`
# NOTE: The latter is equivalent and does not.
# It's a continuation line.
v = line.strip()
else:
@ -1725,16 +1729,16 @@ class HTTPServer:
"""Run the server forever, and stop it cleanly on exit."""
try:
self.start()
except (KeyboardInterrupt, IOError):
# The time.sleep call might raise
# "IOError: [Errno 4] Interrupted function call" on KBInt.
self.error_log('Keyboard Interrupt: shutting down')
self.stop()
raise
except SystemExit:
self.error_log('SystemExit raised: shutting down')
self.stop()
raise
except KeyboardInterrupt as kb_intr_exc:
underlying_interrupt = self.interrupt
if not underlying_interrupt:
self.interrupt = kb_intr_exc
raise kb_intr_exc from underlying_interrupt
except SystemExit as sys_exit_exc:
underlying_interrupt = self.interrupt
if not underlying_interrupt:
self.interrupt = sys_exit_exc
raise sys_exit_exc from underlying_interrupt
def prepare(self): # noqa: C901 # FIXME
"""Prepare server to serving requests.
@ -2111,6 +2115,13 @@ class HTTPServer:
has completed.
"""
self._interrupt = _STOPPING_FOR_INTERRUPT
if isinstance(interrupt, KeyboardInterrupt):
self.error_log('Keyboard Interrupt: shutting down')
if isinstance(interrupt, SystemExit):
self.error_log('SystemExit raised: shutting down')
self.stop()
self._interrupt = interrupt