Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2138af

Browse files
author
Andrew MacIntyre
committed
- add notes about os.link() emulation;
- various minor cleanups and updates.
1 parent 51578ae commit c2138af

1 file changed

Lines changed: 87 additions & 82 deletions

File tree

PC/os2emx/README.os2emx

Lines changed: 87 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,20 @@
1-
This is a port of Python 2.3 to OS/2 using the EMX development tools
1+
This is a port of Python 2.4 to OS/2 using the EMX development tools
22
=========================================================================
33

44
What's new since the previous release
55
-------------------------------------
66

7-
This release of the port incorporates the following changes from the
8-
October 24, 2002 release of the Python 2.2.2 port:
9-
10-
- based on the Python v2.3 final release source.
11-
- now setting higher number of file handles (250).
12-
- defaults to building with PyMalloc enabled (Python 2.3 default).
13-
- the port is now maintained in the Python CVS repository.
14-
- most standard modules are now built into the core Python DLL.
15-
16-
Python 2.3 incorporates several changes which have resolved the
17-
longstanding problems the EMX port has had with test_longexp.
18-
19-
Python 2.3 introduces changes to the Berkeley DB support, as a result of
20-
the PyBSDDB3 module (for the Sleepycat DB 3.3.x/4.0.x/4.1.x library)
21-
being imported into Python's standard library - see "YOU HAVE BEEN WARNED"
22-
items 4 & 5 for more information.
7+
Another day, another version...
238

249

2510
Licenses and info about Python and EMX
2611
--------------------------------------
2712

28-
Please read the file README.Python-2.3 included in this package for
29-
information about Python 2.3. This file is the README file from the
30-
Python 2.3 source distribution available via http://www.python.org/
31-
and its mirrors. The file LICENCE.Python-2.3 is the text of the Licence
32-
from the Python 2.3 source distribution.
13+
Please read the file README.Python-2.4 included in this package for
14+
information about Python 2.4. This file is the README file from the
15+
Python 2.4 source distribution available via http://www.python.org/
16+
and its mirrors. The file LICENCE.Python-2.4 is the text of the Licence
17+
from the Python 2.4 source distribution.
3318

3419
Note that the EMX package that this package depends on is released under
3520
the GNU General Public Licence. Please refer to the documentation
@@ -61,7 +46,7 @@ There have been ports of previous versions of Python to OS/2.
6146

6247
The best known would be that by Jeff Rush, most recently of version
6348
1.5.2. Jeff used IBM's Visual Age C++ (v3) for his ports, and his
64-
patches have been included in the Python 2.3 source distribution.
49+
patches have been included in the Python 2.4 source distribution.
6550

6651
Andy Zabolotny implemented a port of Python v1.5.2 using the EMX
6752
development tools. His patches against the Python v1.5.2 source
@@ -71,25 +56,6 @@ compiled with his port of gcc 2.95.2 to EMX, which I have but have
7156
chosen not to use for the binary distribution of this port (see item 16
7257
of the "YOU HAVE BEEN WARNED" section below).
7358

74-
Previous Python port releases by me:-
75-
- v2.0 on March 31, 2001;
76-
- v2.0 on April 25, 2001 (cleanup release + Stackless variant);
77-
- v2.1 on June 17, 2001;
78-
- v2.0 (Stackless re-release) on June 18, 2001.
79-
- v2.1.1 on August 5, 2001;
80-
- v2.1.1 on August 12, 2001 (cleanup release);
81-
- v2.1.1 (updated DLL) on August 14, 2001;
82-
- v2.2b2 on December 8, 2001 (not uploaded to archive sites);
83-
- v2.2c1 on December 16, 2001 (not uploaded to archive sites);
84-
- v2.2 on December 24, 2001;
85-
- v2.2.1c2 on March 31, 2002 (not uploaded to archive sites);
86-
- v2.2.1 on April 14, 2002;
87-
- v2.2.2 on October 24, 2002;
88-
- v2.3a2 on March 2, 2003 (not uploaded to archive sites);
89-
- v2.3b1 on April 27, 2003 (not uploaded to archive sites);
90-
- v2.2.3c1 on May 28, 2003 (not uploaded to archive sites);
91-
- v2.2.3 on June 1, 2003.
92-
9359
It is possible to have these earlier ports still usable after installing
9460
this port - see the README.os2emx.multiple_versions file, contributed by
9561
Dr David Mertz, for a suggested approach to achieving this.
@@ -127,7 +93,7 @@ Python.exe is linked as an a.out executable, ie using EMX method E1
12793
to compile & link the executable. This is so that fork() works (see
12894
"YOU HAVE BEEN WARNED" item 1).
12995

130-
Python23.dll is created as a normal OMF DLL, with an OMF import
96+
Python24.dll is created as a normal OMF DLL, with an OMF import
13197
library and module definition file. There is also an a.out (.a) import
13298
library to support linking the DLL to a.out executables. The DLL
13399
requires the EMX runtime DLLs.
@@ -148,7 +114,7 @@ modules over to using the DistUtils.
148114
See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and
149115
"YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules.
150116

151-
Support for case sensitive module import semantics has been added to match
117+
This port supports case sensitive module import semantics, matching
152118
the Windows release. This can be deactivated by setting the PYTHONCASEOK
153119
environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED"
154120
item 12.
@@ -162,8 +128,8 @@ These include ncurses (_curses, _curses_panel), BSD DB (bsddb185),
162128
GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), GNU MP (mpz)
163129
and GNU UFC (crypt).
164130

165-
Expat is now included in the Python release sourceball, and is always
166-
built.
131+
Expat is now included in the Python release sourceball, and the pyexpat
132+
module is always built.
167133

168134
I have built these modules statically linked against the 3rd party
169135
libraries. Unfortunately my attempts to use the dll version of GNU
@@ -183,7 +149,7 @@ WARNED" item 13.
183149

184150
Upstream source patches:
185151

186-
No updates to the Python 2.3 release have become available.
152+
No updates to the Python 2.4 release have become available.
187153

188154
Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes
189155
bug fixes for the BSD DB library. The bsddb module included in this
@@ -192,13 +158,13 @@ port incorporates these fixes.
192158
Library and other distributed Python code:
193159

194160
The Python standard library lives in the Lib directory. All the standard
195-
library code included with the Python 2.3 source distribution is included
161+
library code included with the Python 2.4 source distribution is included
196162
in the binary archive, with the exception of the dos-8x3 and tkinter
197163
subdirectories which have been omitted to reduce the size of the binary
198164
archive - the dos-8x3 components are unnecessary duplicates and Tkinter
199165
is not supported by this port (yet). All the plat-* subdirectories in the
200-
source distribution have also been omitted, and a plat-os2emx directory
201-
included.
166+
source distribution have also been omitted, except for the plat-os2emx
167+
subdirectory.
202168

203169
The Tools and Demo directories contain a collection of Python scripts.
204170
To reduce the size of the binary archive, the Demo/sgi, Demo/Tix,
@@ -207,7 +173,7 @@ omitted as not being supported by this port. The Misc directory has
207173
also been omitted.
208174

209175
All subdirectories omitted from the binary archive can be reconstituted
210-
from the Python 2.3 source distribution, if desired.
176+
from the Python 2.4 source distribution, if desired.
211177

212178
Support for building Python extensions:
213179

@@ -225,15 +191,15 @@ Packaging
225191
---------
226192

227193
This port is packaged as follows:
228-
- python-2.3-os2emx-bin-03????.zip (binaries, library modules)
229-
- python-2.3-os2emx-src-03???? (patches+makefiles for non-Python code)
194+
- python-2.4-os2emx-bin-03????.zip (binaries, library modules)
195+
- python-2.4-os2emx-src-03???? (patches+makefiles for non-Python code)
230196

231197
As all the Python specific patches for the port are now part of the
232198
Python release tarball, only the patches and makefiles involved in
233199
building external libraries for optional extensions are included in
234200
the source archive.
235201

236-
Documentation for the Python language, as well as the Python 2.3
202+
Documentation for the Python language, as well as the Python 2.4
237203
source distibution, can be obtained from the Python website
238204
(http://www.python.org/) or the Python project pages at Sourceforge
239205
(http://sf.net/projects/python/).
@@ -248,7 +214,7 @@ package.
248214
Unpack this archive, preserving the subdirectories, in the root directory
249215
of the drive where you want Python to live.
250216

251-
Add the Python directory (eg C:\Python23) to the PATH and LIBPATH
217+
Add the Python directory (eg C:\Python24) to the PATH and LIBPATH
252218
variables in CONFIG.SYS.
253219

254220
You should then set the PYTHONHOME and PYTHONPATH environment variables
@@ -258,9 +224,9 @@ PYTHONHOME should be set to Python's top level directory. PYTHONPATH
258224
should be set to the semicolon separated list of principal Python library
259225
directories.
260226
I use:
261-
SET PYTHONHOME=F:/Python23
262-
SET PYTHONPATH=F:/Python23/Lib;F:/Python23/Lib/plat-os2emx;
263-
F:/Python23/Lib/lib-dynload;F:/Python23/Lib/site-packages
227+
SET PYTHONHOME=F:/Python24
228+
SET PYTHONPATH=F:/Python24/Lib;F:/Python24/Lib/plat-os2emx;
229+
F:/Python24/Lib/lib-dynload;F:/Python24/Lib/site-packages
264230

265231
NOTE!: the PYTHONPATH setting above is linewrapped for this document - it
266232
should all be on one line in CONFIG.SYS!
@@ -273,7 +239,7 @@ EMX subset of the Terminfo database included with the ncurses-5.2 source
273239
distribution. This can be used by setting the TERMINFO environment variable
274240
to the path of the Terminfo subdirectory below the Python home directory.
275241
On my system this looks like:
276-
SET TERMINFO=F:/Python23/Terminfo
242+
SET TERMINFO=F:/Python24/Terminfo
277243

278244
For the TERM environment variable, I would try one of the following:
279245
SET TERM=ansi
@@ -287,17 +253,14 @@ If you wish to compile all the included Python library modules to bytecode,
287253
you can change into the Python home directory and run the COMPILEALL.CMD
288254
batch file.
289255

290-
You can execute the regression tests included with the Python 2.3 source
291-
distribution by changing to the Python 2.3 home directory and executing the
256+
You can execute the regression tests included with the Python 2.4 source
257+
distribution by changing to the Python 2.4 home directory and executing the
292258
REGRTEST.CMD batch file. The following tests are known to fail at this
293259
time:
294260
- test_mhlib (I don't know of any port of MH to OS/2);
295-
- test_pwd (see "YOU HAVE BEEN WARNED" item 10);
296-
- test_grp (as per test_pwd);
297-
- test_strftime (see "YOU HAVE BEEN WARNED" item 15);
298261
- test_strptime (see "YOU HAVE BEEN WARNED" item 22);
299-
- test_whichdb (see "YOU HAVE BEEN WARNED" item 5).
300-
- test_socketserver (fork() related, see "YOU HAVE BEEN WARNED" item 1).
262+
- test_time (see "YOU HAVE BEEN WARNED" item 22);
263+
- test_posixpath (see "YOU HAVE BEEN WARNED" item 23).
301264

302265
Note that some of the network related tests expect the loopback interface
303266
(interface "lo", with IP address 127.0.0.1) to be enabled, which from my
@@ -326,6 +289,7 @@ Other items of software required:-
326289
- GNU make (I'm using v3.76.1)
327290
- rm, cp, mkdir from the GNU file utilities package
328291
- GNU find
292+
- GNU sed
329293

330294
Procedure
331295

@@ -336,7 +300,7 @@ Procedure
336300
1. decide if you need to change the location of the Python installation.
337301
If you wish to do this, set the value of the Makefile variable LIB_DIR
338302
to the directory you wish to use for PYTHONHOME
339-
(eg /usr/local/lib/python2.3).
303+
(eg /usr/local/lib/python2.4).
340304

341305
If you want Python to find its library without the PYTHONHOME
342306
environment variable set, set the value of the Makefile variable
@@ -346,7 +310,7 @@ Procedure
346310
to be installed in a directory other than the PYTHONHOME directory, set
347311
the value of the Makefile variable EXE_DIR to the appropriate directory.
348312

349-
3. If you wish the Python core DLL (python23.dll) to be installed in a
313+
3. If you wish the Python core DLL (python24.dll) to be installed in a
350314
directory other than the directory in which the Python executables are
351315
installed (by default, the PYTHONHOME directory), set the value of the
352316
Makefile variable DLL_DIR to the appropriate directory. This DLL must
@@ -445,18 +409,15 @@ licenses which would rule out GDBM (and the dbm module because it is
445409
linked against the GDBM library) or need it for file format compatibility,
446410
you may be better off deleting it and relying on GDBM.
447411

448-
Any code you have which uses the bsddb module can be modified to use the
449-
renamed module by changing
412+
Any code you have which uses the v1.85 bsddb module can be modified to
413+
use the renamed module by changing
450414

451415
import bsddb
452416

453417
to
454418

455419
import bsddb185 as bsddb
456420

457-
A side effect of these changes is that the test_whichdb regression test
458-
fails.
459-
460421
6. The readline module has been linked against ncurses rather than the
461422
termcap library supplied with EMX.
462423

@@ -521,16 +482,22 @@ out what is supported.
521482
case insensitive but case preserving file/operating systems (Windows etc),
522483
have been incorporated into this port, and are active by default. Setting
523484
the PYTHONCASEOK environment variable (to any value) reverts to the
524-
previous (case insensitive) semantics.
485+
previous (case insensitive) semantics. This can be an issue with some
486+
file management utilities that do not preserve the case of file and
487+
directory names.
525488

526489
13. Because I am statically linking ncurses, the _curses_panel
527490
module has potential problems arising from separate library data areas.
528491
To avoid this, I have configured the _curses_.pyd (imported as
529-
"_curses_panel") to import the ncurses symbols it needs from _curses.pyd.
530-
As a result the _curses module must be imported before the _curses_panel
531-
module. As far as I can tell, the modules in the curses package do this.
532-
If you have problems attempting to use the _curses_panel support please
533-
let me know, and I'll look into an alternative solution.
492+
"_curses_panel") to import the ncurses symbols it needs from _curses.dll
493+
(which is the curses module, but with a .dll extension rather than .pyd
494+
so that the dynamic loader can actually import the symbols from it as a
495+
DLL).
496+
497+
The site module (Lib/site.py) has code added to tweak BEGINLIBPATH so
498+
that _curses.dll is found when _curses_panel is imported. If you have
499+
problems attempting to use the _curses_panel support please let me know,
500+
and I'll have another look at this.
534501

535502
14. sys.platform reports "os2emx" instead of "os2". os.name still
536503
reports "os2". This change was to make it easier to distinguish between
@@ -555,8 +522,8 @@ I have not attempted to compile Python with any version of gcc prior to
555522
v2.8.1.
556523

557524
This release sees the default optimisation change to
558-
"-O3 -fomit-frame-pointer". This works fine too for pgcc 2.95 but not
559-
for gcc 3.2.1.
525+
"-O3 -fomit-frame-pointer -mprobe". This works fine too for pgcc 2.95
526+
but not for gcc 3.2.1.
560527

561528
With gcc 3.2.1, -O3 causes 2 unexpected test failures: test_format and
562529
test_unicode. Both these tests pass if -O2 is instead of -O3 with this
@@ -636,6 +603,44 @@ library, superceding a platform specific extension module. This module
636603
leverages the strftime module, and as a result test_strptime fails
637604
due to the EMX strftime bug in item 20 above.
638605

606+
23. test_posixpath attempts to exercise various Posix path related
607+
functionality. Most of the sub-tests pass, but the "ismount" and
608+
"samestat" subtests fail:
609+
- EMX provides not satisfactory mount point emulation, so "ismount"
610+
cannot succeed;
611+
- EMX documents that successive stat() calls will produce different
612+
results, so "samestat" cannot succeed.
613+
614+
test_posixpath should skip these tests on EMX.
615+
616+
24. I have had a report that attempting to use the Bittorrent package
617+
(http://bitconjurer.org/BitTorrent/) with this port causes traps not
618+
long after starting the download; this using the "headless" download
619+
script on eCS v1.1. I have not been able to duplicate this myself,
620+
but the indications I have suggest a failure in the 32 bit TCP/IP
621+
stack (v4.3.2? on eCS v1.1) - on my v4.0 FP12 system with MPTS fixpack
622+
WR8425 applied (16 bit TCP/IP stack v4.02), BitTorrent appears to work
623+
normally in testing on a 100Mbit LAN. With the curses.panel fix (see
624+
item 13 above), the BitTorrent curses downloader works too. I'd
625+
appreciate any success or failure reports with BitTorrent, though
626+
I've regretfully recommended that the person who reported the failure
627+
take this up with eCS support. Since this report, I have received a
628+
followup which suggests that the problem may have been a buggy network
629+
card driver. I think it suffices to say that BitTorrent is a fair stress
630+
test of a system's networking capability.
631+
632+
25. In the absence of an EMX implementation of the link() function, I've
633+
implemented a crude Python emulation, in the file
634+
Lib/plat-os2emx/_emx_link.py. This is imported into the os module, and
635+
becomes available as os.link() in the normal way.
636+
637+
The emulation copies the source file in binary mode, and will fail if
638+
disk space is exhausted. The call fails if the target already exists.
639+
There are no guarantees to thread safety with this emulation - beware!
640+
641+
The emulation was written to support a link() based file locking system
642+
used in GNU Mailman.
643+
639644
... probably other issues that I've not encountered, or don't remember :-(
640645

641646
If you encounter other difficulties with this port, which can be
@@ -675,4 +680,4 @@ Andrew MacIntyre
675680
676681
Web: http://www.andymac.org/
677682

678-
18 April, 2003.
683+
2 December, 2003.

0 commit comments

Comments
 (0)