I know I can work around a lot of issues. I just thought it might interest 
anyone, that the documentation is at least incomplete. Plus after a recent 
update of my system (not my source code, just the libs and debian itself), 
relative paths did not work (for os.path.exists at least). Otherwise I 
would  have noticed it much sooner. An update a few days later fixed that 
again, but by then I had changed my code to add the missing pieces. I 
should have tried os.path.abspath in that situation, but it slipped my 
mind. Don't know which package had the flaw, or if it was some part of the 
OS, that got broken and subsequently fixed again.

If this is not an issue for anyone else, then feel free to ignore the fault.

Cheers,
Oliver Holmes

Am Dienstag, 21. März 2017 16:58:48 UTC+1 schrieb Anthony:
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to