Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use context managers to close files properly and fix tests on PyPy | Michał Górny | 2022-02-01 | 1 | -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-Foster | 2021-06-07 | 1 | -5/+5 |
| | |||||
* | Fix incorrect copying of module names @ autoreload | Sviatoslav Sydorenko | 2018-09-30 | 1 | -1/+4 |
| | |||||
* | Copy modules before iteration in autoreloader | Sviatoslav Sydorenko | 2018-09-28 | 1 | -1/+1 |
| | | | | Fixes #1744 | ||||
* | Remove references to threading._* in Python 3.2 and earlier. | Jason R. Coombs | 2018-09-04 | 1 | -2/+2 |
| | |||||
* | Remove reliance on six | Jason R. Coombs | 2018-09-02 | 1 | -2/+1 |
| | |||||
* | Don't attempt to make None absolute. Fixes #1697. | Jason R. Coombs | 2018-05-28 | 1 | -1/+1 |
| | |||||
* | Extract module to file mapping as _file_for_module classmethod. | Jason R. Coombs | 2018-05-28 | 1 | -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. Coombs | 2018-05-28 | 1 | -3/+4 |
| | |||||
* | Fix property setters | Sviatoslav Sydorenko | 2018-05-26 | 1 | -3/+3 |
| | |||||
* | Upgrade @property decorator syntax | Sviatoslav Sydorenko | 2018-05-26 | 1 | -16/+16 |
| | |||||
* | Rewrite generation of file list for tracking | Sviatoslav Sydorenko | 2017-12-23 | 1 | -11/+14 |
| | | | | Fixes #1675 | ||||
* | Single quotes | Jason R. Coombs | 2017-11-10 | 1 | -1/+1 |
| | |||||
* | Prefer loops to copy paste | Jason R. Coombs | 2017-11-10 | 1 | -22/+13 |
| | |||||
* | Harmonize technique | Jason R. Coombs | 2017-11-10 | 1 | -6/+4 |
| | |||||
* | Consolidate error message rendering | Jason R. Coombs | 2017-11-10 | 1 | -8/+8 |
| | |||||
* | Extract static method for daemonization for testing #1659. | Jason R. Coombs | 2017-11-10 | 1 | -8/+15 |
| | |||||
* | Feed the hobgoblins (delint). | Jason R. Coombs | 2017-10-27 | 1 | -2/+3 |
| | |||||
* | Spelling fixes | Ville Skyttä | 2017-07-10 | 1 | -1/+1 |
| | |||||
* | Use six to resolve _thread module | Jason R. Coombs | 2017-07-09 | 1 | -3/+5 |
| | |||||
* | PEP8fy codebase: eliminated E303 flake8 error | Sviatoslav Sydorenko | 2017-03-11 | 1 | -2/+0 |
| | |||||
* | PEP8fy codebase: eliminated E129 flake8 error | Sviatoslav Sydorenko | 2017-03-11 | 1 | -5/+4 |
| | |||||
* | Don't chdir when running as a daemon | Sviatoslav Sydorenko | 2017-01-11 | 1 | -1/+0 |
| | | | | Fixes #1546 | ||||
* | Convert all strings to conform single-quoted style | Sviatoslav Sydorenko | 2016-09-08 | 1 | -34/+34 |
| | | | | pre-commit run double-quote-string-fixer --all-files | ||||
* | Fix BackgroundTask initializer's super() call | Sviatoslav Sydorenko | 2016-09-08 | 1 | -1/+1 |
| | |||||
* | Remove Py<2.6 compat Thread.daemon crutches | Sviatoslav Sydorenko | 2016-09-08 | 1 | -5/+5 |
| | |||||
* | Use the preferred name text_or_bytes to avoid conflation with 'basestring' ↵ | Jason R. Coombs | 2016-07-24 | 1 | -4/+4 |
| | | | | which has no equivalent on Python 3. | ||||
* | Add additional validation to determine if the process is running as a daemon ↵ | Joel Rivera | 2016-03-10 | 1 | -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 builtins | Jason R. Coombs | 2015-12-19 | 1 | -2/+2 |
| | |||||
* | Merge with cherrypy-3.2.x (3.2.5) | Jason R. Coombs | 2014-02-23 | 1 | -1/+1 |
|\ | |||||
| * | Iterate over copy of sys.modules.items() to avoid RuntimeError in ↵ | Jason R. Coombs | 2014-02-18 | 1 | -1/+1 |
| | | | | | | | | | | | | | | AutoReloader. Fixes #1280. --HG-- branch : cherrypy-3.2.x | ||||
* | | More PEP8 work. | Gustavo Picon | 2014-01-12 | 1 | -14/+24 |
| | | |||||
* | | Running: autopep8 -vvvvv -i `find . -name '*.py'` | Gustavo Picon | 2014-01-12 | 1 | -13/+30 |
| | | | | | | | | | | --HG-- branch : autopep8 | ||||
* | | Add an ending new line to the pid file of the PIDFile plugin, | Joel Rivera | 2013-09-11 | 1 | -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 Rivera | 2013-03-19 | 1 | -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. Coombs | 2012-12-12 | 1 | -5/+1 |
| | | |||||
* | | Merge with 3.2.x | Jason R. Coombs | 2012-12-12 | 1 | -5/+5 |
|\ \ | |/ | |||||
| * | Fix syntax for Python 2.3 | Jason R. Coombs | 2012-12-12 | 1 | -2/+1 |
| | | | | | | | | | | --HG-- branch : cherrypy-3.2.x | ||||
| * | Extract Thread.daemon property compatibility into _cpcompat. Now ↵ | Jason R. Coombs | 2012-12-12 | 1 | -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 python2 | Rene Peinthor | 2012-12-12 | 1 | -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 anymore | Rene Peinthor | 2012-12-11 | 1 | -4/+5 |
| | | | | | | | | | | | | | | So BackgroundTask would always use the current threads daemon mode on py3.3 --HG-- branch : cherrypy-3.2.x | ||||
* | | Fixes for python2 | Rene Peinthor | 2012-12-12 | 1 | -1/+4 |
| | | | | | | | | Tested on python 2.3 and python 2.6 | ||||
* | | Python3.3 doesn't use setdaemon for initializing the daemon var anymore | Rene Peinthor | 2012-12-11 | 1 | -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 Beelby | 2012-11-21 | 1 | -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. Coombs | 2012-11-07 | 1 | -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. Coombs | 2012-10-07 | 1 | -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 Picon | 2012-04-03 | 1 | -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 Brewer | 2011-07-04 | 1 | -5/+7 |
| | |||||
* | Bye bye, py2/3. | Robert Brewer | 2011-07-02 | 1 | -0/+681 |
| | |||||
* | Bringing python3 back into trunk with its own py3 folder; what was in trunk ↵trunk | Robert Brewer | 2011-02-25 | 1 | -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. |