summaryrefslogtreecommitdiff
path: root/cherrypy/lib
Commit message (Collapse)AuthorAgeFilesLines
* 🐛Replace use of deprecated ConfigParser.readfpSviatoslav Sydorenko2023-01-091-1/+1
|
* Revert "🔧 Stop using the `cgi` stdlib module"Sviatoslav Sydorenko2023-01-091-7/+2
| | | | This reverts commit 6b7c2cdc91ca5ba1f6cf3e5d9e8e386266c64ce6.
* 🔧 Stop using the `cgi` stdlib moduleSviatoslav Sydorenko2023-01-051-2/+7
| | | | This module is deprecated since Python 3.11.
* 🎨 Upgrade pydocstyle to the recent versionSviatoslav Sydorenko2023-01-051-5/+7
|
* 🎨 Adjust line length in code across the repoSviatoslav Sydorenko2023-01-052-6/+10
| | | | This patch makes it shorter to fit the 79 char limit.
* Introduce SanitizedHost wrapper. Fixes #1974.Jason R. Coombs2022-07-171-0/+30
|
* Use context managers to close files properly and fix tests on PyPyMichał Górny2022-02-014-21/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use context managers (`with`) to ensure that all open files are closed correctly. This resolves resource leaks and test failures with PyPy3.7. The code prior to this change used four approaches for closing files: 1. Using a context manager (`with` clause). 2. Using a try/finally clause. 3. Closing the file in the same scope (unreliable: file object can leak on exception). 4. Not closing open files at all. The last point is a real problem for PyPy since it does not GC unreachable objects as aggressively as CPython does. While leaving a function scope on CPython causes the file objects private to it to be destroyed (and therefore closed), in PyPy they can stay dangling for some time. When combines with buffered writes, this means that writes can still remain pending after returning from function. Using a context manager is a simple, consistent way to ensure that the file object is closed once it is no longer needed. In turn, this guarantees that all pending writes will be performed upon function return and the code won't be hiting race conditions between writing a file and reading it afterwards.
* Close streamed file in file_generator on destructDuncan Bellamy2021-01-171-0/+5
|
* Fix compression level in meta header in gzip toolbugfixes/1849-gzip-compression-header-cpython-bug39389Sviatoslav Sydorenko2020-11-151-2/+22
| | | | | | | | | | * https://bugs.python.org/issue39389 * https://github.com/python/cpython/pull/18077 * https://github.com/python/cpython/pull/18100 * https://github.com/python/cpython/pull/18101 Fixes #1849
* Reflow the comment in _make_content_dispositionSviatoslav Sydorenko2020-04-171-6/+6
| | | | This fixes the lines exceeding 79 chars limit
* Fix typos in all NFKC referencesSviatoslav Sydorenko2020-04-171-3/+3
|
* Move normalization algorithm description from docstring to code comments.Jan Rieger2020-04-171-8/+7
|
* Change normalization algorithm to `NKFC` and add docstring for this solutionJan Rieger2020-04-171-1/+9
|
* Use normal string literals instead of u-prefixed onesSviatoslav Sydorenko2020-04-171-2/+2
|
* Add condition to prevent pass `filename*` when it's equal with original ↵Jan Rieger2020-04-171-2/+3
| | | | `filename`
* Rename `_utf8_content_disposition` to `_make_content_disposition`Sviatoslav Sydorenko2020-04-171-3/+3
|
* Improve the docstring of `_utf8_content_disposition`Sviatoslav Sydorenko2020-04-171-3/+4
|
* Use :rfc: sphinx role in docstringsSviatoslav Sydorenko2020-04-171-2/+2
|
* Fix serving files with diacritics in name under their original nameJan Rieger2020-04-171-8/+26
| | | | | | | | | | | | This implements adding extra ``filename*`` parameter in Content-disposition header when serving content with non-ASCII filenames. As per RFC 6266 recommendations in the Appendix D. Refs: * https://stackoverflow.com/a/8996249/2173868 * https://tools.ietf.org/html/rfc6266#appendix-D Fixes #1776
* Revert "Fix serving files with diacritics in name under their original name"Jan Rieger2020-04-171-26/+8
| | | | This reverts commit 1741fd9adf70800fd692c24b0d85f5caad6a44e5.
* Fix serving files with diacritics in name under their original nameJan Rieger2020-04-171-8/+26
| | | | | | | | | | | | This implements adding extra ``filename*`` parameter in Content-disposition header when serving content with non-ASCII filenames. As per RFC 6266 recommendations in the Appendix D. Refs: * https://stackoverflow.com/a/8996249/2173868 * https://tools.ietf.org/html/rfc6266#appendix-D Fixes #1776
* Merge branch 'master' into bugfix/1827-headermap-keytypeJason R. Coombs2019-11-271-62/+3
|\
| * Revert "For now inline the implementation until it can be linked. Ref #1673."Jason R. Coombs2019-11-261-62/+3
| | | | | | | | This reverts commit 3bcefda0a5e397e12a6122fd8004cbbbce6a2b15.
* | Reference the underlying issue.Jason R. Coombs2019-11-271-1/+1
| |
* | Avoid converting bytes in header keys to strings. Fixes #1827.Jason R. Coombs2019-11-261-5/+6
|/
* Merge pull request #1715 from sanitec/cherrypyJason R. Coombs2019-11-031-3/+3
|\
| * Ensure 'Response Status' is text and data/ is bytes. Ref #1715.Jason R. Coombs2019-11-031-2/+3
| |
| * Inline the getattr operationJason R. Coombs2019-11-031-10/+2
| |
| * cpstats: make 'Response Status' serializableStian Fosterud2018-06-181-3/+10
| | | | | | | | | | | | | | | | Fixes an issue where it wasn't possible to fetch /cpstats/data when running the cpstats tool with Python3. Could potentially also solve the problem by supplying a default function for 'json.dumps', but this solution seems cleaner.
* | Fix session tools indents @ cherrypy.lib.cptoolsJared2019-11-031-1/+1
| |
* | Fix a few minor documentation warningsJay2019-11-031-11/+10
| | | | | | | | | | | | | | | | Sphinx warnings fixed: * docs/advanced.rst:571: WARNING: Inline interpreted text or phrase reference start-string without end-string. * docs/advanced.rst:573: WARNING: Definition list ends without a blank line; unexpected unindent. * docs/basics.rst:4: WARNING: Duplicate explicit target name: "memcached".
* | Merge branch 'master' into bugfix/1779Jason R. Coombs2019-09-033-4/+3
|\ \
| * | Use atomic dict copy to avoid changed while iterSviatoslav Sydorenko2019-08-183-4/+3
| | | | | | | | | | | | | | | | | | Resolves #1805 Fixes #1803 Closes #1804
* | | Remove unused importSuhaib Khan2019-07-031-1/+0
| | | | | | | | | | | | Signed-off-by: Suhaib Khan <suheb.work@gmail.com>
* | | Do not remove session lock filesSuhaib Khan2019-07-031-2/+0
|/ / | | | | | | Signed-off-by: Suhaib Khan <suheb.work@gmail.com>
* | Raise correct exception. Fixes linter warnings.v18.1.0Jason R. Coombs2018-12-091-4/+4
| |
* | Adjust reprconf to match Python 3.8 changesSviatoslav Sydorenko2018-09-301-0/+2
| |
* | Wipe out legacy unrepr builder targeting Python 2Sviatoslav Sydorenko2018-09-301-124/+5
| |
* | Avoid hard-coded address in memcache sessionsJason R. Coombs2018-09-091-1/+1
| |
* | Don't convert bytes headers to strSviatoslav Sydorenko2018-09-051-1/+1
|\ \ | | | | | | PR #1736 by @tobiashenkel
| * | Don't convert bytes headers to strTobias Henkel2018-09-041-1/+1
| | | | | | | | | | | | | | | Don't convert bytes header values using str() as str(b'foo') becomes "b'foo'". Instead just leave bytes as is like it was prior to v18.0.0.
* | | Remove references to threading._* in Python 3.2 and earlier.Jason R. Coombs2018-09-041-3/+2
| | |
* | | Use urllib.parseJason R. Coombs2018-09-041-1/+1
| | |
* | | Move json from _cpcompat to its own module.Jason R. Coombs2018-09-042-4/+5
|/ /
* | Remove more references to six in doctestJason R. Coombs2018-09-021-5/+5
| |
* | Remove reliance on contextlib2Jason R. Coombs2018-09-021-3/+2
| |
* | Remove reliance on sixJason R. Coombs2018-09-0211-53/+31
| |
* | Consolidate prepare_iter behaviorJason R. Coombs2018-08-191-13/+24
| |
* | Consolidate header item encoding.Jason R. Coombs2018-08-191-14/+11
| |
* | Reorder operationsJason R. Coombs2018-08-191-3/+3
| |