Commits

Jason R. Coombs committed 0a3d19c Merge

Merge 3.2.3

Comments (0)

Files changed (8)

 80d84626b74687f961cf828ccd216405e66ebeba cherrypy-3.2.2
 80d84626b74687f961cf828ccd216405e66ebeba cherrypy-3.2.2
 81c92cbcf2302f83efa739970a35ec48733b177c cherrypy-3.2.2
+c9d13db2b4331474b768b3ed156ddae5030e7f2c 3.2.3

cherrypy/__init__.py

 https://bitbucket.org/cherrypy/cherrypy/wiki/CherryPySpec
 """
 
-__version__ = "3.2.2"
+__version__ = "3.2.3"
 
 from cherrypy._cpcompat import urljoin as _urljoin, urlencode as _urlencode
 from cherrypy._cpcompat import basestring, unicodestr, set

cherrypy/_cpcompat_subprocess.py

 import signal
 import errno
 
+try:
+    set
+except NameError:
+    from sets import Set as set
+
 # Exception classes used by this module.
 class CalledProcessError(Exception):
     """This exception is raised when a process run by check_call() or
            "check_output", "CalledProcessError"]
 
 if mswindows:
-    from _subprocess import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
-                             STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
-                             STD_ERROR_HANDLE, SW_HIDE,
-                             STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW)
+    from _subprocess import CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP, \
+                             STD_INPUT_HANDLE, STD_OUTPUT_HANDLE, \
+                             STD_ERROR_HANDLE, SW_HIDE, \
+                             STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW
 
     __all__.extend(["CREATE_NEW_CONSOLE", "CREATE_NEW_PROCESS_GROUP",
                     "STD_INPUT_HANDLE", "STD_OUTPUT_HANDLE",
     while True:
         try:
             return func(*args)
-        except (OSError, IOError) as e:
+        except (OSError, IOError), e:
             if e.errno == errno.EINTR:
                 continue
             raise
                 if input:
                     try:
                         self.stdin.write(input)
-                    except IOError as e:
+                    except IOError, e:
                         if e.errno != errno.EPIPE and e.errno != errno.EINVAL:
                             raise
                 self.stdin.close()
 
             # Start the process
             try:
-                hp, ht, pid, tid = _subprocess.CreateProcess(executable, args,
+                try:
+                    hp, ht, pid, tid = _subprocess.CreateProcess(executable, args,
                                          # no special security
                                          None, None,
                                          int(not close_fds),
                                          env,
                                          cwd,
                                          startupinfo)
-            except pywintypes.error, e:
-                # Translate pywintypes.error to WindowsError, which is
-                # a subclass of OSError.  FIXME: We should really
-                # translate errno using _sys_errlist (or similar), but
-                # how can this be done from Python?
-                raise WindowsError(*e.args)
+                except pywintypes.error, e:
+                    # Translate pywintypes.error to WindowsError, which is
+                    # a subclass of OSError.  FIXME: We should really
+                    # translate errno using _sys_errlist (or similar), but
+                    # how can this be done from Python?
+                    raise WindowsError(*e.args)
             finally:
                 # Child is launched. Close the parent's copy of those pipe
                 # handles that only the child should have open.  You need
                 if input is not None:
                     try:
                         self.stdin.write(input)
-                    except IOError as e:
+                    except IOError, e:
                         if e.errno != errno.EPIPE:
                             raise
                 self.stdin.close()
 
                             # Close pipe fds.  Make sure we don't close the
                             # same fd more than once, or standard fds.
-                            closed = { None }
+                            closed = set([None])
                             for fd in [p2cread, c2pwrite, errwrite]:
                                 if fd not in closed and fd > 2:
                                     os.close(fd)
             if data != "":
                 try:
                     _eintr_retry_call(os.waitpid, self.pid, 0)
-                except OSError as e:
+                except OSError, e:
                     if e.errno != errno.ECHILD:
                         raise
                 child_exception = pickle.loads(data)
             if self.returncode is None:
                 try:
                     pid, sts = _eintr_retry_call(os.waitpid, self.pid, 0)
-                except OSError as e:
+                except OSError, e:
                     if e.errno != errno.ECHILD:
                         raise
                     # This happens if SIGCLD is set to be ignored or waiting
                         chunk = input[input_offset : input_offset + _PIPE_BUF]
                         try:
                             input_offset += os.write(fd, chunk)
-                        except OSError as e:
+                        except OSError, e:
                             if e.errno == errno.EPIPE:
                                 close_unregister_and_remove(fd)
                             else:
                     chunk = input[input_offset : input_offset + _PIPE_BUF]
                     try:
                         bytes_written = os.write(self.stdin.fileno(), chunk)
-                    except OSError as e:
+                    except OSError, e:
                         if e.errno == errno.EPIPE:
                             self.stdin.close()
                             write_set.remove(self.stdin)

cherrypy/test/helper.py

             time.sleep(1)
 
     def get_pid(self):
+        if self.daemonize:
+            return int(open(self.pid_file, 'rb').read())
         return self._proc.pid
 
     def join(self):
         """Wait for the process to exit."""
+        if self.daemonize:
+            return self._join_daemon()
         self._proc.wait()
+
+    def _join_daemon(self):
+        try:
+            try:
+                # Mac, UNIX
+                os.wait()
+            except AttributeError:
+                # Windows
+                try:
+                    pid = self.get_pid()
+                except IOError:
+                    # Assume the subprocess deleted the pidfile on shutdown.
+                    pass
+                else:
+                    os.waitpid(pid, 0)
+        except OSError:
+            x = sys.exc_info()[1]
+            if x.args != (10, 'No child processes'):
+                raise

cherrypy/wsgiserver/wsgiserver2.py

     timeout = 10
     """The timeout in seconds for accepted connections (default 10)."""
 
-    version = "CherryPy/3.2.2"
+    version = "CherryPy/3.2.3"
     """A version string for the HTTPServer."""
 
     software = None

cherrypy/wsgiserver/wsgiserver3.py

     timeout = 10
     """The timeout in seconds for accepted connections (default 10)."""
 
-    version = "CherryPy/3.2.2"
+    version = "CherryPy/3.2.3"
     """A version string for the HTTPServer."""
 
     software = None
 import platform
 import shutil
 
-VERSION='3.2.2'
+VERSION='3.2.3'
 
 def get_next_version():
 	digits = map(int, VERSION.split('.'))
 # arguments for the setup command
 ###############################################################################
 name = "CherryPy"
-version = "3.2.2"
+version = "3.2.3"
 desc = "Object-Oriented HTTP framework"
 long_desc = "CherryPy is a pythonic, object-oriented HTTP framework"
 classifiers=[
     "cherrypy.scaffold",
     "cherrypy.wsgiserver",
 ]
-download_url="http://download.cherrypy.org/cherrypy/3.2.2/"
+download_url="http://download.cherrypy.org/cherrypy/3.2.3/"
 data_files=[
     ('cherrypy', ['cherrypy/cherryd',
                   'cherrypy/favicon.ico',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.