Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #221 (closed defect: worksforme)

Opened 14 years ago

Last modified 12 years ago

CherryPy locks .kid files on Windows

Reported by: eoghanmurray@… Owned by: anonymous
Priority: normal Milestone: 1.0
Component: CherryPy Version:
Severity: minor Keywords:
Cc: eoghanmurray@…


It seems that in order to save a Kid template on windows CherryPy? must be stopped, the file saved and CherryPy? reloaded. The error I get is that the file is being used by another process... is there a workaround for this, or is it something that needs to be fixed? From the screencast,this doesn't seem to be a problem on the Mac.

Change History

comment:1 Changed 14 years ago by eoghanmurray@…

  • Severity changed from major to minor

This is happening intermittently, may be hard to reproduce

comment:2 Changed 14 years ago by SuperJared <jared.kuolt@…>

This is especially odd considering that CherryPy? should use the compiled version (pyc). Turning off autoreload might help.

comment:3 Changed 14 years ago by eoghanmurray@…

Work Around:

The following is an example of what the cherrypy console looks like when it is blocking saving: - - [2005/12/18 18:05:55] "GET /tickets HTTP/1.1" 500 2963
2005/12/18 18:05:59 HTTP INFO - GET / HTTP/1.1
2005/12/18 18:05:59  INFO Traceback (most recent call last):
  File "c:\python24\lib\site-packages\CherryPy-2.1.0-py2.4.egg\cherrypy\_cphttptools.py", line 271, in run
  File "c:\python24\lib\site-packages\CherryPy-2.1.0-py2.4.egg\cherrypy\_cphttptools.py", line 497, in main
    page_handler, object_path, virtual_path = mapPathToObject(path)
  File "c:\python24\lib\site-packages\CherryPy-2.1.0-py2.4.egg\cherrypy\_cphttptools.py", line 748, in mapPathToObject
    raise cherrypy.NotFound(path)
NotFound: 404: The path '/' was not found. - - [2005/12/18 18:05:59] "GET / HTTP/1.1" 404 1269

Then when I save my controllers.py (even though there are no changes) cherrypy adds the following:

2005/12/18 18:09:04 HTTP INFO SystemExit raised: shutting down autoreloader
2005/12/18 18:09:04 HTTP INFO HTTP Server shut down
2005/12/18 18:09:04 HTTP INFO CherryPy shut down
2005/12/18 18:09:07 CONFIG INFO Server parameters:
2005/12/18 18:09:07 CONFIG INFO   server.environment: development
2005/12/18 18:09:07 CONFIG INFO   server.logToScreen: True
2005/12/18 18:09:07 CONFIG INFO   server.logFile:
2005/12/18 18:09:07 CONFIG INFO   server.protocolVersion: HTTP/1.0
2005/12/18 18:09:07 CONFIG INFO   server.socketHost:
2005/12/18 18:09:07 CONFIG INFO   server.socketPort: 8080
2005/12/18 18:09:07 CONFIG INFO   server.socketFile:
2005/12/18 18:09:07 CONFIG INFO   server.reverseDNS: False
2005/12/18 18:09:07 CONFIG INFO   server.socketQueueSize: 5
2005/12/18 18:09:07 CONFIG INFO   server.threadPool: 0
2005/12/18 18:09:08 HTTP INFO Serving HTTP on http://localhost:8080/

Now I can save my kid file without restarting cherrypy... is this to do with the autoreloader?

comment:4 Changed 14 years ago by anonymous

  • Severity changed from minor to critical

This is a very annoying bug for people using TG to develop web applications. So changed severity to critical.

comment:5 Changed 14 years ago by Jorge Godoy <jgodoy@…>

This doesn't happen on Linux. And from the devcasts, it doesn't seem to happen on Mac as well.

comment:6 Changed 14 years ago by eoghanmurray@…

I was using MS Visual Studio 2005 to edit the KID file (to my shame), I've since changed to another text editor, and haven't encountered this bug in a good while. If anyone is trying to reproduce it, VS might be a good place to start.

comment:7 Changed 13 years ago by oefe

  • Component changed from CherryPy to Kid
  • Severity changed from critical to minor

Reduced severity back to minor. It may be annoying, but that's all. This is not critical by any means. If it happens, all you need is stop the server, save the file, and restart the server. And it seems only to happen with Visual Studio, which isn't very suitable for editing python code anyway.

comment:8 Changed 13 years ago by dado1945@…

Yes, it is windows only problem. Here is situation how to reproduce similar bug easy.

  1. Open kid template with your editor (I did it with gvim).
  2. Run cherrypy.
  3. Open link in browser which uses kid template you have opened. It will make cherrypy open kid template and I guess not close it (with expectation that sooner or later python garbage collection system will close this file). In Unix-like system it is not problem because we are reading file while in Windows even reading locks file.
  4. Add modifications to your file and try to save. Bang! VIM complains that file is read-only. Since I'm using VIM it is minor problem. I just force writing with !. However with Visual Studio (or Notepad I guess) system should crash on step 3 because file is locked.

comment:9 Changed 13 years ago by anonymous

  • Component changed from Kid to CherryPy
  • Summary changed from CherryPy server must be stopped to save Kid template to CherryPy locks .kid files on Windows

Changed Title and component to reflect dado's recreation of bug

comment:10 Changed 13 years ago by godoy

This looks like a Windows bug to me... There was some discussion on TG mailing list recently and it was pointed out as some design of the OS relative to locking of files. I don't believe there's anything to do on our part.

comment:11 Changed 13 years ago by dalius.dobravolskas@…

It seems you have fixed it accidentaly :) I can't reproduce it in SVN version (0.9a4). Could somebody else confirm that?

comment:12 Changed 13 years ago by mikl

Although I primarily use Linux, I've played a lot with TG on a windows laptop I've borrowed from a friend, and I haven't experienced this at all with the 0.9 series.

comment:13 Changed 13 years ago by jorge.vargas

  • Milestone set to 1.0

comment:14 Changed 13 years ago by jorge.vargas

  • Cc eoghanmurray@… added

comment:15 Changed 13 years ago by max

  • Status changed from new to closed
  • Resolution set to worksforme

I develop on Windows and I don't have any problems editing Kid files while CherryPy? is running.

Note: See TracTickets for help on using tickets.