summaryrefslogtreecommitdiff
path: root/cherrypy/process/plugins.py
Commit message (Collapse)AuthorAgeFilesLines
* Use context managers to close files properly and fix tests on PyPyMichał Górny2022-02-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Don't use deprecated camelCase functions from threading module.Dominic Davis-Foster2021-06-071-5/+5
|
* Fix incorrect copying of module names @ autoreloadSviatoslav Sydorenko2018-09-301-1/+4
|
* Copy modules before iteration in autoreloaderSviatoslav Sydorenko2018-09-281-1/+1
| | | | Fixes #1744
* Remove references to threading._* in Python 3.2 and earlier.Jason R. Coombs2018-09-041-2/+2
|
* Remove reliance on sixJason R. Coombs2018-09-021-2/+1
|
* Don't attempt to make None absolute. Fixes #1697.Jason R. Coombs2018-05-281-1/+1
|
* Extract module to file mapping as _file_for_module classmethod.Jason R. Coombs2018-05-281-19/+32
| | | | Avoids condition where zip check always produces an AttributeError in the failure stack even when irrelevant.
* Use filter instead of if/continue block.Jason R. Coombs2018-05-281-3/+4
|
* Fix property settersSviatoslav Sydorenko2018-05-261-3/+3
|
* Upgrade @property decorator syntaxSviatoslav Sydorenko2018-05-261-16/+16
|
* Rewrite generation of file list for trackingSviatoslav Sydorenko2017-12-231-11/+14
| | | | Fixes #1675
* Single quotesJason R. Coombs2017-11-101-1/+1
|
* Prefer loops to copy pasteJason R. Coombs2017-11-101-22/+13
|
* Harmonize techniqueJason R. Coombs2017-11-101-6/+4
|
* Consolidate error message renderingJason R. Coombs2017-11-101-8/+8
|
* Extract static method for daemonization for testing #1659.Jason R. Coombs2017-11-101-8/+15
|
* Feed the hobgoblins (delint).Jason R. Coombs2017-10-271-2/+3
|
* Spelling fixesVille Skyttä2017-07-101-1/+1
|
* Use six to resolve _thread moduleJason R. Coombs2017-07-091-3/+5
|
* PEP8fy codebase: eliminated E303 flake8 errorSviatoslav Sydorenko2017-03-111-2/+0
|
* PEP8fy codebase: eliminated E129 flake8 errorSviatoslav Sydorenko2017-03-111-5/+4
|
* Don't chdir when running as a daemonSviatoslav Sydorenko2017-01-111-1/+0
| | | | Fixes #1546
* Convert all strings to conform single-quoted styleSviatoslav Sydorenko2016-09-081-34/+34
| | | | pre-commit run double-quote-string-fixer --all-files
* Fix BackgroundTask initializer's super() callSviatoslav Sydorenko2016-09-081-1/+1
|
* Remove Py<2.6 compat Thread.daemon crutchesSviatoslav Sydorenko2016-09-081-5/+5
|
* Use the preferred name text_or_bytes to avoid conflation with 'basestring' ↵Jason R. Coombs2016-07-241-4/+4
| | | | which has no equivalent on Python 3.
* Add additional validation to determine if the process is running as a daemon ↵Joel Rivera2016-03-101-4/+27
| | | | | | on the SignalHandler Plugin, the modification allow us to run the testsuite inside CI tools without leaving hanging the whole testsuite.
* Simply get set from builtinsJason R. Coombs2015-12-191-2/+2
|
* Merge with cherrypy-3.2.x (3.2.5)Jason R. Coombs2014-02-231-1/+1
|\
| * Iterate over copy of sys.modules.items() to avoid RuntimeError in ↵Jason R. Coombs2014-02-181-1/+1
| | | | | | | | | | | | | | AutoReloader. Fixes #1280. --HG-- branch : cherrypy-3.2.x
* | More PEP8 work.Gustavo Picon2014-01-121-14/+24
| |
* | Running: autopep8 -vvvvv -i `find . -name '*.py'`Gustavo Picon2014-01-121-13/+30
| | | | | | | | | | --HG-- branch : autopep8
* | Add an ending new line to the pid file of the PIDFile plugin,Joel Rivera2013-09-111-1/+1
| | | | | | | | | | | | | | this is by convention and some arguments that are discussed here http://stackoverflow.com/q/729692/298371. Closing issue #1116
* | Fix a bunch of links in the documentaton.Joel Rivera2013-03-191-1/+1
| | | | | | | | | | | | | | Some of them has been updated to the new location and others just reformated to rst. Update copyright.
* | Remove changes I would have expected to have been removed in the merge.Jason R. Coombs2012-12-121-5/+1
| |
* | Merge with 3.2.xJason R. Coombs2012-12-121-5/+5
|\ \ | |/
| * Fix syntax for Python 2.3Jason R. Coombs2012-12-121-2/+1
| | | | | | | | | | --HG-- branch : cherrypy-3.2.x
| * Extract Thread.daemon property compatibility into _cpcompat. Now ↵Jason R. Coombs2012-12-121-10/+7
| | | | | | | | | | | | | | BackgroundTask behaves like a Python 2.6+ Thread (w.r.t. the daemon property) even on Python 2.3+. --HG-- branch : cherrypy-3.2.x
| * Fixes for python2Rene Peinthor2012-12-121-1/+4
| | | | | | | | | | | | | | Tested on python 2.3 and python 2.6 --HG-- branch : cherrypy-3.2.x
| * Python3.3 doesn't use setdaemon for initializing the daemon var anymoreRene Peinthor2012-12-111-4/+5
| | | | | | | | | | | | | | So BackgroundTask would always use the current threads daemon mode on py3.3 --HG-- branch : cherrypy-3.2.x
* | Fixes for python2Rene Peinthor2012-12-121-1/+4
| | | | | | | | Tested on python 2.3 and python 2.6
* | Python3.3 doesn't use setdaemon for initializing the daemon var anymoreRene Peinthor2012-12-111-4/+5
| | | | | | | | So BackgroundTask would always use the current threads daemon mode on py3.3
* | Updated doc string in DropPrivileges class to reflect the new URL for the ↵Chris Beelby2012-11-211-1/+1
|/ | | | | | article that was previously linked to. Also updated the example usage of the class to reflect the actual use of the class.
* Override constructor in Perpetual to allow 'bus' parameter to be given.Jason R. Coombs2012-11-071-3/+10
| | | | | | | Check for presence of bus parameter when reporting exceptions in PerpetualTimer. Fixes #1183. --HG-- branch : cherrypy-3.2.x
* Timer class was renamed from _Timer to Timer in Python 3.3. This change adds ↵Jason R. Coombs2012-10-071-2/+2
| | | | | | | a compatibility shim to detect this change and reference the base class accordingly. Fixes #1163. --HG-- branch : cherrypy-3.2.x
* Removed trailing whitespace from the codebase.Gustavo Picon2012-04-031-89/+89
| | | | | | | sed -i '' -e 's/ *$//' `find cherrypy -name '*.py'` --HG-- branch : cherrypy-3.2.x
* Fix for #1070 (BackgroundTask refers to un-set "bus" member)Robert Brewer2011-07-041-5/+7
|
* Bye bye, py2/3.Robert Brewer2011-07-021-0/+681
|
* Bringing python3 back into trunk with its own py3 folder; what was in trunk ↵trunkRobert Brewer2011-02-251-681/+0
| | | | goes in the py2 folder, and we can use a single setup.py to install either, depending on the version of Python that runs setup.py install.