Re: [Zope] Upgrading to Zope 2.9.1

2006-03-10 Thread Dieter Maurer
Chris Withers wrote at 2006-3-10 08:17 +:
>Dieter Maurer wrote:
>> It does now -- at least for "FSPythonScripts" when you are on a *nix
>> platform and your files contain DOS lineends.
>
>Does this only affect (FS)PythonScripts or all disk based python code?

I do not know. Try it out...


-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-10 Thread Dieter Maurer
Brian Sullivan wrote at 2006-3-9 14:23 -0500:
>On 3/9/06, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> ...
>> It does now -- at least for "FSPythonScripts" when you are on a *nix
>> platform and your files contain DOS lineends.
>>
>>  You then will get (starting with Python 2.4) SyntaxErrors
>>  at line ends.
>>
>> Of course, things are different when you are on a Windows platform
>> and your files contain DOS lineends...
>>
>
>Different in what way?

On Windows, FSPythonScripts may use DOS lineends.

>I was experiencing difficulty on a Windows platform. The scripts in
>question have never seen anything other than Windows.
>
>Are you indicating that the line end issue is not what I was experiencing?

Indeed, it looks this way.


However, there is another caveat:

  Sometimes files with DOS lineends end up in CVS (maybe SVN)
  (in your own that of the developpers). When they are extracted
  from Windows, then the DOS lineend "\r\n" can become
  "\r\r\n" and that Python does not like even under Windows.


You can easily find out whether you have a lineend problem
by examining your files with a binary viewer (do not know
what such a binary viewer is under Windows -- under *nix,
"od" is one).


-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-10 Thread Brian Sullivan
On 3/10/06, Patrick Decat <[EMAIL PROTECTED]> wrote:
> Attached is is screenshot of the error message.
>
> There is no error in the event log.
>
> Steps to reproduce :
> - Create a Python Script on the file system with Windows style line-endings
> - Go to http://localhost:8080/manage
> - Click the drop down list to add a Python Script
> - Enter "test_eol" in the id field
> - Click "Browse" to find and select your script on the filesystem
> - Click "Add"
> - Error : invalid syntax (Script (Python), line 2)
> - Click "Save changes" -> the error is gone.
>
> System information :
> - Windows 2000 SP4 (client and server)
> - Zope 2.9.1 (fresh install with
> http://www.zope.org/Products/Zope/2.9.1/Zope-2.9.1-win32.exe
> installer)
> - Only product installed : ExternalEditor 0.9.1
>

Sounds like exactly what I experienced ( I guess the repro steps
should mean it will be fixed).
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-10 Thread Chris Withers

Dieter Maurer wrote:

It does now -- at least for "FSPythonScripts" when you are on a *nix
platform and your files contain DOS lineends.


Does this only affect (FS)PythonScripts or all disk based python code?

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-10 Thread Chris Withers

Brian Sullivan wrote:

Something like:

invalid syntax (Script (Python), line 3)

(in a pink box when the script was opened for editing via the ZMI)

Since I saved the script and the problem went away I can't be totally sure.


I sometimes see this when there a syntax error elsewhere in the file 
(missing bracket, bad indentation, etc)
For some reason, PythonScripts seem to give bad line number reports and 
sometimes odd error messages when this sort of thing happens...


Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-09 Thread Patrick Decat
Attached is is screenshot of the error message.

There is no error in the event log.

Steps to reproduce :
- Create a Python Script on the file system with Windows style line-endings
- Go to http://localhost:8080/manage
- Click the drop down list to add a Python Script
- Enter "test_eol" in the id field
- Click "Browse" to find and select your script on the filesystem
- Click "Add"
- Error : invalid syntax (Script (Python), line 2)
- Click "Save changes" -> the error is gone.

System information :
- Windows 2000 SP4 (client and server)
- Zope 2.9.1 (fresh install with
http://www.zope.org/Products/Zope/2.9.1/Zope-2.9.1-win32.exe
installer)
- Only product installed : ExternalEditor 0.9.1

# Zope version: (Zope 2.9.1, python 2.4.2, win32)
# Python version: 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
# System Platform: win32
# SOFTWARE_HOME: C:\Program Files\Zope-2.9.1\lib\python
# INSTANCE_HOME: D:\Zope-Instance
# CLIENT_HOME: D:\Zope-Instance\var
# Process ID: 1080 (1460)
# Running for: 14 min 14 sec
# sys.path:
  D:\Zope-Instance\lib\python
  D:\Zope-Instance\lib\python
  C:\Program Files\Zope-2.9.1\lib\python\Zope2\Startup
  C:\Program Files\Zope-2.9.1\lib\python
  C:\Program Files\Zope-2.9.1\lib\python
  C:\Program Files\Zope-2.9.1\bin\python24.zip
  C:\Program Files\Zope-2.9.1\bin\DLLs
  C:\Program Files\Zope-2.9.1\bin\lib
  C:\Program Files\Zope-2.9.1\bin\lib\plat-win
  C:\Program Files\Zope-2.9.1\bin\lib\lib-tk
  C:\Program Files\Zope-2.9.1\bin
  C:\Program Files\Zope-2.9.1\bin\lib\site-packages
  C:\Program Files\Zope-2.9.1\bin\lib\site-packages\win32
  C:\Program Files\Zope-2.9.1\bin\lib\site-packages\win32\lib
  C:\Program Files\Zope-2.9.1\bin\lib\site-packages\Pythonwin
On 3/10/06, Brian Sullivan <[EMAIL PROTECTED]> wrote:
>
> Something like:
>
> invalid syntax (Script (Python), line 3)
>
> (in a pink box when the script was opened for editing via the ZMI)
>
> Since I saved the script and the problem went away I can't be totally sure.
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>


zope-2.9.1-windows-eol.png
Description: PNG image
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-09 Thread Brian Sullivan
On 3/9/06, Einar Næss Jensen <[EMAIL PROTECTED]> wrote:
>
>
>
> On 3/9/06, Brian Sullivan <[EMAIL PROTECTED]> wrote:
> >
> On 3/9/06, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> > Chris Withers wrote at 2006-3-9 08:10 +:
> > > ...
> > >Really? I find that pretty suprising. Python has never cared about line
> > >endings before and I'd be pretty mortified if it started now :-(
> > >
> > >Dieter?
> >
> > It does now -- at least for "FSPythonScripts" when you are on a *nix
> > platform and your files contain DOS lineends.
> >
> >  You then will get (starting with Python 2.4) SyntaxErrors
> >  at line ends.
> >
> > Of course, things are different when you are on a Windows platform
> > and your files contain DOS lineends...
> >
>
> Different in what way?
>
> I was experiencing difficulty on a Windows platform. The scripts in
> question have never seen anything other than Windows.
>
> Are you indicating that the line end issue is not what I was experiencing?
> ___
>
> My guess is that it would be difficult to say anything about that without
> any errormessages?
> What did it say in your line 3, and what made you look there?
>


Something like:

invalid syntax (Script (Python), line 3)

(in a pink box when the script was opened for editing via the ZMI)

Since I saved the script and the problem went away I can't be totally sure.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-09 Thread Brian Sullivan
On 3/9/06, Dieter Maurer <[EMAIL PROTECTED]> wrote:
> Chris Withers wrote at 2006-3-9 08:10 +:
> > ...
> >Really? I find that pretty suprising. Python has never cared about line
> >endings before and I'd be pretty mortified if it started now :-(
> >
> >Dieter?
>
> It does now -- at least for "FSPythonScripts" when you are on a *nix
> platform and your files contain DOS lineends.
>
>  You then will get (starting with Python 2.4) SyntaxErrors
>  at line ends.
>
> Of course, things are different when you are on a Windows platform
> and your files contain DOS lineends...
>

Different in what way?

I was experiencing difficulty on a Windows platform. The scripts in
question have never seen anything other than Windows.

Are you indicating that the line end issue is not what I was experiencing?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-09 Thread Dieter Maurer
Chris Withers wrote at 2006-3-9 08:10 +:
> ...
>Really? I find that pretty suprising. Python has never cared about line 
>endings before and I'd be pretty mortified if it started now :-(
>
>Dieter?

It does now -- at least for "FSPythonScripts" when you are on a *nix
platform and your files contain DOS lineends.

  You then will get (starting with Python 2.4) SyntaxErrors
  at line ends.

Of course, things are different when you are on a Windows platform
and your files contain DOS lineends...

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-09 Thread Chris Withers

Patrick Decat wrote:

I had the same problem : Windows CR/LF line endings are not supported
anymore for PythonScripts.
According to Dieter Maurer, it has to do with Python 2.4 rather than Zope 2.9.


Really? I find that pretty suprising. Python has never cared about line 
endings before and I'd be pretty mortified if it started now :-(


Dieter?

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-08 Thread Brian Sullivan
On 3/8/06, Patrick Decat <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 3/8/06, Brian Sullivan <[EMAIL PROTECTED]> wrote:
> > I am in the process of testing an upgrade from a Zope 2.8.4 system  to
> > a Zope 2.9.1 system.
> >
> > The process I used:
> >
> > 1) Install 2.9.1 on a Win2003 system (it happens to be the same one
> > that the 2.8.4 system is running but I changed the config so the ports
> > don't conflict). The installation is successful
> >
> > 2) Copy the Product directory from my functioning 2.8.4 system
> > instance to the 2.9.1 instance
> >
> > 3) copy the ZODB from the functioning 2.8.4 system to the 2.9.1 system
> >
> > All appears to go well -- the 2.9.1 system appears to be running
> > everything from the 2.8.4 system correctly. A deeper check though
> > shows that a few Python scripts in the ZODB (this in a system that has
> > 20 or 30 scripts) fail. Examining the scripts indicates an error at
> > line 3 -- but no such error can be found, however saving the script
> > with no changes eliminates the error and also causes the script to now
> > function.
> >
> > After finding and correcting these scripts everything seems to be working 
> > well.
> >
> > Any idea what happened during the upgrade to cause this strange
> > behaviour and how can I avoid it?
> >
> > I will have to go through a similar upgrade at a customer's site and
> > would like to avoid hand checking every script if I can avoid it.
>
> I had the same problem : Windows CR/LF line endings are not supported
> anymore for PythonScripts.
> According to Dieter Maurer, it has to do with Python 2.4 rather than Zope 2.9.
>


OK -- sounds like a plausible explanation.

Any idea how to predict when this is going to be a problem?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Upgrading to Zope 2.9.1

2006-03-08 Thread Patrick Decat
Hi,

On 3/8/06, Brian Sullivan <[EMAIL PROTECTED]> wrote:
> I am in the process of testing an upgrade from a Zope 2.8.4 system  to
> a Zope 2.9.1 system.
>
> The process I used:
>
> 1) Install 2.9.1 on a Win2003 system (it happens to be the same one
> that the 2.8.4 system is running but I changed the config so the ports
> don't conflict). The installation is successful
>
> 2) Copy the Product directory from my functioning 2.8.4 system
> instance to the 2.9.1 instance
>
> 3) copy the ZODB from the functioning 2.8.4 system to the 2.9.1 system
>
> All appears to go well -- the 2.9.1 system appears to be running
> everything from the 2.8.4 system correctly. A deeper check though
> shows that a few Python scripts in the ZODB (this in a system that has
> 20 or 30 scripts) fail. Examining the scripts indicates an error at
> line 3 -- but no such error can be found, however saving the script
> with no changes eliminates the error and also causes the script to now
> function.
>
> After finding and correcting these scripts everything seems to be working 
> well.
>
> Any idea what happened during the upgrade to cause this strange
> behaviour and how can I avoid it?
>
> I will have to go through a similar upgrade at a customer's site and
> would like to avoid hand checking every script if I can avoid it.

I had the same problem : Windows CR/LF line endings are not supported
anymore for PythonScripts.
According to Dieter Maurer, it has to do with Python 2.4 rather than Zope 2.9.

Regards,
Patrick.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )