How does this cause problems for you?

Note, because starting the shell or scheduler involves calling web2py.py in 
the /web2py folder, the Python working directory will be /web2py, so 
request.folder will be relative to the /web2py folder from the perspective 
of the Python interpreter. If you need the absolute path, you can always 
use os.path.abspath(request.folder).

That having been said, I'm not sure why exec_environment and env in 
gluon.shell do not set request.folder to the absolute path based on 
gluon.settings.global_settings.gluon_parent (which itself comes from the 
Python working directory unless there is a "web2py_path" environment 
variable).

Anthony

On Tuesday, March 21, 2017 at 5:45:12 AM UTC-4, Oliver Holmes wrote:
>
> Yes, this behavior just annoyed the hell out of me too. When referenced in 
> the application itself request.folder behaves as documented here: 
> http://web2py.com/books/default/chapter/29/04/the-core#request ( (i.e. 
> full absolute path). But as soon as it is used in a module called as 
> scheduled task (parameter -K) or as a background task as noted here in this 
> thread it will give only the relative path to the app starting with 
> "application" i.e. "application/MyApp". I consider this to be a bug and 
> would very much appreciate a fix.
>
> Sincerely,
> Oliver Holmes
>
>
>
> Am Mittwoch, 4. Dezember 2013 11:39:57 UTC+1 schrieb Marin Pranjić:
>>
>> With trunk (and 2.8.2) I don't get absolute path.
>>
>> request.folder is "applications/appname"
>> Shouldn't it be absolute instead of relative?
>>
>>
>> Marin
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to