Hi Nick,

When I restart dev_server and reportlab/lib/utils.pyc is present I get
the following error page for ANY request I make. Also for the requests
that do not use the reportlab module.
http://localhost:8080/xxxxx/1/results/ just serves a regular HTML response.

----------------------------------------
Request Method:         GET
Request URL:    http://localhost:8080/xxxxx/1/results/
Exception Type:         ViewDoesNotExist
Exception Value:        Tried results in module xxxxx.views. Error was:
'HardenedModulesHook' object has no attribute '_files'
Exception Location:
        google_appengine\lib\django\django\core\urlresolvers.py in
_get_callback, line 129
----------------------------------------
Stack trace from the error page:

google_appengine\lib\django\django\core\urlresolvers.py in resolve
118  return self.callback, args, kwargs

# it finds a match for the url pattern
# now it needs self.callback,  a property constructed with a decorator

google_appengine\lib\django\django\core\urlresolvers.py in _get_callback
129  raise ViewDoesNotExist, "Tried %s in module %s. Error was: %s" %
(func_name, mod_name, str(e))

# see above for a print of this exception
# the line that generates this exception is
# 125 self._callback = getattr(__import__(mod_name, {}, {}, ['']), func_name)
# with
# func_name = 'results'
# mod_name = 'xxxxx.views'
# this func exists in the given module, it works when starting without
reportlab/lib/utils.pyc
----------------------------------------

If I just remove the file reportlab/lib/utils.pyc prior to starting
dev_server the application works.

If I remove the line
from reportlab.pdfgen import canvas
from the views.py file I can stop and restart dev_server, and the
application works, appart from the PDF generation.

2009/9/28 Nick Johnson (Google) <[email protected]>:
> Hi djidjadji,
> Does anything actually not function correctly when doing this? The warning
> message that it is ignoring the .pyc file is just that - a warning message.
> -Nick Johnson
>
> On Mon, Sep 28, 2009 at 11:51 AM, djidjadji <[email protected]> wrote:
>>
>> I have a small Django application where I use the reportlab PDF python
>> module.
>>
>> When I start dev_appserver when there are no .pyc files in the
>> application directories the reportlab module gets loaded fine and
>> PDF's are served on request.
>>
>> When I shut the server down and restart, there are a few .pyc files in
>> the reportlab module, it complains that it ignores
>>
>> Blocking access to skipped file "appname/src/reportlab/lib/utils.pyc"
>>
>> =============
>> ==== from an earlier mail that did not got to the python-group
>>
>> I want to use the reportlab-pdf python library in a Django 0.9.6 on GAE
>> with
>> http://google-app-engine-django.googlecode.com/
>>
>> To get the error I do the following steps:
>>
>> I copy the reportlab package in the GAE application.
>> I delete all the pyc files
>> I start the server:  python manage.py runserver
>> I use the browser to load  http://localhost:8080/testpdf/
>> I get a Save As dialog for a pdf file that is correct.
>> Shutdown the dev-server
>> Start the server again (now there are some pyc files in the reportlab
>> package)
>> I use the browser to load  http://localhost:8080/testpdf/
>> I get a 500-error page and the following warning in the devserver console
>>
>> Blocking access to skipped file "appname/src/reportlab/lib/utils.pyc"
>>
>> I have added a few more logging statements and a few files before it
>> tries to load utils.pyc it also tries utils.py.
>>
>> 2009/9/28 Nick Johnson (Google) <[email protected]>:
>> > On Mon, Sep 28, 2009 at 11:11 AM, djidjadji <[email protected]> wrote:
>>
>> >> Is it possible to let dev_appserver delete all the .pyc files at
>> >> startup that are in the application directory tree?
>> >
>> > It would be possible - but to what end? The dev_appserver already
>> > ignores
>> > them, and appcfg doesn't upload them.
>> > -Nick Johnson
>> >
>> >>
>> >> 2009/9/28 Nick Johnson (Google) <[email protected]>:
>> >> > Hi Allen,
>> >> > No, you must use .py files to serve your app. The dev_appserver is
>> >> > designed
>> >> > to replicate the production environment, and the production
>> >> > environment
>> >> > ignores .pyc files.
> --
> Nick Johnson, Developer Programs Engineer, App Engine
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to