Massimo,

With your web2py_win_check.zip version, placed in a path containing
spaces I get:


C:\Users\Brian\Documents\development\web2py\web2py win check
\web2py>web2py.exe
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.74.8 (2010-01-30 19:00:11)
Database drivers available: SQLite3, MySQL
Starting cron...
WARNING:root:WEB2PY CRON Call returned code 1:
The system cannot find the file specified.

WARNING:root:WEB2PY CRON Call returned code 1:
The system cannot find the file specified.

WARNING:root:WEB2PY CRON Call returned code 1:
The system cannot find the file specified.

WARNING:root:WEB2PY CRON Call returned code 1:
The system cannot find the file specified.

Yes the WARNING is actually repeated twice.

This particular symptom seems to be with the windows binary version of
web2py - I can run the source version from a path containing spaces
and I do not get this error message. With the source version cron
seems to run, well other than the previously mentioned problem with
@reboot lines being run on every "crondance".

I'm trying to pick my way through the cron.py code to see if I can
find the issue with @reboot. I suspect the problems with the windows
binary are due to the way py2exe works.

~Brian


On Jan 30, 7:16 pm, mdipierro <[email protected]> wrote:
> Can you please try this?
>
> http://web2py.com/examples/static/web2py_win_check.zip
>
> try with cron, @reboot and with web2py in a path that contains spaces
> (the main issue).
>
> On Jan 30, 5:39 pm, Brian M <[email protected]> wrote:
>
>
>
> > Well on my Win7 setup with source distribution of web2py I can confirm
> > that @reboot cron lines do not run when I start up web2py. The same
> > cron line with a normal time declaration does run just fine.
>
> > #...@reboot does not run
> > @reboot *       *       *       *       root *reboot/on_reboot
> > #But with normal time syntax runs just fine
> > 0-59/5 *        *       *       *       root *reboot/on_reboot
>
> > As far as spaces in file path names affecting things, I'd need more
> > specific information about what is in people's crontab files. When I
> > was trying to test @reboot I purposely stuck web2py in a path that
> > contained spaces and didn't seem to have any problems. Normally within
> > python scripts I use os.path.join() to build up my file paths so that
> > I don't have to worry about the slashes - os.path.join('C:\',
> > 'Documents and Settings', 'Username', 'My Documents', 'folder', 'sub
> > folder', 'file.txt') works just fine.
>
> > Also in my crontab, I could execute a non-web2py python script with
>
> > 0-59/2  *       *       *       *       root python 
> > "C:\Users\Brian\Documents\some project
> > \scripts\some_script.py" >> cron.log
>
> > On Windows you do need to add the python executable to your path if
> > you don't want to always have to type C:\Python26\python.exe script.py
> > - for some reason the windows python installer doesn't do it
> > automatically. If you don't know already, here's how...
>
> > Win7:
> > Right click on "My Computer" and choose "Properties"
> > On the left side click the "Advanced System Settings" link.
> > Go to the "Advanced" tab
> > Click on the "Environment Variables" button at the bottom.
> > In the "System Variables" section (the bottom one), scroll down to
> > "Path" and click once to highlight.  (If you want it only for your
> > use, add it to the user variables. You'll need to add a new "Path"
> > variable)
> > Click the "Edit..." button.
> > In the "Variable value" field, add ";C:\Python26\" on to the end -
> > without the quotes, the semi-colon is the separator between the
> > multiple entries. (If you're using Python 2.5 then use C:\Python25)
> > Click "OK" three times to get rid of all the windows.
>
> > WinXP:
> > Right click on "My Computer" and choose "Properties"
> > Go to the "Advanced" tab.
> > Follow the rest of the instructions above.
> > Same as above
>
> > ~Brian
>
> > On Jan 30, 4:55 pm, mdipierro <[email protected]> wrote:
>
> > > I replace the Popen(command) with Popen(list_of_args) and this
> > > (according to some) should fix the escaping problem. Needs testing.
>
> > > Massimo
>
> > > On Jan 30, 4:50 pm, Jonathan Lundell <[email protected]> wrote:
>
> > > > On Jan 30, 2010, at 1:40 PM, mdipierro wrote:
>
> > > > > The problem is when paths contain spaces.
>
> > > > > I thought even in windows in this case one should esacpe spaces with
> > > > > '\ ' and use either \\ ('\\\\' in python) or / ('/') to separate
> > > > > folders. For example:
>
> > > > > 'C:/windows/Documents\ and\ Settings/'
>
> > > > > or
>
> > > > > 'C:\\windows\\Documents\ and\ Settings\\'
>
> > > > > Am I wrong?
>
> > > > I think so, but I'm no expert on the subject.
>
> > > > Consider that if 'c:\\abc' makes Windows see 'c:\abc', then escaping 
> > > > the space isn't going to have any effect.
>
> > > > You can quote a command on the command line, so possibly something like:
>
> > > > '"C:\\windows\\Documents and Settings\\"'
>
> > > > might work. Forward slashes are permitted in system calls, but IIRC not 
> > > > on the command line, where (at least back in the DOS days) they denoted 
> > > > command options (equivalent to - in Unix). I'd expect cron entries to 
> > > > be more like command-line or batch-file content.
>
> > > > But as I say, I'm no expert.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to