Date: Thu, 20 Jan 2005 00:04:19 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 507 ************************************************** Wednesday 19 January 2005 Number 507 ************************************************** Subjects for today 1 Re: Python v2.4 : John Poltorak 2 sed script to initialise variables : John Poltorak 3 Python as a first programming language? : John Poltorak 4 Re: GNU Test : Steven Levine" 5 Re: Python as a first programming language? : Steven Levine" 6 Re: GNU Test : John Poltorak 7 AssertionError : John Poltorak 8 Re: GNU Test : Steven Levine" 9 Re: Program to demonstrate fork DLL load errors : lsunley at mb.sympatico.ca 10 Re: Bridge software : Steve Wendt" 11 RE: postgreSQL v8.0 build : lsunley at mb.sympatico.ca 12 postgreSQL v8.0 GA build : lsunley at mb.sympatico.ca 13 Re: Program to demonstrate fork DLL load errors : Dave Yeo" 14 Re: Program to demonstrate fork DLL load errors : lsunley at mb.sympatico.ca 15 Re: Program to demonstrate fork DLL load errors : Dave Yeo" 16 Re: Program to demonstrate fork DLL load errors : Dave Yeo" 17 Re: Program to demonstrate fork DLL load errors : lsunley at mb.sympatico.ca 18 Re: Program to demonstrate fork DLL load errors : Knut St. Osmundsen" 19 Re: sed script to initialise variables : Steven Levine" 20 Re: Bridge software : Steven Levine" 21 Re: sed script to initialise variables : John Poltorak 22 Zope 2.7.4 : John Poltorak 23 Re: AssertionError : Andrew MacIntyre 24 Re: Python v2.4 : Andrew MacIntyre 25 Re: AssertionError : Knut St. Osmundsen" **= Email 1 ==========================** Date: Tue, 18 Jan 2005 13:37:09 +0000 From: John Poltorak Subject: Re: Python v2.4 On Tue, Jan 18, 2005 at 08:58:24PM +1000, Andrew MacIntyre wrote: > John Poltorak wrote: > > > Is this how I should code the patch for Lockfile.py now:- ? > This patch should not be needed with the 2.4 distribution (source or > binary). What about this one for MailList.py:- ? --- mailman-2.1.5/Mailman/MailList.py~ Thu Mar 4 14:10:28 2004 +++ mailman-2.1.5/Mailman/MailList.py Sun Jan 16 20:50:08 2005 at at -242,12 +242,19 at at # timestamp is newer than the modtime of the config.pck file, we don't # need to reload, otherwise... we do. self.__timestamp = 0 - self.__lock = LockFile.LockFile( - os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', - # TBD: is this a good choice of lifetime? - lifetime = mm_cfg.LIST_LOCK_LIFETIME, - withlogging = mm_cfg.LIST_LOCK_DEBUGGING) - self._internal_name = name + if os.name in ('os2',): + self.__lock = LockFile.LockFile( + os.path.join(mm_cfg.LOCK_DIR, name or '=site=') + '.lock', + # TBD: is this a good choice of lifetime? + lifetime = mm_cfg.LIST_LOCK_LIFETIME, + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) + else: + self.__lock = LockFile.LockFile( + os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', + # TBD: is this a good choice of lifetime? + lifetime = mm_cfg.LIST_LOCK_LIFETIME, + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) + self._internal_name = name if name: self._full_path = Site.get_listpath(name) else: at at -502,6 +509,8 at at os.link(fname, fname_last) except OSError, e: if e.errno <> errno.ENOENT: raise + if os.name == 'os2' and os.access(fname, os.F_OK): + os.unlink(fname) os.rename(fname_tmp, fname) # Reset the timestamp self.__timestamp = os.path.getmtime(fname) > It wasn't supposed to be needed with my binary 2.3.4 distribution > either, but I've just noticed that I forgot the change to Lib/os.py that > is in 2.4 which meant the above patch is still required... :-( I'll try > and make sure that this is done properly in the 2.3.5 binary > distribution (2.3.5 is a bug-fix wrap-up release of the 2.3 branch, > expected to appear next week). Is this the section you mean:- ? elif 'os2' in _names: name = 'os2' linesep = '\r\n' from os2 import * try: from os2 import _exit except ImportError: pass if sys.version.find('EMX GCC') == -1: import ntpath as path else: import os2emxpath as path from _emx_link import link import os2 __all__.extend(_get_exports_list(os2)) del os2 You have _emx_link in there... > > So, as far as your current distribution of Python stands, does it need to > > rebuilt with a different thread stack size to be suitable for running > > Zope with Plone? > > I built the 2.4 binary distribution with a thread stack size of 128k, > rather than the default of 64k. I see that I didn't note that in the > release notes or include a patch :-( Sorry about that! It's easily done. > Whether 128k is sufficient I don't know. I expect that you will let me > know in short order ;-) Hopefully so. I haven't had chance to build Zope 2.7.4 yet but I don't expect to need to change anything from my build environment for this version apart from changing '3' to '4' in a few places (famous last words ;-) )... > -- > ------------------------------------------------------------------------- > Andrew I MacIntyre "These thoughts are mine alone..." > E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 > andymac at pcug.org.au (alt) | Belconnen ACT 2616 > Web: http://www.andymac.org/ | Australia -- John **= Email 2 ==========================** Date: Tue, 18 Jan 2005 14:03:58 +0000 From: John Poltorak Subject: sed script to initialise variables Can anyone help me with a simple sed script? I'm trying to initialise two shell variables which are to be obtained from the second and third lines of a file. The start of the file looks like this:- P15121488 T1105916623 DdfXAA077.87 and I want to set:- T=1105916623 D=dfXAA077.87 in the environment for subsequent processing. I have something like this which almost works but not quite... sed ' 1d 2s/^T/T=/ 3s/^D/D=/ 4d 5q ' myfile > tmp-file .. tmp-file Any suggestions? -- John **= Email 3 ==========================** Date: Tue, 18 Jan 2005 14:18:46 +0000 From: John Poltorak Subject: Python as a first programming language? Interesting web page suggesting that Python should be taught as the first programming language:- http://www.ics.ltsn.ac.uk/pub/italics/Vol3-2/python.htm I still have no idea how widely it is used and it is hardly ever mentioned in OS/2 circles, but thankfully we have someone keeping us uptodate. Wonder if it has ever been covered on EDM/2 or either of the Ezines... -- John **= Email 4 ==========================** Date: Tue, 18 Jan 2005 08:58:13 -0800 From: "Steven Levine" Subject: Re: GNU Test In <20050118103106.B48 at warpix.org>, on 01/18/05 at 10:31 AM, John Poltorak said: >GNU Test (part of the shell utilities) has numerous options, but I don't >see one which tests to see if a file is accessible. ie I want to check to > see if a file is locked. Do any of the options for test look suitable? >And if not how else could I tell if I can access a file before trying to >read it? Use -r to test for exists and readable. Use -w to test for exists and writable. Just keep in mind that the semantics of -w will differ in OS/2 compared to the unix. HTH, Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 5 ==========================** Date: Tue, 18 Jan 2005 09:16:58 -0800 From: "Steven Levine" Subject: Re: Python as a first programming language? In <20050118141846.B18360 at warpix.org>, on 01/18/05 at 02:18 PM, John Poltorak said: >Interesting web page suggesting that Python should be taught as the first > programming language:- It is an interesting idea given that Python is an interpreted language with a rich set of data structures and a not too esoteric language syntax. >I still have no idea how widely it is used and it is hardly ever >mentioned in OS/2 circles, but thankfully we have someone keeping us >uptodate. Funny you should mention this. The SCOUG Programming SIG has just embarked on some learning and, hopefully, doing with Python. There was a presentation at the general meeting last Saturday. For those that might be interested, the SIG mailing list is scoug-programming at scoug.com and is open to all. The list is Steward based, so the usual admin commands work. The website has instructions for those unfamiliar with Steward. >Wonder if it has ever been covered on EDM/2 or either of the Ezines... The first of a set of articles should now be posted at www.scoug.com. Python was a bit young when EDM/2 was actively publishing. Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 6 ==========================** Date: Tue, 18 Jan 2005 18:12:40 +0000 From: John Poltorak Subject: Re: GNU Test On Tue, Jan 18, 2005 at 08:58:13AM -0800, Steven Levine wrote: > In <20050118103106.B48 at warpix.org>, on 01/18/05 > at 10:31 AM, John Poltorak said: > > > >GNU Test (part of the shell utilities) has numerous options, but I don't > >see one which tests to see if a file is accessible. ie I want to check to > > see if a file is locked. Do any of the options for test look suitable? > >And if not how else could I tell if I can access a file before trying to > >read it? > > Use -r to test for exists and readable. > > Use -w to test for exists and writable. Just keep in mind that the > semantics of -w will differ in OS/2 compared to the unix. I suspect that the -r and -w tests only check a files r & w permissions on Unix. I can't guess what they check (if anything) on OS/2 but I doubt whether the -r test actually involves trying to read the file. What I was looking for was a test to see if an existing file was accessible, ie not locked by another process. > HTH, > > Steven > > > -- > ---------------------------------------------------------------------- > "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 > www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) > ---------------------------------------------------------------------- > -- John **= Email 7 ==========================** Date: Tue, 18 Jan 2005 22:00:25 +0000 From: John Poltorak Subject: AssertionError What is an AssertionError and how do I get rid of it? It occurs when I start mailmanctl part of the Python based mailing list manager, Mailman, and it outputs this error:- Traceback (most recent call last): File "mailmanctl", line 547, in ? main() File "mailmanctl", line 402, in main lock._transfer_to(pid) File "/usr/local/mailman/Mailman/LockFile.py", line 398, in _transfer_to assert self.__linkcount() == 2 AssertionError What is this trying to do? I gather it is some sort of Unixism associated with symbolic links which doesn't translate to OS/2. Can I just comment it out? -- John **= Email 8 ==========================** Date: Tue, 18 Jan 2005 16:22:10 -0800 From: "Steven Levine" Subject: Re: GNU Test In <20050118181240.I18360 at warpix.org>, on 01/18/05 at 06:12 PM, John Poltorak said: >I suspect that the -r and -w tests only check a files r & w permissions >on Unix. I can't guess what they check (if anything) on OS/2 but I doubt > whether the -r test actually involves trying to read the file. What I >was looking for was a test to see if an existing file was accessible, ie >not locked by another process. I understood what you were looking for. I would read some code to verify my memory, but I am pretty sure that unix does the right thing for -r and will not return true if the file is opened deny write. Think of it this way. It's just as easy to try to open the file as it is to stat it to determine the attributes. I'm sure the source code for GNU test is available, so it is easy enough to check this if you want. I have a copy of the coreutils source here and will check this when I have a few spare minutes. I've been meaning to rebuild md5sum because the md5sum 2.0.11 is somewhat broken. Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 9 ==========================** Date: Tue, 18 Jan 2005 18:33:16 -0500 From: lsunley at mb.sympatico.ca Subject: Re: Program to demonstrate fork DLL load errors In <20050118101138.W18360 at warpix.org>, on 01/18/05 at 10:11 AM, John Poltorak said: >On Mon, Jan 03, 2005 at 11:59:34PM -0500, lsunley at mb.sympatico.ca wrote: >> This zip file has two simple test cases that demonstrate problems with >> loading DLL's in a fork()ed program >> >> buildit.cmd - build commands >> testfork.c - makes testfork.exe >> testit.c testit.def - makes testit.dll >> testfork2.c - makes testfork2.exe >> testit2.c testit2.def - makes testit2.dll >> >> testfork dlopen's and dlsym's a DLL and then attempts a fork. The DLL >> loads correctly and the routine address resolves but the fork fails... >> >> testfork2 forks and then attempts to dlopen and dlsym a DLL. The fork >> works but the dlopen returns a 295 error and (needless to say) dlsym >> fails. >> >> Executables included - you need libc06b2.dll to run the tests. >If this was originally attached, it looks as though it has been stripped >off by the mailing list software. Is there any where to download it? >Now that gcc has been updated, it may worth be checking especially as I >have a system with an AMD K6. > >> Lorne Sunley >> >> -- >> ----------------------------------------------------------- >> lsunley at mb.sympatico.ca >> ----------------------------------------------------------- >> --------- buildit.cmd ------------ gcc -Zomf -c -o testit.o testit.c gcc -Zomf -Zdll -o testit.dll testit.o testit.def gcc -Zomf testfork.c ------------------------------ testfork.c ------------------------------- #include #include #include #include void * dllhandle; void * procaddr; main(argc, argv) { int forkpid; int fork2pid; int fork3pid; int rc; forkpid = fork(); switch (forkpid) { case -1: fprintf(stderr, "Fork failed in pid=%d\n", _getpid()); break; case 0: fprintf(stderr, "Fork started pid=%d\n", _getpid()); fork2pid = fork(); switch(fork2pid) { case -1: fprintf(stderr, "Fork2 failed in pid=%d\n", _getpid()); break; case 0: fprintf(stderr, "Fork 2 started pid=%d\n", _getpid()); fork3pid = fork(); switch(fork3pid) { case -1: fprintf(stderr, "Fork failed in pid=%d\n", _getpid()); break; case 0: fprintf(stderr, "Fork 3 started pid=%d\n", _getpid()); break; } fprintf(stderr, "Fork loading DLL\n", _getpid()); dllhandle = dlopen("testit.dll", RTLD_NOW|RTLD_LOCAL); fprintf(stderr, "Fork DLL handle=%d\n", dllhandle); fprintf(stderr, "Fork dlerror=%s\n", dlerror()); procaddr = dlsym(dllhandle, "_test_func"); fprintf(stderr, "Fork procaddr=%d\n", procaddr); break; default: fprintf(stderr, "Fork 2 main line in pid=%d\n", _getpid()); } break; default: fprintf(stderr, "main line in pid=%d\n", _getpid()); fprintf(stderr, "main line exiting pid=%d\n", _getpid()); } } ------------------------------- testit.c ------------------------------- #include #include int test_func (int a) { return (a + 1); } ------------------------------- testit.def ------------------------------- LIBRARY TESTIT INITINSTANCE TERMINSTANCE DESCRIPTION 'test dll' EXPORTS ; segment TEXT32 "_test_func" ; magicseg='TEXT32' len=10 ------------------------------- -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 10 ==========================** Date: Mon, 17 Jan 2005 23:29:18 -0800 (PST) From: "Steve Wendt" Subject: Re: Bridge software On Mon, 17 Jan 2005 22:40:46 -0800, Steven Levine wrote: >Oh I finally understand your point. I was a bit slow on the uptake. This >is true, but I see it as an interim problem. There's not much that can be >done about it while the kernels are undergoing rapid development. But it will *always* be in that state. ----------- "Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." - Plato (427-347 B.C.) **= Email 11 ==========================** Date: Tue, 18 Jan 2005 22:30:12 -0500 From: lsunley at mb.sympatico.ca Subject: RE: postgreSQL v8.0 build This release will also work on older CPUs. It is built with the new LIBC06B4 that supports fork() on older CPUs. -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 12 ==========================** Date: Tue, 18 Jan 2005 22:28:00 -0500 From: lsunley at mb.sympatico.ca Subject: postgreSQL v8.0 GA build Hi all, The release of the GA build of postgreSQL v8.0 is now available. The release can be found at http://hobbes.nmsu.edu the file name is postgresql-8.0-os2.zip PostgreSQL is a full featured database engine suitable for most database applications. ODBC support is available through the unixODBC for OS/2 libraries also available at http://hobbes.nmsu.edu -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 13 ==========================** Date: Tue, 18 Jan 2005 20:34:50 -0800 From: "Dave Yeo" Subject: Re: Program to demonstrate fork DLL load errors On Tue, 18 Jan 2005 18:33:16 -0500, lsunley at mb.sympatico.ca wrote: >In <20050118101138.W18360 at warpix.org>, on 01/18/05 > at 10:11 AM, John Poltorak said: > >>On Mon, Jan 03, 2005 at 11:59:34PM -0500, lsunley at mb.sympatico.ca wrote: >>> This zip file has two simple test cases that demonstrate problems with >>> loading DLL's in a fork()ed program >>> .... [R:\tmp]testfork Fork started pid=10495 main line in pid=10494 main line exiting pid=10494 Fork 2 started pid=10496 Fork 2 main line in pid=10495 Fork 3 started pid=10497 Fork loading DLL Fork DLL handle=8396 Fork dlerror=(null) Fork procaddr=338559040 Fork loading DLL Fork DLL handle=8396 Fork dlerror=(null) Fork procaddr=338559040 Dave **= Email 14 ==========================** Date: Tue, 18 Jan 2005 22:53:34 -0500 From: lsunley at mb.sympatico.ca Subject: Re: Program to demonstrate fork DLL load errors OK Works like it is supposed to... Is this a K6 CPU? Lorne In <20050119043505.F27E7B82E8 at generation.lgisp.net>, on 01/18/05 at 08:34 PM, "Dave Yeo" said: >On Tue, 18 Jan 2005 18:33:16 -0500, lsunley at mb.sympatico.ca wrote: >>In <20050118101138.W18360 at warpix.org>, on 01/18/05 >> at 10:11 AM, John Poltorak said: >> >>>On Mon, Jan 03, 2005 at 11:59:34PM -0500, lsunley at mb.sympatico.ca wrote: >>>> This zip file has two simple test cases that demonstrate problems with >>>> loading DLL's in a fork()ed program >>>> >... >[R:\tmp]testfork >Fork started pid=10495 >main line in pid=10494 >main line exiting pid=10494 >Fork 2 started pid=10496 >Fork 2 main line in pid=10495 >Fork 3 started pid=10497 >Fork loading DLL >Fork DLL handle=8396 >Fork dlerror=(null) >Fork procaddr=338559040 >Fork loading DLL >Fork DLL handle=8396 >Fork dlerror=(null) >Fork procaddr=338559040 >Dave -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 15 ==========================** Date: Tue, 18 Jan 2005 21:19:09 -0800 From: "Dave Yeo" Subject: Re: Program to demonstrate fork DLL load errors On Tue, 18 Jan 2005 22:53:34 -0500, lsunley at mb.sympatico.ca wrote: >OK > >Works like it is supposed to... > >Is this a K6 CPU? K6-II 300Mhz. From what I read on the net even older Athlons (pre XP) don't have FXSAVE and quite possibly new chips from other manufactures, eg tranmeta. Dave **= Email 16 ==========================** Date: Tue, 18 Jan 2005 21:25:52 -0800 From: "Dave Yeo" Subject: Re: Program to demonstrate fork DLL load errors On Tue, 18 Jan 2005 18:33:16 -0500, lsunley at mb.sympatico.ca wrote: >EXPORTS > ; segment TEXT32 > "_test_func" ; magicseg='TEXT32' len=10 What is this magicseg= etc? I haven't really came across it except here and some of Knuts ports. Also is there a good source to read up on DEF files. I'm sure I was reading an INF file on DEFs but can no longer find it. Unluckily the only OS/2 specific programming book I have here is OS/2 WARP PROGRAMMING FOR DUMMIES which actually isn't to bad, just short Dave **= Email 17 ==========================** Date: Tue, 18 Jan 2005 23:35:50 -0500 From: lsunley at mb.sympatico.ca Subject: Re: Program to demonstrate fork DLL load errors In <20050119052526.D9E1CBDE54 at generation.lgisp.net>, on 01/18/05 at 09:25 PM, "Dave Yeo" said: >On Tue, 18 Jan 2005 18:33:16 -0500, lsunley at mb.sympatico.ca wrote: >>EXPORTS >> ; segment TEXT32 >> "_test_func" ; magicseg='TEXT32' len=10 >What is this magicseg= etc? I haven't really came across it except here >and some of Knuts ports. Also is there a good source to read up on DEF >files. I'm sure I was reading an INF file on DEFs but can no longer find >it. Unluckily the only OS/2 specific programming book I have here is >OS/2 WARP PROGRAMMING FOR DUMMIES which actually isn't to bad, just >short >Dave It is a comment inserted in the output from the emxexp program. That program creates an export list from the object modules. Anything after a ";" in a .def file is a comment. Lorne -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 18 ==========================** Date: Wed, 19 Jan 2005 08:01:58 +0100 From: "Knut St. Osmundsen" Subject: Re: Program to demonstrate fork DLL load errors Dave Yeo wrote: > On Tue, 18 Jan 2005 18:33:16 -0500, lsunley at mb.sympatico.ca wrote: > > >> EXPORTS ; segment TEXT32 "_test_func" >> ; magicseg='TEXT32' len=10 > > > What is this magicseg= etc? I haven't really came across it except > here and some of Knuts ports. emxexp put's out those comments. The idea was to have emximp use them for lazy imports, but that's just an idea. > Also is there a good source to read up on DEF files. I'm sure I was > reading an INF file on DEFs but can no longer find it. Unluckily the > only OS/2 specific programming book I have here is OS/2 WARP > PROGRAMMING FOR DUMMIES which actually isn't to bad, just short Os/2 .def file reference is found in the toolkit book, toolsref.inf IIRC. VAC308 and VAC365 also include descriptions in their documentations. Kind Regards, knut **= Email 19 ==========================** Date: Tue, 18 Jan 2005 23:10:35 -0800 From: "Steven Levine" Subject: Re: sed script to initialise variables In <20050118140358.A18360 at warpix.org>, on 01/18/05 at 02:03 PM, John Poltorak said: >T=1105916623 >D=dfXAA077.87 >sed ' > 1d > 2s/^T/T=/ > 3s/^D/D=/ > 4d > 5q >' myfile > tmp-file >. tmp-file T=`sed -n '2p MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 20 ==========================** Date: Tue, 18 Jan 2005 23:22:54 -0800 From: "Steven Levine" Subject: Re: Bridge software In <200501190334.j0J3YdAE015579 at fingers.shocking.com>, on 01/17/05 at 11:29 PM, "Steve Wendt" said: >>Oh I finally understand your point. I was a bit slow on the uptake. This >>is true, but I see it as an interim problem. There's not much that can be >>done about it while the kernels are undergoing rapid development. >But it will *always* be in that state. I prefer to believe that backwards compatibility will become more important over time. Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 21 ==========================** Date: Wed, 19 Jan 2005 10:21:05 +0000 From: John Poltorak Subject: Re: sed script to initialise variables On Tue, Jan 18, 2005 at 11:10:35PM -0800, Steven Levine wrote: > In <20050118140358.A18360 at warpix.org>, on 01/18/05 > at 02:03 PM, John Poltorak said: > > > >T=1105916623 > >D=dfXAA077.87 > > >sed ' > > 1d > > 2s/^T/T=/ > > 3s/^D/D=/ > > 4d > > 5q > >' myfile > tmp-file > >. tmp-file > > T=`sed -n '2p D=`sed -n '3p HTH, > > Steven > > -- > ---------------------------------------------------------------------- > "Steven Levine" MR2/ICE 2.60b #10183 Warp4/FP15/14.100c_W4 > www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) > ---------------------------------------------------------------------- > -- John **= Email 22 ==========================** Date: Wed, 19 Jan 2005 11:53:13 +0000 From: John Poltorak Subject: Zope 2.7.4 Just thought I'd mention that I've managed to build Zope v2.7.4 on OS/2 using Python v2.4. Not managed to do anything with it yet apart from build it and start it up. -- John **= Email 23 ==========================** Date: Wed, 19 Jan 2005 19:25:56 +1000 From: Andrew MacIntyre Subject: Re: AssertionError John Poltorak wrote: > What is an AssertionError and how do I get rid of it? The same thing as a C assert() that fails. > It occurs when I start mailmanctl part of the Python based mailing > list manager, Mailman, and it outputs this error:- > > > Traceback (most recent call last): > File "mailmanctl", line 547, in ? > main() > File "mailmanctl", line 402, in main > lock._transfer_to(pid) > File "/usr/local/mailman/Mailman/LockFile.py", line 398, in _transfer_to > assert self.__linkcount() == 2 > AssertionError > > > What is this trying to do? I gather it is some sort of Unixism > associated with symbolic links which doesn't translate to OS/2. > > Can I just comment it out? I remember this problem. I don't recall whether commenting out that line got it all working, but it needs to be commented out anyway as EMX's stat() always returns 1 for link count (due to there being no hard link emulation; link count doesn't mean anything with symbolic links). ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 andymac at pcug.org.au (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia **= Email 24 ==========================** Date: Wed, 19 Jan 2005 19:32:21 +1000 From: Andrew MacIntyre Subject: Re: Python v2.4 John Poltorak wrote: > What about this one for MailList.py:- ? > > --- mailman-2.1.5/Mailman/MailList.py~ Thu Mar 4 14:10:28 2004 > +++ mailman-2.1.5/Mailman/MailList.py Sun Jan 16 20:50:08 2005 > at at -242,12 +242,19 at at > # timestamp is newer than the modtime of the config.pck file, we don't > # need to reload, otherwise... we do. > self.__timestamp = 0 > - self.__lock = LockFile.LockFile( > - os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', > - # TBD: is this a good choice of lifetime? > - lifetime = mm_cfg.LIST_LOCK_LIFETIME, > - withlogging = mm_cfg.LIST_LOCK_DEBUGGING) > - self._internal_name = name > + if os.name in ('os2',): > + self.__lock = LockFile.LockFile( > + os.path.join(mm_cfg.LOCK_DIR, name or '=site=') + '.lock', > + # TBD: is this a good choice of lifetime? > + lifetime = mm_cfg.LIST_LOCK_LIFETIME, > + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) > + else: > + self.__lock = LockFile.LockFile( > + os.path.join(mm_cfg.LOCK_DIR, name or '') + '.lock', > + # TBD: is this a good choice of lifetime? > + lifetime = mm_cfg.LIST_LOCK_LIFETIME, > + withlogging = mm_cfg.LIST_LOCK_DEBUGGING) > + self._internal_name = name > if name: > self._full_path = Site.get_listpath(name) > else: > at at -502,6 +509,8 at at > os.link(fname, fname_last) > except OSError, e: > if e.errno <> errno.ENOENT: raise > + if os.name == 'os2' and os.access(fname, os.F_OK): > + os.unlink(fname) > os.rename(fname_tmp, fname) > # Reset the timestamp > self.__timestamp = os.path.getmtime(fname) > Yes, this one is still needed too because the "<" and ">" chars can't be used in OS/2 file names. >>It wasn't supposed to be needed with my binary 2.3.4 distribution >>either, but I've just noticed that I forgot the change to Lib/os.py that >>is in 2.4 which meant the above patch is still required... :-( I'll try >>and make sure that this is done properly in the 2.3.5 binary >>distribution (2.3.5 is a bug-fix wrap-up release of the 2.3 branch, >>expected to appear next week). > > > Is this the section you mean:- ? > > elif 'os2' in _names: > name = 'os2' > linesep = '\r\n' > from os2 import * > try: > from os2 import _exit > except ImportError: > pass > if sys.version.find('EMX GCC') == -1: > import ntpath as path > else: > import os2emxpath as path > from _emx_link import link > > import os2 > __all__.extend(_get_exports_list(os2)) > del os2 > > You have _emx_link in there... In the 2.4 release, but not in the 2.3.4 distribution packages :-( (at least not those in my archive...) ------------------------------------------------------------------------- Andrew I MacIntyre "These thoughts are mine alone..." E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370 andymac at pcug.org.au (alt) | Belconnen ACT 2616 Web: http://www.andymac.org/ | Australia **= Email 25 ==========================** Date: Wed, 19 Jan 2005 13:44:55 +0100 From: "Knut St. Osmundsen" Subject: Re: AssertionError Andrew MacIntyre wrote: > John Poltorak wrote: > >> What is an AssertionError and how do I get rid of it? > > > The same thing as a C assert() that fails. > >> It occurs when I start mailmanctl part of the Python based mailing >> list manager, Mailman, and it outputs this error:- >> >> >> Traceback (most recent call last): >> File "mailmanctl", line 547, in ? >> main() >> File "mailmanctl", line 402, in main >> lock._transfer_to(pid) >> File "/usr/local/mailman/Mailman/LockFile.py", line 398, in >> _transfer_to >> assert self.__linkcount() == 2 >> AssertionError >> >> >> What is this trying to do? I gather it is some sort of Unixism >> associated with symbolic links which doesn't translate to OS/2. >> >> Can I just comment it out? > > > I remember this problem. > > I don't recall whether commenting out that line got it all working, but > it needs to be commented out anyway as EMX's stat() always returns 1 for > link count (due to there being no hard link emulation; link count > doesn't mean anything with symbolic links). http://cvs.sourceforge.net/viewcvs.py/mailman/mailman3/src/mailman/lockfile.py?rev=3.0&view=markup [snip] # Create a hard link from the global lock file to the temp file. This # actually does things in reverse order of normal operation because we # know that lockfile exists, and tmpfname better not! os.link(self._lockfile, self._tmpfname) [..] # And do some sanity checks assert self._linkcount() == 2 assert self.locked() [snip] That os.link call fails on OS/2, because we don't have hardlinks. Probably that function needs a bit of recoding to work properly on OS/2. Kind Regards, knut