Issue #1279 invalid

Error on Windows - AttributeError: 'NoneType' object has no attribute 'write'

christucker_chiltern_networks
created an issue

Windows 7 client Python version 3.3.1 IDLE version 3.3.1 cherrypy version 3.2.4

I copied the example from the cherrypy.org homepage into an IDLE window

import cherrypy
class HelloWorld(object):
    def index(self):
        return "Hello World!"
    index.exposed = True

cherrypy.quickstart(HelloWorld())

When I save and run it, the output is:

[18/Dec/2013:16:15:51] ENGINE Listening for SIGTERM.
[18/Dec/2013:16:15:51] ENGINE Bus STARTING
[18/Dec/2013:16:15:51] ENGINE Error in 'start' listener <cherrypy._cpchecker.Checker object at 0x0000000003E37278>
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\cherrypy\process\wspbus.py", line 197, in publish
    output.append(listener(*args, **kwargs))
  File "C:\Python33\lib\site-packages\cherrypy\_cpchecker.py", line 39, in __call__
    method()
  File "C:\Python33\lib\site-packages\cherrypy\_cpchecker.py", line 101, in check_skipped_app_config
    warnings.warn(msg)
  File "C:\Python33\Lib\idlelib\PyShell.py", line 59, in idle_showwarning
    file.write(warnings.formatwarning(message, category, filename,
AttributeError: 'NoneType' object has no attribute 'write'

[18/Dec/2013:16:15:51] ENGINE Started monitor thread '_TimeoutMonitor'.
[18/Dec/2013:16:15:51] ENGINE Started monitor thread 'Autoreloader'.
[18/Dec/2013:16:15:51] ENGINE Serving on 127.0.0.1:8080
[18/Dec/2013:16:15:51] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\cherrypy\process\wspbus.py", line 235, in start
    self.publish('start')
  File "C:\Python33\lib\site-packages\cherrypy\process\wspbus.py", line 215, in publish
    raise exc
cherrypy.process.wspbus.ChannelFailures: AttributeError("'NoneType' object has no attribute 'write'",)

[18/Dec/2013:16:15:51] ENGINE Bus STOPPING
[18/Dec/2013:16:15:51] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('127.0.0.1', 8080)) shut down
[18/Dec/2013:16:15:51] ENGINE Stopped thread '_TimeoutMonitor'.
[18/Dec/2013:16:15:51] ENGINE Stopped thread 'Autoreloader'.
[18/Dec/2013:16:15:51] ENGINE Bus STOPPED
[18/Dec/2013:16:15:51] ENGINE Bus EXITING
[18/Dec/2013:16:15:51] ENGINE Bus EXITED

If I modify the example to read:

import cherrypy
class HelloWorld(object):
    def index(self):
        return "Hello World!"
    index.exposed = True

cherrypy.config.update({
    'global':{
        'checker.check_skipped_app_config': False,
    })

cherrypy.quickstart(HelloWorld())

then the output is

[18/Dec/2013:16:17:20] ENGINE Listening for SIGTERM.
[18/Dec/2013:16:17:20] ENGINE Bus STARTING
[18/Dec/2013:16:17:20] ENGINE Started monitor thread '_TimeoutMonitor'.
[18/Dec/2013:16:17:20] ENGINE Started monitor thread 'Autoreloader'.
[18/Dec/2013:16:17:21] ENGINE Serving on 127.0.0.1:8080
[18/Dec/2013:16:17:21] ENGINE Bus STARTED

and the web server works as expected.

I have tried some suggestions along the lines I found in https://groups.google.com/forum/#!msg/cherrypy-users/mFHDpo1cWJA/7CQWKNhFwjwJ but made no progress.

Comments (3)

  1. Log in to comment