Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-11 Thread Caleb Hattingh
On 11 June 2011 11:42, Pierre Thibault  wrote:

> 2011/6/11 Alessandro Iob 
>
>> Hi Pierre,
>>
>> I'll send a test application to Anthony this weekend.
>>
>> I've experienced the same problem under OS X (with a case-insensitive file
>> system) when I've changed the case from "Castalia" to "castalia":
>> web2py tried to include the controllers from old "Castalia" path and not
>> from the new lowercase version. Obviously I've closed and restarted web2py
>> before changing the application name. I think OS X has a filename cache of
>> some kind.
>>
>> Alessandro
>
>
> OK, cool! I'll be the reference for questions on the code. If needed, you
> may write directly to my personal mail box. I don't follow everything on the
> web2py mailing list because there is too many messages so I may sometimes
> miss something.
>

Ok, I am going to make a strategic exit here.  I think you guys will be able
to solve it, now that we know what to look for, and will have a test case.
 I looked over the code in custom_import and I couldn't find anything wrong
regarding casing.

kind regards
Caleb


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-11 Thread Pierre Thibault
2011/6/11 Alessandro Iob 

> Hi Pierre,
>
> I'll send a test application to Anthony this weekend.
>
> I've experienced the same problem under OS X (with a case-insensitive file
> system) when I've changed the case from "Castalia" to "castalia":
> web2py tried to include the controllers from old "Castalia" path and not
> from the new lowercase version. Obviously I've closed and restarted web2py
> before changing the application name. I think OS X has a filename cache of
> some kind.
>
> Alessandro


OK, cool! I'll be the reference for questions on the code. If needed, you
may write directly to my personal mail box. I don't follow everything on the
web2py mailing list because there is too many messages so I may sometimes
miss something.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-10 Thread Caleb Hattingh
On 11 June 2011 04:55, Pierre Thibault  wrote:
> 2011/6/9 Pierre Thibault 
>>
>> 2011/6/9 
>>>
>>> On , Anthony  wrote:
>>> > Do you have an app to reproduce the problem? I created an app named
>>> > "Castalia" (note the capitalization) with a module
>>> > /modules/selfgroup/castalia/config.py, which I think is the same structure
>>> > and naming as Alessandro's app. In a controller action, I then did:
>>> >
>>> > from selfgroup.castalia import config
>>> >
>>> > and it seems to work fine, though I believe Alessandro was getting an
>>> > import error at that point. But maybe I'm missing something.
>>>
>>> I think we should ask him to make a small test app for us that
>>> demonstrates the problem. Else we're guessing.
>>
>> Alessandro, can you send us the code having the unexpected behavior so the
>> Windows guys can take a look?
>>
>> As I understand, you have to remove the capitalization to make it work
>> because otherwise even if the capitalization match, it does not import
>> properly. Right?
>>
>> --
>
> OK, since we cannot reproduce the bug and we cannot know precisely what the
> bug is, we will consider the issue closed. Do you think there is something
> to add about this issue?

I would agree with that.  Anthony has tested the capitalization issue
directly (it works), and I checked what happens on Windows with
capitalized nested folders and import statements (they work if the
capitalization is matched).   I think we need a reproducible test case
here.


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-10 Thread Pierre Thibault
2011/6/9 Pierre Thibault 

> 2011/6/9 
>
>> On , Anthony  wrote:
>> > Do you have an app to reproduce the problem? I created an app named
>> "Castalia" (note the capitalization) with a module
>> /modules/selfgroup/castalia/config.py, which I think is the same structure
>> and naming as Alessandro's app. In a controller action, I then did:
>> >
>> > from selfgroup.castalia import config
>> >
>> > and it seems to work fine, though I believe Alessandro was getting an
>> import error at that point. But maybe I'm missing something.
>>
>> I think we should ask him to make a small test app for us that
>> demonstrates the problem. Else we're guessing.
>>
>
> Alessandro, can you send us the code having the unexpected behavior so the
> Windows guys can take a look?
>
> As I understand, you have to remove the capitalization to make it work
> because otherwise even if the capitalization match, it does not import
> properly. Right?
>
> --
>

OK, since we cannot reproduce the bug and we cannot know precisely what the
bug is, we will consider the issue closed. Do you think there is something
to add about this issue?


-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Pierre Thibault
2011/6/9 

> On , Anthony  wrote:
> > Do you have an app to reproduce the problem? I created an app named
> "Castalia" (note the capitalization) with a module
> /modules/selfgroup/castalia/config.py, which I think is the same structure
> and naming as Alessandro's app. In a controller action, I then did:
> >
> > from selfgroup.castalia import config
> >
> > and it seems to work fine, though I believe Alessandro was getting an
> import error at that point. But maybe I'm missing something.
>
> I think we should ask him to make a small test app for us that demonstrates
> the problem. Else we're guessing.


Alessandro, can you send us the code having the unexpected behavior so the
Windows guys can take a look?

As I understand, you have to remove the capitalization to make it work
because otherwise even if the capitalization match, it does not import
properly. Right?

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread caleb . hattingh

On , Anthony  wrote:
Do you have an app to reproduce the problem? I created an app  
named "Castalia" (note the capitalization) with a module  
/modules/selfgroup/castalia/config.py, which I think is the same  
structure and naming as Alessandro's app. In a controller action, I then  
did:



from selfgroup.castalia import config


and it seems to work fine, though I believe Alessandro was getting an  
import error at that point. But maybe I'm missing something.


I think we should ask him to make a small test app for us that demonstrates  
the problem. Else we're guessing.


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Anthony
On Thursday, June 9, 2011 10:40:19 AM UTC-4, cjrh wrote: 
>
> On Thursday, 9 June 2011 16:22:10 UTC+2, Anthony wrote: 
>>
>> importer still appears to work. So, as far as I can tell, the importer 
>> works, even without the fix in trunk, though maybe I have misunderstood the 
>> problem.
>>
>
> Yes, it is confusing.  The case-insensitivity works only until a name is 
> repeated in the import chain.  When that occurs, it fails.
>
 
Do you have an app to reproduce the problem? I created an app named 
"Castalia" (note the capitalization) with a module 
/modules/selfgroup/castalia/config.py, which I think is the same structure 
and naming as Alessandro's app. In a controller action, I then did:
 
from selfgroup.castalia import config
 
and it seems to work fine, though I believe Alessandro was getting an import 
error at that point. But maybe I'm missing something.
 
Anthony


[web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Anthony
On Thursday, June 9, 2011 10:29:40 AM UTC-4, Massimo Di Pierro wrote: 
>
> It works for you because of the temporary fix (ignore capitalization). 
> What Pierre and Caleb are saying is that it should NOT work if you get 
> capitalization wrong.

 
No, I'm testing with 1.96.3, which is before the fix. And for me it does 
fail if I get the capitalization wrong. However, it does not fail for me if 
I simply capitalize the name of the application folder (I do not explicitly 
include the application folder in the import statement -- the web2py 
importer handles that, and appears to get it right, at least for me).
 
Anthony


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread cjrh
On Thursday, 9 June 2011 16:22:10 UTC+2, Anthony wrote:
>
> But in a web2py app, you would have something like 
> /applications/Cast/modules/cast.py, and in your code you would just do 
> 'import cast'. My understanding of the problem is that in that case, the new 
> web2py importer tries to import applications.cast.modules.cast instead of 
> applications.Cast.modules.cast, which results in an import error. 
>

Yes, this is a good point.   I shall take a gander at Pierre's 
custom_import.py if I get some time later.  I didn't realise the import path 
chain was being generated by web2py.  That makes it our responsibility to 
fix. 


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread cjrh
On Thursday, 9 June 2011 16:22:10 UTC+2, Anthony wrote:
>
> importer still appears to work. So, as far as I can tell, the importer 
> works, even without the fix in trunk, though maybe I have misunderstood the 
> problem.
>

Yes, it is confusing.  The case-insensitivity works only until a name is 
repeated in the import chain.  When that occurs, it fails.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Massimo Di Pierro
It works for you because of the temporary fix (ignore capitalization).
What Pierre and Caleb are saying is that it should NOT work if you get
capitalization wrong.

On Jun 9, 9:25 am, Anthony  wrote:
> On Thursday, June 9, 2011 10:18:41 AM UTC-4, cjrh wrote:
>
> > On , Massimo Di Pierro  wrote:
> > > So you suggest removing the case insensitive flag that was added in
> > 1.96.4?
>
> > Yes. In Alessandro's specific case, he should use:
>
> > import app.Castalia.blah.blah.castialia
>
> But shouldn't he be able to just do 'import castalia' and have it work
> (again, for me it actually does work on Windows, but assuming it doesn't
> work on some systems, shouldn't it be fixed)?
>
> Anthony


Re: Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread caleb . hattingh

On , Anthony  wrote:

On Thursday, June 9, 2011 10:18:41 AM UTC-4, cjrh wrote:
On , Massimo Di Pierro massim...@gmail.com> wrote:
> So you suggest removing the case insensitive flag that was added in  
1.96.4?



Yes. In Alessandro's specific case, he should use:



import app.Castalia.blah.blah.castialia


But shouldn't he be able to just do 'import castalia' and have it work  
(again, for me it actually does work on Windows, but assuming it doesn't  
work on some systems, shouldn't it be fixed)?


The issue seems to appear only when there is a repeated name in the chain.  
Could you test that too? My attachment has such a test-case ready to run.  
It seems that when a name is not repeated, the case-insensitive name  
matching works. This smells like a bug in Python, and probably needs to be  
fixed there.


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Anthony
On Thursday, June 9, 2011 10:18:41 AM UTC-4, cjrh wrote: 
>
> On , Massimo Di Pierro  wrote:
> > So you suggest removing the case insensitive flag that was added in 
> 1.96.4?
>
> Yes. In Alessandro's specific case, he should use:
>
> import app.Castalia.blah.blah.castialia

 
But shouldn't he be able to just do 'import castalia' and have it work 
(again, for me it actually does work on Windows, but assuming it doesn't 
work on some systems, shouldn't it be fixed)?
 
Anthony


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread cjrh

On Thursday, 9 June 2011 16:03:01 UTC+2, cjrh wrote:
>
> In my opinion, we should just document that the cast must match.  Note that 
> this issue has *nothing to do with web2py*, and as a Windows user, I am 
> not too surprised by this behaviour anyway.
>

...should just document that the *case *must match. 

(Sorry for any confusion)


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Anthony
But in a web2py app, you would have something like 
/applications/Cast/modules/cast.py, and in your code you would just do 
'import cast'. My understanding of the problem is that in that case, the new 
web2py importer tries to import applications.cast.modules.cast instead of 
applications.Cast.modules.cast, which results in an import error. In fact, I 
cannot actually reproduce that problem (Windows 7, Python 2.7, web2py 
1.96.3) -- if I capitalize the name of the application folder, the web2py 
importer still appears to work. So, as far as I can tell, the importer 
works, even without the fix in trunk, though maybe I have misunderstood the 
problem.
 
Anthony

On Thursday, June 9, 2011 10:03:01 AM UTC-4, cjrh wrote: 

> Ok, so here is the thing: it appears that on Windows, everything works if 
> the capitalization of the import statement matches the capitalization of the 
> folder structure. 
>
> Consider this folder structure (and there is an __init__.py in each folder 
> hierarchy): 
>
>  /app/Cast/inner/cast.py
>
>
> In my file /test_imp.py, these contents WORK:
>
>  try:
>  import app.Cast.inner.cast
>  print 'Pass'
>  except:
>  print 'Fail'
>  pass
>
>
> These contents FAIL:
>
>  try:
>  import app.cast.inner.cast
>  print 'Pass'
>  except:
>  print 'Fail'
>  pass
>
>
> If, however, I change the folder structure to this:
>
>  /app/cast/inner/cast.py
>
>
> Then I get *exactly opposite results*.  In other words, the capitalization 
> of the import path in the python file and on the file system must exactly 
> match.  This is on Windows XP x64 SP2.  I have attached my test.
>
> In my opinion, we should just document that the cast must match.  Note that 
> this issue has *nothing to do with web2py*, and as a Windows user, I am 
> not too surprised by this behaviour anyway.
>


Re: Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread caleb . hattingh

On , Massimo Di Pierro  wrote:
So you suggest removing the case insensitive flag that was added in  
1.96.4?


Yes. In Alessandro's specific case, he should use:

import app.Castalia.blah.blah.castialia

and all will be fine.


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Massimo Di Pierro
So you suggest removing the case insensitive flag that was added in 1.96.4?

Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread cjrh
For anyone else following, the thread is 
here. 
  I am going to have a look at this.

Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Pierre Thibault
2011/6/9 

> On , Pierre Thibault  wrote:
> > 2011/6/9 cjrh caleb.hatti...@gmail.com>
> >
> > On Thursday, 9 June 2011 03:03:51 UTC+2, Massimo Di Pierro wrote:Users
> who have an opinion please share it now. This is important.
> >
> > Could you direct us to more details about the issue?My current
> understanding is shallow, but I agree with Pierre that platform-specific
> environment settings are very likely not the way to go here.   I much prefer
> all cross-platform issues to be handled with the "os" and sub modules.   Why
> can't we do that here?
> >
> > It seems we have no developer with Windows where is the problem.
>
> I am on Windows, still XP even. Is there a small zipped app that I could
> test quickly to see the problem?


Sure, if you can debug code. Get code from the Mercurial repository. Debug
and submit the patch to Massimo. Look for the problem described by
Alessandro.

You'll find the information you need on the problem on the threads named
"web2py 1.96.*x* is OUT".

It is probably a bug with the code I wrote but I don't have a Windows
machine to debug a problem specific to this platform.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread caleb . hattingh

On , Pierre Thibault  wrote:

2011/6/9 cjrh caleb.hatti...@gmail.com>


On Thursday, 9 June 2011 03:03:51 UTC+2, Massimo Di Pierro wrote:Users  
who have an opinion please share it now. This is important.


Could you direct us to more details about the issue? My current  
understanding is shallow, but I agree with Pierre that platform-specific  
environment settings are very likely not the way to go here. I much  
prefer all cross-platform issues to be handled with the "os" and sub  
modules. Why can't we do that here?



It seems we have no developer with Windows where is the problem.


I am on Windows, still XP even. Is there a small zipped app that I could  
test quickly to see the problem?


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-09 Thread Pierre Thibault
2011/6/9 cjrh 

> On Thursday, 9 June 2011 03:03:51 UTC+2, Massimo Di Pierro wrote:
>>
>> Users who have an opinion please share it now. This is important.
>>
>
> Could you direct us to more details about the issue?My current
> understanding is shallow, but I agree with Pierre that platform-specific
> environment settings are very likely not the way to go here.   I much prefer
> all cross-platform issues to be handled with the "os" and sub modules.   Why
> can't we do that here?
>

It seems we have no developer with Windows where is the problem.



-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread cjrh
On Thursday, 9 June 2011 03:03:51 UTC+2, Massimo Di Pierro wrote:
>
> Users who have an opinion please share it now. This is important. 
>

Could you direct us to more details about the issue?My current 
understanding is shallow, but I agree with Pierre that platform-specific 
environment settings are very likely not the way to go here.   I much prefer 
all cross-platform issues to be handled with the "os" and sub modules.   Why 
can't we do that here?What are the relevant issue numbers on the web2py 
google code site?   I had a quick look, but nothing jumps out at me.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Massimo Di Pierro
If I understand the code in trunk (with the temp fix) it does not
affect file wiring. It just changes how modules are located so that if
you have both module and modUle and you import modUle, it would
incorrectly pick up the former instead of the latter. I have yet to
see to module with names that only differ for their case.

Yes if a better solution comes up, I am all for it. I suggested Pierre
that he opens a ticket.

I am reluctant to remove the temporary fix without a better one
because that would break the new import on windows.

Massimo

On Jun 8, 8:56 pm, Jonathan Lundell  wrote:
> On Jun 8, 2011, at 6:47 PM, Pierre Thibault wrote:
>
> > 2011/6/8 Jonathan Lundell 
> > On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
>
> > > Let me tink about this.
> > > This has relevant content:
> > >http://www.python.org/dev/peps/pep-0235/
>
> > > Users who have an opinion please share it now. This is important.
>
> > What's going on, exactly? My impression is that something is getting 
> > lowercased that shouldn't be. Is it not within web2py's control?
>
> > Yes, I think it is a bug somewhere in the patch that I submitted.
>
> Good; then we can fix it. As PEP-235 implies, it's a good idea to be 
> case-preserving on case-insensitive filesystems.


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Jonathan Lundell
On Jun 8, 2011, at 6:47 PM, Pierre Thibault wrote:
> 2011/6/8 Jonathan Lundell 
> On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
> >
> > Let me tink about this.
> > This has relevant content:
> > http://www.python.org/dev/peps/pep-0235/
> >
> > Users who have an opinion please share it now. This is important.
> 
> What's going on, exactly? My impression is that something is getting 
> lowercased that shouldn't be. Is it not within web2py's control?
> 
> Yes, I think it is a bug somewhere in the patch that I submitted.

Good; then we can fix it. As PEP-235 implies, it's a good idea to be 
case-preserving on case-insensitive filesystems. 

Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread contatogilson...@gmail.com
The blocks are not working.

layout.html
(...)
{{ block header }}{{end}}

header.html
{{ extend 'layout.html' }}

{{ block header }}
Header
{{ end }}
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/6/8 Pierre Thibault 

> 2011/6/8 Jonathan Lundell 
>
>> On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
>> >
>> > Let me tink about this.
>> > This has relevant content:
>> > http://www.python.org/dev/peps/pep-0235/
>> >
>> > Users who have an opinion please share it now. This is important.
>>
>> What's going on, exactly? My impression is that something is getting
>> lowercased that shouldn't be. Is it not within web2py's control?
>>
>>
>
> Yes, I think it is a bug somewhere in the patch that I submitted.
> --
>
>
> A+
>
> -
> Pierre
> My blog and profile 
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2) 
>
>


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/8 Jonathan Lundell 

> On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
> >
> > Let me tink about this.
> > This has relevant content:
> > http://www.python.org/dev/peps/pep-0235/
> >
> > Users who have an opinion please share it now. This is important.
>
> What's going on, exactly? My impression is that something is getting
> lowercased that shouldn't be. Is it not within web2py's control?
>
>

Yes, I think it is a bug somewhere in the patch that I submitted.
-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/8 Massimo Di Pierro 

> Let me tink about this.
> This has relevant content:
> http://www.python.org/dev/peps/pep-0235/
>
> Users who have an opinion please share it now. This is important.
>

Thank you for the pointer. It seems there is a bug in the web2py code where
we are losing the capitalization. The import on Windows should work just
like if it was on Unix. The best thing would be to fix this bug but it has
to be done on Windows so until then we can create a ticket.

I suggest to remove the current fix in trunk because it is too awkward.
Alessandro can use lower case letters until real fix done.

I think it is the best solution for the moment.

-- 


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Jonathan Lundell
On Jun 8, 2011, at 6:03 PM, Massimo Di Pierro wrote:
> 
> Let me tink about this.
> This has relevant content:
> http://www.python.org/dev/peps/pep-0235/
> 
> Users who have an opinion please share it now. This is important.

What's going on, exactly? My impression is that something is getting lowercased 
that shouldn't be. Is it not within web2py's control?

> 
> 
> On Jun 8, 7:45 pm, Pierre Thibault  wrote:
>> 2011/6/7 Massimo Di Pierro 
>> 
>>> I am not much of a windows user. I would like to understand what can
>>> go wrong with the solution in trunk?
>>> --
>> 
>> Is the solution in the trunk the one proposed by Alessandro:
>> 
>> os.environ['PYTHONCASEOK'] = '1'
>> 
>> ?
>> 
>> Well, this solution is using a global change to fix for what is just
>> probably just one bad line of code. This a good temporary solution but a bad
>> long term solution.
>> 
>> This is solution have the following flaws:
>> 
>> - This solution may impact a lot of code;
>> - Developers may experience unexpected behavior;
>> - It makes it difficult to integrate web2py code with other code;
>> 
>> The last flaw is very nasty. One example is web2py needing a special Python
>> setting and another piece of code needing another setting. So each time
>> execution switches from one source to another, the settings has to be
>> restored properly. This may mean a big patch needs to be applied to make it
>> work. This is the risk I see in this solution.
>> 
>> And this problem is more probably related to a case insensitive file system
>> than Windows itself. It may be only related to the file system type.
>> 
>> This is why I suggested a ticket for a better fix later.
>> 
>> A+
>> 
>> -
>> Pierre
>> My blog and profile
>> (http://pierrethibault.posterous.com)
>> YouTube page 
>> (http://www.youtube.com/user/tubetib)
>> Twitter (http://twitter.com/pierreth2) 




[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Massimo Di Pierro
Let me tink about this.
This has relevant content:
http://www.python.org/dev/peps/pep-0235/

Users who have an opinion please share it now. This is important.


On Jun 8, 7:45 pm, Pierre Thibault  wrote:
> 2011/6/7 Massimo Di Pierro 
>
> > I am not much of a windows user. I would like to understand what can
> > go wrong with the solution in trunk?
> > --
>
> Is the solution in the trunk the one proposed by Alessandro:
>
> os.environ['PYTHONCASEOK'] = '1'
>
> ?
>
> Well, this solution is using a global change to fix for what is just
> probably just one bad line of code. This a good temporary solution but a bad
> long term solution.
>
> This is solution have the following flaws:
>
> - This solution may impact a lot of code;
> - Developers may experience unexpected behavior;
> - It makes it difficult to integrate web2py code with other code;
>
> The last flaw is very nasty. One example is web2py needing a special Python
> setting and another piece of code needing another setting. So each time
> execution switches from one source to another, the settings has to be
> restored properly. This may mean a big patch needs to be applied to make it
> work. This is the risk I see in this solution.
>
> And this problem is more probably related to a case insensitive file system
> than Windows itself. It may be only related to the file system type.
>
> This is why I suggested a ticket for a better fix later.
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2) 


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Pierre Thibault
2011/6/7 Massimo Di Pierro 

> I am not much of a windows user. I would like to understand what can
> go wrong with the solution in trunk?
> --
>

Is the solution in the trunk the one proposed by Alessandro:

os.environ['PYTHONCASEOK'] = '1'

?

Well, this solution is using a global change to fix for what is just
probably just one bad line of code. This a good temporary solution but a bad
long term solution.

This is solution have the following flaws:

- This solution may impact a lot of code;
- Developers may experience unexpected behavior;
- It makes it difficult to integrate web2py code with other code;

The last flaw is very nasty. One example is web2py needing a special Python
setting and another piece of code needing another setting. So each time
execution switches from one source to another, the settings has to be
restored properly. This may mean a big patch needs to be applied to make it
work. This is the risk I see in this solution.

And this problem is more probably related to a case insensitive file system
than Windows itself. It may be only related to the file system type.

This is why I suggested a ticket for a better fix later.


A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread JayShaffstall
The model is in email/settings.py, the controller is email.py.  Both
are in the standard spots for web2py models and controllers (e.g. /app/
controllers/email.py, and /app/models/email/settings.py).

This was working before the update to 1.96.4, but I'm not sure which
version I had pre-update.

Based on what ron_m said, it sounds like this is a bug specific to my
app, not the update.  I'll try to isolate it.

Jay

On Jun 8, 4:17 pm, Massimo Di Pierro 
wrote:
> what is the exact path to the model? and what s the associated
> controller name (full path)?
>
> On Jun 8, 2:29 pm, JayShaffstall  wrote:
>
>
>
>
>
>
>
> > Can anyone verify whether controller specific models are working for
> > them using 1.96.4?
>
> > I had an email.py controller, with email/settings.py model.  Confirmed
> > with a print that the settings.py model is no longer being loaded when
> > I invoke a method inside email.py.  This was working fine with my
> > previous version of web2py (1.95.x, I don't recall which exactly).
> > After upgrading to 1.96.4, the model isn't being loaded.  If someone
> > else can verify their controller specific models are working with
> > 1.96.4, I can continue hunting for a different cause.
>
> > Or, if someone can point me to release notes that talk about how
> > controller specific models have changed since 1.95.x, that would be
> > great, too.
>
> > Jay
>
> > On Jun 7, 4:16 pm, Massimo Di Pierro 
> > wrote:
>
> > > Many big fixes compared with 1.96.3. In particular:
>
> > > - explicitly closing all open files (should make it work in Pypy),
> > > thanks Caleb
> > > - even better security in uuid (thanks Jonathan and David)
> > > - template decoupled from web2py, thanks Ryan
> > > - fixed a typo on Oracle nested selects
> > > - better support for "id" fields not called "id"
> > > - auto import should work on windows (now on windows ignore will
> > > ignore case by default)


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread ron_m
I should have said using version 1.96.4 as verification requested by Jay. 
BTW controller specific models were not introduced until 1.96.1

On Wednesday, 8 June 2011 13:37:11 UTC-7, ron_m wrote:
>
> My application is working with model files under a subdirectory == the 
> controller name.
>


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread contatogilson...@gmail.com
And in the pypi?
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/6/8 ron_m 

> My application is working with model files under a subdirectory == the
> controller name.
>


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread ron_m
My application is working with model files under a subdirectory == the 
controller name.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Massimo Di Pierro
what is the exact path to the model? and what s the associated
controller name (full path)?

On Jun 8, 2:29 pm, JayShaffstall  wrote:
> Can anyone verify whether controller specific models are working for
> them using 1.96.4?
>
> I had an email.py controller, with email/settings.py model.  Confirmed
> with a print that the settings.py model is no longer being loaded when
> I invoke a method inside email.py.  This was working fine with my
> previous version of web2py (1.95.x, I don't recall which exactly).
> After upgrading to 1.96.4, the model isn't being loaded.  If someone
> else can verify their controller specific models are working with
> 1.96.4, I can continue hunting for a different cause.
>
> Or, if someone can point me to release notes that talk about how
> controller specific models have changed since 1.95.x, that would be
> great, too.
>
> Jay
>
> On Jun 7, 4:16 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > Many big fixes compared with 1.96.3. In particular:
>
> > - explicitly closing all open files (should make it work in Pypy),
> > thanks Caleb
> > - even better security in uuid (thanks Jonathan and David)
> > - template decoupled from web2py, thanks Ryan
> > - fixed a typo on Oracle nested selects
> > - better support for "id" fields not called "id"
> > - auto import should work on windows (now on windows ignore will
> > ignore case by default)


[web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread JayShaffstall
Can anyone verify whether controller specific models are working for
them using 1.96.4?

I had an email.py controller, with email/settings.py model.  Confirmed
with a print that the settings.py model is no longer being loaded when
I invoke a method inside email.py.  This was working fine with my
previous version of web2py (1.95.x, I don't recall which exactly).
After upgrading to 1.96.4, the model isn't being loaded.  If someone
else can verify their controller specific models are working with
1.96.4, I can continue hunting for a different cause.

Or, if someone can point me to release notes that talk about how
controller specific models have changed since 1.95.x, that would be
great, too.

Jay

On Jun 7, 4:16 pm, Massimo Di Pierro 
wrote:
> Many big fixes compared with 1.96.3. In particular:
>
> - explicitly closing all open files (should make it work in Pypy),
> thanks Caleb
> - even better security in uuid (thanks Jonathan and David)
> - template decoupled from web2py, thanks Ryan
> - fixed a typo on Oracle nested selects
> - better support for "id" fields not called "id"
> - auto import should work on windows (now on windows ignore will
> ignore case by default)


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-08 Thread Phyo Arkar
cjrh

Thank you so much for this notice. I have not update web2py for very
long coz it have a track record of breaking my production site apps
:D.

I will check out what breaks and what not.

On Wed, Jun 8, 2011 at 12:53 PM, cjrh  wrote:
> On Jun 7, 10:16 pm, Massimo Di Pierro 
> wrote:
>> - explicitly closing all open files (should make it work in Pypy),
>> thanks Caleb
>
> Just everyone, please note: that was a large change (>80KB diff)
> affecting tiny parts of many files, so you should test your apps
> before immediately upgrading any production sites.  After that patch,
> I already found one bug that I introduced in that patch, the fix for
> which is already included in 1.96.4, but there could be others.
>
> On the plus side, web2py on pypy appears to run fairly well.  I
> haven't benchmarked or done any stress-testing yet (and I have seen
> some pypy funnies in my testing so far, but more like spurious,
> intermittent, lowel-level pypy errors) but I hope to do some of that
> soon.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread cjrh
On Jun 7, 10:16 pm, Massimo Di Pierro 
wrote:
> - explicitly closing all open files (should make it work in Pypy),
> thanks Caleb

Just everyone, please note: that was a large change (>80KB diff)
affecting tiny parts of many files, so you should test your apps
before immediately upgrading any production sites.  After that patch,
I already found one bug that I introduced in that patch, the fix for
which is already included in 1.96.4, but there could be others.

On the plus side, web2py on pypy appears to run fairly well.  I
haven't benchmarked or done any stress-testing yet (and I have seen
some pypy funnies in my testing so far, but more like spurious,
intermittent, lowel-level pypy errors) but I hope to do some of that
soon.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread cjrh
On Jun 7, 10:38 pm, danto  wrote:
> Traceback (most recent call last):
>   File "/home/danto/web2py/gluon/restricted.py", line 184, in restricted
>     passed to RestrictedError to identify where the error occurred.
>   File "/home/danto/web2py/applications/admin/models/access.py", line
> 2, in 
>     from gluon.fileutils import read_file
> ImportError: cannot import name read_file
>
> anyway, I restarted the server through the shell and when I back
> session.flash show me that I'm on 1.94, but was wierd

Ok, that function "read_file" is definitely in gluon/fileutils.py in
1.96.4.  I guess you just need to restart your web2py, because the
gluon files do not get executed on every request, you have to restart
the process.


[web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread cjrh
On Jun 7, 10:38 pm, danto  wrote:
> I tried to upgrade from the web interface at my local installation and seem
> to break something, raising me an error. I found this in the admin app error
> log:
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
>
> Traceback (most recent call last):
>   File "/home/danto/web2py/gluon/restricted.py", line 184, in restricted
>     passed to RestrictedError to identify where the error occurred.
>   File "/home/danto/web2py/applications/admin/models/access.py", line
> 2, in 
>     from gluon.fileutils import read_file
> ImportError: cannot import name read_file

That looks like mine.  Looking into it now.



[web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread Massimo Di Pierro
I am not much of a windows user. I would like to understand what can
go wrong with the solution in trunk?

On Jun 7, 7:01 pm, Pierre Thibault  wrote:
> 2011/6/7 Massimo Di Pierro 
>
> > What do you propose? I do not like it very much either.
>
> > On Jun 7, 3:33 pm, Pierre Thibault  wrote:
> > > 2011/6/7 Massimo Di Pierro 
>
> > > > - auto import should work on windows (now on windows ignore will
> > > > ignore case by default)
>
> > > I don't like this solution.
>
> > > --
>
> > > A+
>
> I guess it is a pragmatic solution until someone can edit and test the code
> under Windows. I suggest creating a ticket with low priority for doing this
> later as an improvement.
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2) 


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread Pierre Thibault
2011/6/7 Massimo Di Pierro 

> What do you propose? I do not like it very much either.
>
> On Jun 7, 3:33 pm, Pierre Thibault  wrote:
> > 2011/6/7 Massimo Di Pierro 
> >
> > > - auto import should work on windows (now on windows ignore will
> > > ignore case by default)
> >
> > I don't like this solution.
> >
> > --
> >
> > A+
>

I guess it is a pragmatic solution until someone can edit and test the code
under Windows. I suggest creating a ticket with low priority for doing this
later as an improvement.

A+

-
Pierre
My blog and profile
(http://pierrethibault.posterous.com)
YouTube page 
(http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2) 


Re: [web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread Stifan Kristi
good job, everyone, hope web2py improve day by day, thank you so much.
\(^o^)/


[web2py] Re: web2py 1.96.4 is OUT

2011-06-07 Thread Massimo Di Pierro
What do you propose? I do not like it very much either.

On Jun 7, 3:33 pm, Pierre Thibault  wrote:
> 2011/6/7 Massimo Di Pierro 
>
> > - auto import should work on windows (now on windows ignore will
> > ignore case by default)
>
> I don't like this solution.
>
> --
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2)