Indeed I wrote the patch to allow raising a meaningful error if the module
is not loaded. The action taken should be the same as before the patch
i.e.:
return super(_Web2pyImporter, self).__call__(name, globals, locals,
fromlist, level)
but the error from the call is raised instead of resulting in a stack trace
ending in custom_import.py. Even with this exception stack trace can be
misleading sometimes.
I also experienced invisibility of modules.
What I found is that creating an instance by doing:
python web2py.py -S my_new_app
works. While doing things by copying or hand sometimes make the modules
directory content not importable...
I would be interesting to know if it is just OSX or any that has problems.
mic
Il giorno venerdì 17 agosto 2012 01:19:30 UTC+2, Massimo Di Pierro ha
scritto:
>
> Can you help us test this. If anything caused it, could be changeset:
>
> 3324:ef7523559742
>
> --- a/gluon/custom_import.py Wed Jun 06 11:37:28 2012 -0500
> +++ b/gluon/custom_import.py Thu Aug 16 18:18:23 2012 -0500
> @@ -287,14 +287,14 @@
> return super(_Web2pyImporter, self) \
> .__call__(modules_prefix+"."+name,
> globals, locals, fromlist, level)
> - except ImportError:
> - pass
> + except ImportError, e:
> + try:
> + return super(_Web2pyImporter,
> self).__call__(name, globals, locals,
> + fromlist, level)
> + except ImportError, e1:
> + raise e
> return super(_Web2pyImporter, self).__call__(name, globals,
> locals,
> fromlist, level)
> - #except Exception, e:
> - # raise e # Don't hide something that went wrong
> - #finally:
> - self.end()
>
>
> If you revert it, does the problem go away?
>
> massimo
>
>
>
>
>
>
> On Thursday, 16 August 2012 15:52:54 UTC-5, Matt wrote:
>>
>>
>>
>> On Thursday, August 16, 2012 12:24:34 AM UTC-4, Matt wrote:
>>>
>>> On Wed, Aug 15, 2012 at 10:03 PM, Anthony <[email protected]> wrote:
>>> >> Is there any way around this? This seems to have broken only with the
>>> >> upgrade to Mountain Lion. We develop this app primarily on (and for)
>>> linux,
>>> >> however I do most of my development on my laptop, so it's quite
>>> inconvenient
>>> >> to have to use a separate install just on this computer. Do you have
>>> any
>>> >> idea where to look in order to solve this problem? I am very willing
>>> (and
>>> >> motivated!) to help fix this problem.
>>> >
>>> >
>>> > What are you trying to work around? If you want to use the Python
>>> installed
>>> > on your system along with any modules you may have installed with it,
>>> then
>>> > just run the source version of web2py -- it works fine on OS X and is
>>> just
>>> > as easy to install (just download and unzip). What do you mean by "a
>>> > separate install just on this computer" -- you'll need web2py
>>> installed on
>>> > any computer on which you want to use it?
>>> >
>>>
>>> I might be experiencing a different problem here. I'm currently having
>>> a problem where I can no longer import modules from the "modules"
>>> directory in my application on osx. I've updated to the latest 1.99.7
>>> to no avail, and am currently trying to work through why it's no
>>> longer loading properly (this worked just fine in 1.99.4, but as I
>>> said I also upgraded to Mountain Lion this past weekend).
>>>
>>> I fixed this problem by just using local_import. I was under the
>> impression this method was deprecated and I should just be able to use
>> "import" directly. Hope this helps someone
>>
>>
>>> > Anthony
>>> >
>>> > --
>>> >
>>> >
>>> >
>>>
>>
--