blob: fefd021959862acf12fe2a89f4a00a1e715f9f86 [file] [log] [blame]
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00001This is a port of Python 2.3 to OS/2 using the EMX development tools
2=========================================================================
3
4What's new since the previous release
5-------------------------------------
6
7This release of the port incorporates the following changes from the
Andrew MacIntyre7e5bf672002-12-04 12:40:49 +00008October 24, 2002 release of the Python 2.2.2 port:
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00009
10- based on the Python v2.3 final release source.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +000011- 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.
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000014- most standard modules are now built into the core Python DLL.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +000015
16Python 2.3 incorporates several changes which have resolved the
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000017longstanding problems the EMX port has had with test_longexp.
18
19Python 2.3 introduces changes to the Berkeley DB support, as a result of
20the PyBSDDB3 module (for the Sleepycat DB 3.3.x/4.0.x/4.1.x library)
21being imported into Python's standard library - see "YOU HAVE BEEN WARNED"
22items 4 & 5 for more information.
23
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000024
25Licenses and info about Python and EMX
26--------------------------------------
27
28Please read the file README.Python-2.3 included in this package for
29information about Python 2.3. This file is the README file from the
30Python 2.3 source distribution available via http://www.python.org/
31and its mirrors. The file LICENCE.Python-2.3 is the text of the Licence
32from the Python 2.3 source distribution.
33
34Note that the EMX package that this package depends on is released under
35the GNU General Public Licence. Please refer to the documentation
36accompanying the EMX Runtime libraries for more information about the
37implications of this. A copy of version 2 of the GPL is included as the
38file COPYING.gpl2.
39
40Readline and GDBM are covered by the GNU General Public Licence. I think
41Eberhard Mattes' porting changes to BSD DB v1.85 are also GPL'ed (BSD DB
42itself is BSD Licenced). ncurses and expat appear to be covered by MIT
43style licences - please refer to the source distributions for more detail.
44zlib is distributable under a very free license. GNU MP and GNU UFC are
45under the GNU LGPL (see file COPYING.lib).
46
47My patches to the Python-2.x source distributions, and any other packages
48used in this port, are placed in the public domain.
49
50This software is provided 'as-is', without any express or implied warranty.
51In no event will the author be held liable for any damages arising from the
52use of the software.
53
54I do hope however that it proves useful to someone.
55
56
57Other ports
58-----------
59
60There have been ports of previous versions of Python to OS/2.
61
62The best known would be that by Jeff Rush, most recently of version
631.5.2. Jeff used IBM's Visual Age C++ (v3) for his ports, and his
64patches have been included in the Python 2.3 source distribution.
65
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000066Andy Zabolotny implemented a port of Python v1.5.2 using the EMX
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000067development tools. His patches against the Python v1.5.2 source
68distribution have become the core of this port, and without his efforts
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000069this port wouldn't exist. Andy's port also appears to have been
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000070compiled with his port of gcc 2.95.2 to EMX, which I have but have
71chosen not to use for the binary distribution of this port (see item 21
72of the "YOU HAVE BEEN WARNED" section below).
73
74Previous 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);
Andrew MacIntyreffcf8992002-08-18 06:28:21 +000081 - 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);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000086 - v2.2.1 on April 14, 2002;
Andrew MacIntyre7e5bf672002-12-04 12:40:49 +000087 - v2.2.2 on October 24, 2002.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000088
89It is possible to have these earlier ports still usable after installing
90this port - see the README.os2emx.multiple_versions file, contributed by
91Dr David Mertz, for a suggested approach to achieving this.
92
93
94Software requirements
95---------------------
96
97This package requires the EMX Runtime package, available from the
98Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/)
99archives of OS/2 software. I have used EMX version 0.9d fix04 in
100developing this port.
101
102My development system is running OS/2 v4 with fixpack 12.
103
1043rd party software which has been linked into dynamically loaded modules:
105- ncurses (see http://dickey.his.com/ for more info, v5.2)
106- GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1)
107- GNU GDBM (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000108- zlib (derived from Hung-Chi Chu's port of v1.1.3, v1.1.4)
109- expat (distributed with Python, v1.95.6)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000110- GNU MP (Peter Meerwald's port available from LEO, v2.0.2)
111- GNU UFC (Kai Uwe Rommel's port available from LEO, v2.0.4)
112
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000113
114About this port
115---------------
116
117I have attempted to make this port as complete and functional as I can,
118notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below.
119
120Core components:
121
122Python.exe is linked as an a.out executable, ie using EMX method E1
123to compile & link the executable. This is so that fork() works (see
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000124"YOU HAVE BEEN WARNED" item 1).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000125
126Python23.dll is created as a normal OMF DLL, with an OMF import
127library and module definition file. There is also an a.out (.a) import
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000128library to support linking the DLL to a.out executables. The DLL
129requires the EMX runtime DLLs.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000130
131This port has been built with complete support for multithreading.
132
133Modules:
134
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000135With the exception of modules that have a significant code size, or are
136not recommended or desired for normal use, the standard modules are now
137built into the core DLL rather than configured as dynamically loadable
138modules. This is for both reasons of performance (startup time) and
139memory use (lots of small DLLs fragment the address space).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000140
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000141I haven't yet changed the building of Python's dynamically loadable
142modules over to using the DistUtils.
143
144See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and
145"YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000146
147Support for case sensitive module import semantics has been added to match
148the Windows release. This can be deactivated by setting the PYTHONCASEOK
149environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED"
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000150item 12.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000151
152Optional modules:
153
154Where I've been able to locate the required 3rd party packages already
155ported to OS/2, I've built and included them.
156
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000157These include ncurses (_curses, _curses_panel), BSD DB (bsddb185),
158GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), GNU MP (mpz)
159and GNU UFC (crypt).
160
161Expat is now included in the Python release sourceball, and is always
162built.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000163
164I have built these modules statically linked against the 3rd party
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000165libraries. Unfortunately my attempts to use the dll version of GNU
166readline have been a dismal failure, in that when the dynamically
167linked readline module is active other modules immediately provoke a
168core dump when imported.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000169
170Only the BSD DB package (part of the BSD package distributed with EMX)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000171needs source modifications to be used for this port, pertaining to use
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000172of errno with multithreading.
173
174The other packages, except for ncurses and zlib, needed Makefile changes
175for multithreading support but no source changes.
176
177The _curses_panel module is a potential problem - see "YOU HAVE BEEN
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000178WARNED" item 13.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000179
180Upstream source patches:
181
182No updates to the Python 2.3 release have become available.
183
184Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes
185bug fixes for the BSD DB library. The bsddb module included in this
186port incorporates these fixes.
187
188Library and other distributed Python code:
189
190The Python standard library lives in the Lib directory. All the standard
191library code included with the Python 2.3 source distribution is included
192in the binary archive, with the exception of the dos-8x3 and tkinter
193subdirectories which have been omitted to reduce the size of the binary
194archive - the dos-8x3 components are unnecessary duplicates and Tkinter
195is not supported by this port (yet). All the plat-* subdirectories in the
196source distribution have also been omitted, and a plat-os2emx directory
197included.
198
199The Tools and Demo directories contain a collection of Python scripts.
200To reduce the size of the binary archive, the Demo/sgi, Demo/Tix,
201Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been
202omitted as not being supported by this port. The Misc directory has
203also been omitted.
204
205All subdirectories omitted from the binary archive can be reconstituted
206from the Python 2.3 source distribution, if desired.
207
208Support for building Python extensions:
209
210The Config subdirectory contains the files describing the configuration
211of the interpreter and the Makefile, import libraries for the Python DLL,
212and the module definition file used to create the Python DLL. The
213Include subdirectory contains all the standard Python header files
214needed for building extensions.
215
216As I don't have the Visual Age C++ compiler, I've made no attempt to
217have this port support extensions built with that compiler.
218
219
220Packaging
221---------
222
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000223This port is packaged as follows:
224- python-2.3-os2emx-bin-03????.zip (binaries, library modules)
225- python-2.3-os2emx-src-03???? (patches+makefiles for non-Python code)
226
227As all the Python specific patches for the port are now part of the
228Python release tarball, only the patches and makefiles involved in
229building external libraries for optional extensions are included in
230the source archive.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000231
232Documentation for the Python language, as well as the Python 2.3
233source distibution, can be obtained from the Python website
234(http://www.python.org/) or the Python project pages at Sourceforge
235(http://sf.net/projects/python/).
236
237
238Installation
239------------
240
241Obtain and install, as per the included instructions, the EMX runtime
242package.
243
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000244Unpack this archive, preserving the subdirectories, in the root directory
245of the drive where you want Python to live.
246
247Add the Python directory (eg C:\Python23) to the PATH and LIBPATH
248variables in CONFIG.SYS.
249
250You should then set the PYTHONHOME and PYTHONPATH environment variables
251in CONFIG.SYS.
252
253PYTHONHOME should be set to Python's top level directory. PYTHONPATH
254should be set to the semicolon separated list of principal Python library
255directories.
256I use:
257 SET PYTHONHOME=F:/Python23
258 SET PYTHONPATH=F:/Python23/Lib;F:/Python23/Lib/plat-os2emx;
259 F:/Python23/Lib/lib-dynload;F:/Python23/Lib/site-packages
260
261NOTE!: the PYTHONPATH setting above is linewrapped for this document - it
262should all be on one line in CONFIG.SYS!
263
264If you wish to use the curses module, you should set the TERM and TERMINFO
265environment variables appropriately.
266
267If you don't already have ncurses installed, I have included a copy of the
268EMX subset of the Terminfo database included with the ncurses-5.2 source
269distribution. This can be used by setting the TERMINFO environment variable
270to the path of the Terminfo subdirectory below the Python home directory.
271On my system this looks like:
272 SET TERMINFO=F:/Python23/Terminfo
273
274For the TERM environment variable, I would try one of the following:
275 SET TERM=ansi
276 SET TERM=os2
277 SET TERM=window
278
279You will have to reboot your system for these changes to CONFIG.SYS to take
280effect.
281
282If you wish to compile all the included Python library modules to bytecode,
283you can change into the Python home directory and run the COMPILEALL.CMD
284batch file.
285
286You can execute the regression tests included with the Python 2.3 source
287distribution by changing to the Python 2.3 home directory and executing the
288REGRTEST.CMD batch file. The following tests are known to fail at this
289time:
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000290- test_mhlib (I don't know of any port of MH to OS/2);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000291- test_pwd (see "YOU HAVE BEEN WARNED" item 10, probably a bug in my code);
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000292- test_grp (as per test_pwd);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000293- test_strftime (see "YOU HAVE BEEN WARNED" item 15);
294- test_strptime (see "YOU HAVE BEEN WARNED" item 22);
295- test_whichdb (see "YOU HAVE BEEN WARNED" item 5).
296- test_socketserver (fork() related, see "YOU HAVE BEEN WARNED" item 1).
297
298Note that some of the network related tests expect the loopback interface
299(interface "lo", with IP address 127.0.0.1) to be enabled, which from my
300experience is not the default configuration. Additionally, test_popen2
301expects the "cat" utility (such as found in ports of the GNU tools) to
302be installed.
303
304
305Building from source
306--------------------
307
308With the EMX port now checked into Python's CVS repository, the build
309infrastructure is part of the Python release sourceball.
310
311Prerequisites
312
313First and foremost, you need an operational EMX development installation -
314EMX v0.9d with fix04 (the latest at time of writing) & the gcc 2.8.1
315compiler released by Eberhard Mattes is the recommended setup.
316
317If you have a different version of gcc installed, see "YOU HAVE BEEN
318WARNED" item 16.
319
320Other items of software required:-
321
322- GNU make (I'm using v3.76.1)
323- rm, cp, mkdir from the GNU file utilities package
324- GNU find
325
326Procedure
327
3280. all changes mentioned apply to files in the PC/os2emx subdirectory
329 of the Python release source tree. make is also executed from this
330 directory, so change into this directory before proceeding.
331
3321. decide if you need to change the location of the Python installation.
333 If you wish to do this, set the value of the Makefile variable LIB_DIR
334 to the directory you wish to use for PYTHONHOME
335 (eg /usr/local/lib/python2.3).
336
337 If you want Python to find its library without the PYTHONHOME
338 environment variable set, set the value of the Makefile variable
339 FIXED_PYHOME to "yes" (uncomment the appropriate line).
340
3412. If you wish the Python executables (python.exe, pythonpm.exe & pgen.exe)
342 to be installed in a directory other than the PYTHONHOME directory, set
343 the value of the Makefile variable EXE_DIR to the appropriate directory.
344
3453. If you wish the Python core DLL (python23.dll) to be installed in a
346 directory other than the directory in which the Python executables are
347 installed (by default, the PYTHONHOME directory), set the value of the
348 Makefile variable DLL_DIR to the appropriate directory. This DLL must
349 be placed in a directory on the system's LIBPATH, or that gets set
350 with BEGINLIBPATH or ENDLIBPATH.
351
3524. If you have installed any of the libraries that can be used to build
353 optional Python modules, set the value of the relevant HAVE_<package>
354 Makefile variable to "yes". The Makefile currently supports:
355
356 library Makefile variable
357 ........................................
358 zlib (1.1.4) HAVE_ZLIB
359 GNU UltraFast Crypt HAVE_UFC
360 Tcl/Tk HAVE_TCLTK (not known to work)
361 GNU MP HAVE_GMPZ
362 GNU Readline HAVE_GREADLINE
363 BSD DB (v1.85) HAVE_BSDDB
364 ncurses HAVE_NCURSES
365 GNU gdbm HAVE_GDBM
366 libbz2 HAVE_BZ2
367
368 Please note that you need to check that what you have installed
369 is compatible with Python's build options. In particular, the
370 BSD DB v1.85 library needs to be rebuilt with a source patch for
371 multithread support (doesn't change the library's reentrant status
372 but allows it to be linked to Python which is multithreaded).
373 Widely available binary packages of other librarys & DLLs are
374 not built/linked with multithread support. Beware!
375
376 Also note that the Makefile currently expects any libraries to be
377 found with the default library search path. You may need to add
378 -L switches to the LDFLAGS Makefile variable if you have installed
379 libraries in directories not in the default search path (which can
380 be controlled by the LIBRARY_PATH environment variable used by EMX).
381
3825. make
383
384 It is usually a good idea to redirect the stdout and stderr streams
385 of the make process to log files, so that you can review any messages.
386
3876. make test
388
389 This runs the Python regression tests, and completion is a sign of
390 a usable build. You should check the list of skipped modules to
391 ensure that any optional modules you selected have been built;
392 checking the list of failures against the list of known failures
393 elsewhere in this document is also prudent.
394
3957. make install
396 >>>>>> NOT YET COMPLETE <<<<<<
397
3988. change to a directory outside the Python source tree and start Python.
399 Check the version and build date to confirm satisfactory installation.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000400
401
402YOU HAVE BEEN WARNED!!
403----------------------
404
405I know about a number of nasties in this port.
406
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004071. Eberhard Mattes, author of EMX, writes in his documentation that fork()
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000408is very inefficient in the OS/2 environment. It also requires that the
409executable be linked in a.out format rather than OMF. Use the os.exec
410and/or the os.spawn family of functions where possible.
411
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004122. In the absence of GNU Readline, terminating the interpreter requires a
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000413control-Z (^Z) followed by a carriage return. Jeff Rush documented this
414problem in his Python 1.5.2 port. With Readline, a control-D (^D) works
415as per the standard Unix environment.
416
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004173. EMX only has a partial implementation of fcntl(). The fcntl module
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000418in this port supports what EMX supports. If fcntl is important to you,
419please review the EMX C Library Reference (included in .INF format in the
420EMXVIEW.ZIP archive as part of the complete EMX development tools suite).
421Because of other side-effects I have modified the test_fcntl.py test
422script to deactivate the exercising of the missing functionality.
423
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004244. the PyBSDDB3 module has been imported into the Python standard
425library, with the intent of superceding the BSDDB 1.85 module (bsddb).
426As I don't yet have a satisfactory port of Sleepcat's more recent DB
427library (3.3.x/4.0.x/4.1.x), I haven't included a binary of this
428module. I have left the Python part of the PyBSDDB package in this
429distribution for completeness.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000430
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004315. As a consequence of the PyBSDDB3 module being imported, the former
432BSD DB (bsddb) module, linked against the DB v1.85 library from EMX,
433has been renamed bsddb185. The bsddb185 module will not be built by
434default on most platforms, but in the absence of a PyBSDDB3 module I
435have retained it in the EMX port.
436
437Version 1.85 of the DB library is widely known to have bugs, although
438some patches have become available (and are incorporated into the
439included bsddb185 module). Unless you have problems with software
440licenses which would rule out GDBM (and the dbm module because it is
441linked against the GDBM library) or need it for file format compatibility,
442you may be better off deleting it and relying on GDBM.
443
444Any code you have which uses the bsddb module can be modified to use the
445renamed module by changing
446
447 import bsddb
448
449to
450
451 import bsddb185 as bsddb
452
453A side effect of these changes is that the test_whichdb regression test
454fails.
455
4566. The readline module has been linked against ncurses rather than the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000457termcap library supplied with EMX.
458
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004597. I have configured this port to use "/" as the preferred path separator
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000460character, rather than "\" ('\\'), in line with the convention supported
461by EMX. Backslashes are still supported of course, and still appear in
462unexpected places due to outside sources that don't get normalised.
463
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004648. While the DistUtils components are now functional, other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000465packaging/binary handling tools and utilities such as those included in
466the Demo and Tools directories - freeze in particular - are unlikely to
467work. If you do get them going, I'd like to know about your success.
468
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004699. I haven't set out to support the [BEGIN|END]LIBPATH functionality
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000470supported by one of the earlier ports (Rush's??). If it works let me know.
471
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000047210. As a result of the limitations imposed by EMX's library routines, the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000473standard extension module pwd only synthesises a simple passwd database,
474and the grp module cannot be supported at all.
475
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000476I have written pure Python substitutes for pwd and grp, which can process
477real passwd and group files for those applications (such as MailMan) that
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000478require more than EMX emulates. I have placed pwd.py and grp.py in
479Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains
480pwd.pyd) in the PYTHONPATH. If you have become attached to what pwd.pyd
481supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH
482or delete/rename pwd.py & grp.py.
483
484pwd.py & grp.py support locating their data files by looking in the
485environment for them in the following sequence:
486pwd.py: $ETC_PASSWD (%ETC_PASSWD%)
487 $ETC/passwd (%ETC%/passwd)
488 $PYTHONHOME/Etc/passwd (%PYTHONHOME%/Etc/passwd)
489grp.py: $ETC_GROUP (%ETC_GROUP%)
490 $ETC/group (%ETC%/group)
491 $PYTHONHOME/Etc/group (%PYTHONHOME%/Etc/group)
492
493Both modules support using either the ":" character (Unix standard) or
494";" (OS/2, DOS, Windows standard) field separator character, and pwd.py
495implements the following drive letter conversions for the home_directory and
496shell fields (for the ":" separator only):
497 $x -> x:
498 x; -> x:
499
500Example versions of passwd and group are in the Etc subdirectory. Note
501that as of this release, this code fails the regression test. I'm looking
502into why, and hope to have this fixed.
503
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000504Be aware that Python's pwd & group modules are for reading password and
505group information only.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000506
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000050711. EMX's termios routines don't support all of the functionality now
508exposed by the termios module - refer to the EMX documentation to find
509out what is supported.
510
51112. The case sensitive import semantics introduced in Python 2.1 for other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000512case insensitive but case preserving file/operating systems (Windows etc),
513have been incorporated into this port, and are active by default. Setting
514the PYTHONCASEOK environment variable (to any value) reverts to the
515previous (case insensitive) semantics.
516
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000051713. Because I am statically linking ncurses, the _curses_panel
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000518module has potential problems arising from separate library data areas.
519To avoid this, I have configured the _curses_.pyd (imported as
520"_curses_panel") to import the ncurses symbols it needs from _curses.pyd.
521As a result the _curses module must be imported before the _curses_panel
522module. As far as I can tell, the modules in the curses package do this.
523If you have problems attempting to use the _curses_panel support please
524let me know, and I'll look into an alternative solution.
525
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000052614. sys.platform reports "os2emx" instead of "os2". os.name still
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000527reports "os2". This change was to make it easier to distinguish between
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000528the VAC++ build (formerly maintained by Michael Muller) and the EMX build
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000529(this port), principally for DistUtils.
530
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053115. it appears that the %W substitution in the EMX strftime() routine has
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000532an off-by-one bug. strftime was listed as passing the regression tests
533in previous releases, but this fact appears to have been an oversight in
534the regression test suite. To fix this really requires a portable
535strftime routine - I'm looking into using one from FreeBSD, but its not
536ready yet.
537
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053816. I have successfully built this port with Andy Zabolotny's ports of
539pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1. To use the
540bsddb185 module with the gcc 3.2.1 build, I had to recompile the DB library
541with gcc 3.2.1 - I don't know why, but trying to import the module built
542against a DB library compiled with gcc 2.8.1 would result in a SYS3175
543error.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000544
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000545I have not attempted to compile Python with any version of gcc prior to
546v2.8.1.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000547
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000548If you compile Python with pgcc 2.95, changing the optimisation from -O2 to
549-O3 is worthwhile. While more aggressive optimisation is supported by gcc,
550a lot of benchmarking indicates that Python's performance is impeded by
551optimisation settings beyond just -O2 (-O3 for pgcc 2.95), at least on my
552hardware (AMD Athlon 1.4GHz, VIA C3 800MHz).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000553
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000554If you wish to compile Python with gcc 3.2.1, you will need to modify the
555Makefile to compile Modules/_sre.c with either the -Os (recommended) or
556-O options, with the global optimisation set to -O2 or -O3 (not much
557difference between these with this compiler). Alternatively, you could
558change the global optimisation instead with a performance drop of 6-7%
559compared to the special-case approach.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000560
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000056117. os.spawnv() and os.spawnve() expose EMX's library routines rather
562than use the emulation in os.py.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000563
564In order to make use of some of the features this makes available in
565the OS/2 environment, you should peruse the relevant EMX documentation
566(EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives
567on Hobbes or LEO). Be aware that I have exposed all the "mode" options
568supported by EMX, but there are combinations that either cannot be
569practically used by/in Python or have the potential to compromise your
570system's stability.
571
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000057218. pythonpm.exe used to be just python.exe with the WINDOWAPI linker
573option set in the pythonpm.def file. In practice, this turns out to do
574nothing useful.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000575
576I have written a replacement which wraps the Python DLL in a genuine
577Presentation Manager application. This version actually runs the
578Python interpreter in a separate thread from the PM shell, in order
579that PythonPM has a functioning message queue as good PM apps should.
580In its current state, PythonPM's window is hidden. It can be displayed,
581although it will have no content as nothing is ever written to the
582window. Only the "hide" button is available. Although the code
583has support for shutting PythonPM down when the Python interpreter is
584still busy (via the "control" menu), this is not well tested and given
585comments I've come across in EMX documentation suggesting that the
586thread killing operation has problems I would suggest caution in
587relying on this capability.
588
589PythonPM processes commandline parameters normally. The standard input,
590output and error streams are only useful if redirected, as PythonPM's
591window is not a console in any form and so cannot accept or display
592anything. This means that the -i option is ineffective.
593
594Because the Python thread doesn't create its own message queue, creating
595PM Windows and performing most PM operations is not possible from within
596this thread. How this will affect supporting PM extensions (such as
597Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of
598WxWindows) is still being researched.
599
600Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result
601of trying. os.spawnv() _does_ work. PythonPM passes all regression tests
602that the standard Python interpreter (python.exe) passes, with the exception
603of test_fork1 and test_socket which both attempt to use os.fork().
604
605I very much want feedback on the performance, behaviour and utility of
606PythonPM. I would like to add a PM console capability to it, but that
607will be a non-trivial effort. I may be able to leverage the code in
608Illya Vaes' Tcl/Tk port, which would make it easier.
609
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061019. os.chdir() uses EMX's _chdir2(), which supports changing both drive
611and directory at once. Similarly, os.getcwd() uses EMX's _getcwd()
612which returns drive as well as path.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000613
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061420. pyconfig.h is installed in the Include subdirectory with all
615other include files.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000616
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061721. the default build explicitly sets the number of file handles
618available to a Python process to 250. EMX default is 40, which is
619insufficient for the tempfile regression test (test_tempfile) which
620tries to create 100 temporary files.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000621
622This setting can be overridden via the EMXOPT environment variable:
623 set EMXOPT=-h250
624is equivalent to the setting currently used. The emxbind utility (if you
625have it installed) can also be used to permanently change the setting in
626python.exe - please refer to the EMX documentation for more information.
627
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000062822. a pure python strptime module is now part of the Python standard
629library, superceding a platform specific extension module. This module
630leverages the strftime module, and as a result test_strptime fails
631due to the EMX strftime bug in item 20 above.
632
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000633... probably other issues that I've not encountered, or don't remember :-(
634
635If you encounter other difficulties with this port, which can be
636characterised as peculiar to this port rather than to the Python release,
637I would like to hear about them. However I cannot promise to be able to do
638anything to resolve such problems. See the Contact section below...
639
640
641To do...
642--------
643
644In no particular order of apparent importance or likelihood...
645
646- support Tkinter and/or alternative GUI (wxWindows??)
647
648
649Credits
650-------
651
652In addition to people identified above, I'd like to thank:
653- the BDFL, Guido van Rossum, and crew for Python;
654- Dr David Mertz, for trying out a pre-release of this port;
655- the Python-list/comp.lang.python community;
656- John Poltorak, for input about pwd/grp.
657
658Contact
659-------
660
661Constructive feedback, negative or positive, about this port is welcome
662and should be addressed to me at the e-mail addresses below.
663
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000664I have a private mailing list for announcements of fixes & updates to
665this port. If you wish to receive such e-mail announcments, please send
666me an e-mail requesting that you be added to this list.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000667
668Andrew MacIntyre
669E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au
670Web: http://www.andymac.org/
671
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000067218 April, 2003.