Bump cherrypy from 18.6.1 to 18.8.0 (#1796)

* Bump cherrypy from 18.6.1 to 18.8.0

Bumps [cherrypy](https://github.com/cherrypy/cherrypy) from 18.6.1 to 18.8.0.
- [Release notes](https://github.com/cherrypy/cherrypy/releases)
- [Changelog](https://github.com/cherrypy/cherrypy/blob/main/CHANGES.rst)
- [Commits](https://github.com/cherrypy/cherrypy/compare/v18.6.1...v18.8.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.8.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>
This commit is contained in:
dependabot[bot] 2022-11-12 17:53:03 -08:00 committed by GitHub
parent e79da07973
commit 76cc56a215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 19150 additions and 1339 deletions

View file

@ -97,7 +97,8 @@ class LogCase(object):
def emptyLog(self):
"""Overwrite self.logfile with 0 bytes."""
open(self.logfile, 'wb').write('')
with open(self.logfile, 'wb') as f:
f.write('')
def markLog(self, key=None):
"""Insert a marker line into the log and set self.lastmarker."""
@ -105,10 +106,11 @@ class LogCase(object):
key = str(time.time())
self.lastmarker = key
open(self.logfile, 'ab+').write(
b'%s%s\n'
% (self.markerPrefix, key.encode('utf-8'))
)
with open(self.logfile, 'ab+') as f:
f.write(
b'%s%s\n'
% (self.markerPrefix, key.encode('utf-8'))
)
def _read_marked_region(self, marker=None):
"""Return lines from self.logfile in the marked region.
@ -122,20 +124,23 @@ class LogCase(object):
logfile = self.logfile
marker = marker or self.lastmarker
if marker is None:
return open(logfile, 'rb').readlines()
with open(logfile, 'rb') as f:
return f.readlines()
if isinstance(marker, str):
marker = marker.encode('utf-8')
data = []
in_region = False
for line in open(logfile, 'rb'):
if in_region:
if line.startswith(self.markerPrefix) and marker not in line:
break
else:
data.append(line)
elif marker in line:
in_region = True
with open(logfile, 'rb') as f:
for line in f:
if in_region:
if (line.startswith(self.markerPrefix)
and marker not in line):
break
else:
data.append(line)
elif marker in line:
in_region = True
return data
def assertInLog(self, line, marker=None):