Bump cherrypy from 18.8.0 to 18.9.0 (#2266)

* Bump cherrypy from 18.8.0 to 18.9.0

Bumps [cherrypy](https://github.com/cherrypy/cherrypy) from 18.8.0 to 18.9.0.
- [Changelog](https://github.com/cherrypy/cherrypy/blob/main/CHANGES.rst)
- [Commits](https://github.com/cherrypy/cherrypy/compare/v18.8.0...v18.9.0)

---
updated-dependencies:
- dependency-name: cherrypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Update cherrypy==18.9.0

---------

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-03-24 15:25:44 -07:00 committed by GitHub
commit faef9a94c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
673 changed files with 159850 additions and 11583 deletions

View file

@ -11,18 +11,18 @@
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import os
import errno
import logging
import os
logger = logging.getLogger("zc.lockfile")
__metaclass__ = type
class LockError(Exception):
"""Couldn't get a lock
"""
try:
import fcntl
except ImportError:
@ -31,6 +31,7 @@ except ImportError:
except ImportError:
def _lock_file(file):
raise TypeError('No file-locking support on this platform')
def _unlock_file(file):
raise TypeError('No file-locking support on this platform')
@ -40,14 +41,14 @@ except ImportError:
# Lock just the first byte
try:
msvcrt.locking(file.fileno(), msvcrt.LK_NBLCK, 1)
except IOError:
except OSError:
raise LockError("Couldn't lock %r" % file.name)
def _unlock_file(file):
try:
file.seek(0)
msvcrt.locking(file.fileno(), msvcrt.LK_UNLCK, 1)
except IOError:
except OSError:
raise LockError("Couldn't unlock %r" % file.name)
else:
@ -57,14 +58,16 @@ else:
def _lock_file(file):
try:
fcntl.flock(file.fileno(), _flags)
except IOError:
except OSError:
raise LockError("Couldn't lock %r" % file.name)
def _unlock_file(file):
fcntl.flock(file.fileno(), fcntl.LOCK_UN)
class LazyHostName:
"""Avoid importing socket and calling gethostname() unnecessarily"""
def __str__(self):
import socket
return socket.gethostname()
@ -79,7 +82,7 @@ class SimpleLockFile:
try:
# Try to open for writing without truncation:
fp = open(path, 'r+')
except IOError:
except OSError:
# If the file doesn't exist, we'll get an IO error, try a+
# Note that there may be a race here. Multiple processes
# could fail on the r+ open and open the file a+, but only
@ -89,7 +92,7 @@ class SimpleLockFile:
try:
_lock_file(fp)
self._fp = fp
except:
except BaseException:
fp.close()
raise
@ -114,7 +117,7 @@ class LockFile(SimpleLockFile):
def __init__(self, path, content_template='{pid}'):
self._content_template = content_template
super(LockFile, self).__init__(path)
super().__init__(path)
def _on_lock(self):
content = self._content_template.format(