blob: 3473faa481e1f6a054fddb5fff4196ae1b930a98 [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
Andrew MacIntyrefae89532003-06-09 08:15:14 +000071chosen not to use for the binary distribution of this port (see item 16
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000072of 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 MacIntyrefae89532003-06-09 08:15:14 +000087 - 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.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000092
93It is possible to have these earlier ports still usable after installing
94this port - see the README.os2emx.multiple_versions file, contributed by
95Dr David Mertz, for a suggested approach to achieving this.
96
97
98Software requirements
99---------------------
100
101This package requires the EMX Runtime package, available from the
102Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/)
103archives of OS/2 software. I have used EMX version 0.9d fix04 in
104developing this port.
105
106My development system is running OS/2 v4 with fixpack 12.
107
1083rd party software which has been linked into dynamically loaded modules:
109- ncurses (see http://dickey.his.com/ for more info, v5.2)
110- GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1)
111- GNU GDBM (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000112- zlib (derived from Hung-Chi Chu's port of v1.1.3, v1.1.4)
113- expat (distributed with Python, v1.95.6)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000114- GNU MP (Peter Meerwald's port available from LEO, v2.0.2)
115- GNU UFC (Kai Uwe Rommel's port available from LEO, v2.0.4)
116
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000117
118About this port
119---------------
120
121I have attempted to make this port as complete and functional as I can,
122notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below.
123
124Core components:
125
126Python.exe is linked as an a.out executable, ie using EMX method E1
127to compile & link the executable. This is so that fork() works (see
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000128"YOU HAVE BEEN WARNED" item 1).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000129
130Python23.dll is created as a normal OMF DLL, with an OMF import
131library and module definition file. There is also an a.out (.a) import
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000132library to support linking the DLL to a.out executables. The DLL
133requires the EMX runtime DLLs.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000134
135This port has been built with complete support for multithreading.
136
137Modules:
138
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000139With the exception of modules that have a significant code size, or are
140not recommended or desired for normal use, the standard modules are now
141built into the core DLL rather than configured as dynamically loadable
142modules. This is for both reasons of performance (startup time) and
143memory use (lots of small DLLs fragment the address space).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000144
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000145I haven't yet changed the building of Python's dynamically loadable
146modules over to using the DistUtils.
147
148See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and
149"YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000150
151Support for case sensitive module import semantics has been added to match
152the Windows release. This can be deactivated by setting the PYTHONCASEOK
153environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED"
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000154item 12.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000155
156Optional modules:
157
158Where I've been able to locate the required 3rd party packages already
159ported to OS/2, I've built and included them.
160
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000161These include ncurses (_curses, _curses_panel), BSD DB (bsddb185),
162GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), GNU MP (mpz)
163and GNU UFC (crypt).
164
165Expat is now included in the Python release sourceball, and is always
166built.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000167
168I have built these modules statically linked against the 3rd party
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000169libraries. Unfortunately my attempts to use the dll version of GNU
170readline have been a dismal failure, in that when the dynamically
171linked readline module is active other modules immediately provoke a
172core dump when imported.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000173
174Only the BSD DB package (part of the BSD package distributed with EMX)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000175needs source modifications to be used for this port, pertaining to use
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000176of errno with multithreading.
177
178The other packages, except for ncurses and zlib, needed Makefile changes
179for multithreading support but no source changes.
180
181The _curses_panel module is a potential problem - see "YOU HAVE BEEN
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000182WARNED" item 13.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000183
184Upstream source patches:
185
186No updates to the Python 2.3 release have become available.
187
188Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes
189bug fixes for the BSD DB library. The bsddb module included in this
190port incorporates these fixes.
191
192Library and other distributed Python code:
193
194The Python standard library lives in the Lib directory. All the standard
195library code included with the Python 2.3 source distribution is included
196in the binary archive, with the exception of the dos-8x3 and tkinter
197subdirectories which have been omitted to reduce the size of the binary
198archive - the dos-8x3 components are unnecessary duplicates and Tkinter
199is not supported by this port (yet). All the plat-* subdirectories in the
200source distribution have also been omitted, and a plat-os2emx directory
201included.
202
203The Tools and Demo directories contain a collection of Python scripts.
204To reduce the size of the binary archive, the Demo/sgi, Demo/Tix,
205Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been
206omitted as not being supported by this port. The Misc directory has
207also been omitted.
208
209All subdirectories omitted from the binary archive can be reconstituted
210from the Python 2.3 source distribution, if desired.
211
212Support for building Python extensions:
213
214The Config subdirectory contains the files describing the configuration
215of the interpreter and the Makefile, import libraries for the Python DLL,
216and the module definition file used to create the Python DLL. The
217Include subdirectory contains all the standard Python header files
218needed for building extensions.
219
220As I don't have the Visual Age C++ compiler, I've made no attempt to
221have this port support extensions built with that compiler.
222
223
224Packaging
225---------
226
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000227This 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)
230
231As all the Python specific patches for the port are now part of the
232Python release tarball, only the patches and makefiles involved in
233building external libraries for optional extensions are included in
234the source archive.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000235
236Documentation for the Python language, as well as the Python 2.3
237source distibution, can be obtained from the Python website
238(http://www.python.org/) or the Python project pages at Sourceforge
239(http://sf.net/projects/python/).
240
241
242Installation
243------------
244
245Obtain and install, as per the included instructions, the EMX runtime
246package.
247
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000248Unpack this archive, preserving the subdirectories, in the root directory
249of the drive where you want Python to live.
250
251Add the Python directory (eg C:\Python23) to the PATH and LIBPATH
252variables in CONFIG.SYS.
253
254You should then set the PYTHONHOME and PYTHONPATH environment variables
255in CONFIG.SYS.
256
257PYTHONHOME should be set to Python's top level directory. PYTHONPATH
258should be set to the semicolon separated list of principal Python library
259directories.
260I 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
264
265NOTE!: the PYTHONPATH setting above is linewrapped for this document - it
266should all be on one line in CONFIG.SYS!
267
268If you wish to use the curses module, you should set the TERM and TERMINFO
269environment variables appropriately.
270
271If you don't already have ncurses installed, I have included a copy of the
272EMX subset of the Terminfo database included with the ncurses-5.2 source
273distribution. This can be used by setting the TERMINFO environment variable
274to the path of the Terminfo subdirectory below the Python home directory.
275On my system this looks like:
276 SET TERMINFO=F:/Python23/Terminfo
277
278For the TERM environment variable, I would try one of the following:
279 SET TERM=ansi
280 SET TERM=os2
281 SET TERM=window
282
283You will have to reboot your system for these changes to CONFIG.SYS to take
284effect.
285
286If you wish to compile all the included Python library modules to bytecode,
287you can change into the Python home directory and run the COMPILEALL.CMD
288batch file.
289
290You can execute the regression tests included with the Python 2.3 source
291distribution by changing to the Python 2.3 home directory and executing the
292REGRTEST.CMD batch file. The following tests are known to fail at this
293time:
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000294- test_mhlib (I don't know of any port of MH to OS/2);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000295- test_pwd (see "YOU HAVE BEEN WARNED" item 10, probably a bug in my code);
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000296- test_grp (as per test_pwd);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000297- test_strftime (see "YOU HAVE BEEN WARNED" item 15);
298- 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).
301
302Note that some of the network related tests expect the loopback interface
303(interface "lo", with IP address 127.0.0.1) to be enabled, which from my
304experience is not the default configuration. Additionally, test_popen2
305expects the "cat" utility (such as found in ports of the GNU tools) to
306be installed.
307
308
309Building from source
310--------------------
311
312With the EMX port now checked into Python's CVS repository, the build
313infrastructure is part of the Python release sourceball.
314
315Prerequisites
316
317First and foremost, you need an operational EMX development installation -
318EMX v0.9d with fix04 (the latest at time of writing) & the gcc 2.8.1
319compiler released by Eberhard Mattes is the recommended setup.
320
321If you have a different version of gcc installed, see "YOU HAVE BEEN
322WARNED" item 16.
323
324Other items of software required:-
325
326- GNU make (I'm using v3.76.1)
327- rm, cp, mkdir from the GNU file utilities package
328- GNU find
329
330Procedure
331
3320. all changes mentioned apply to files in the PC/os2emx subdirectory
333 of the Python release source tree. make is also executed from this
334 directory, so change into this directory before proceeding.
335
3361. decide if you need to change the location of the Python installation.
337 If you wish to do this, set the value of the Makefile variable LIB_DIR
338 to the directory you wish to use for PYTHONHOME
339 (eg /usr/local/lib/python2.3).
340
341 If you want Python to find its library without the PYTHONHOME
342 environment variable set, set the value of the Makefile variable
343 FIXED_PYHOME to "yes" (uncomment the appropriate line).
344
3452. If you wish the Python executables (python.exe, pythonpm.exe & pgen.exe)
346 to be installed in a directory other than the PYTHONHOME directory, set
347 the value of the Makefile variable EXE_DIR to the appropriate directory.
348
3493. If you wish the Python core DLL (python23.dll) to be installed in a
350 directory other than the directory in which the Python executables are
351 installed (by default, the PYTHONHOME directory), set the value of the
352 Makefile variable DLL_DIR to the appropriate directory. This DLL must
353 be placed in a directory on the system's LIBPATH, or that gets set
354 with BEGINLIBPATH or ENDLIBPATH.
355
3564. If you have installed any of the libraries that can be used to build
357 optional Python modules, set the value of the relevant HAVE_<package>
358 Makefile variable to "yes". The Makefile currently supports:
359
360 library Makefile variable
361 ........................................
362 zlib (1.1.4) HAVE_ZLIB
363 GNU UltraFast Crypt HAVE_UFC
364 Tcl/Tk HAVE_TCLTK (not known to work)
365 GNU MP HAVE_GMPZ
366 GNU Readline HAVE_GREADLINE
367 BSD DB (v1.85) HAVE_BSDDB
368 ncurses HAVE_NCURSES
369 GNU gdbm HAVE_GDBM
370 libbz2 HAVE_BZ2
371
372 Please note that you need to check that what you have installed
373 is compatible with Python's build options. In particular, the
374 BSD DB v1.85 library needs to be rebuilt with a source patch for
375 multithread support (doesn't change the library's reentrant status
376 but allows it to be linked to Python which is multithreaded).
377 Widely available binary packages of other librarys & DLLs are
378 not built/linked with multithread support. Beware!
379
380 Also note that the Makefile currently expects any libraries to be
381 found with the default library search path. You may need to add
382 -L switches to the LDFLAGS Makefile variable if you have installed
383 libraries in directories not in the default search path (which can
384 be controlled by the LIBRARY_PATH environment variable used by EMX).
385
3865. make
387
388 It is usually a good idea to redirect the stdout and stderr streams
389 of the make process to log files, so that you can review any messages.
390
3916. make test
392
393 This runs the Python regression tests, and completion is a sign of
394 a usable build. You should check the list of skipped modules to
395 ensure that any optional modules you selected have been built;
396 checking the list of failures against the list of known failures
397 elsewhere in this document is also prudent.
398
3997. make install
400 >>>>>> NOT YET COMPLETE <<<<<<
401
4028. change to a directory outside the Python source tree and start Python.
403 Check the version and build date to confirm satisfactory installation.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000404
405
406YOU HAVE BEEN WARNED!!
407----------------------
408
409I know about a number of nasties in this port.
410
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004111. Eberhard Mattes, author of EMX, writes in his documentation that fork()
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000412is very inefficient in the OS/2 environment. It also requires that the
413executable be linked in a.out format rather than OMF. Use the os.exec
414and/or the os.spawn family of functions where possible.
415
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004162. In the absence of GNU Readline, terminating the interpreter requires a
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000417control-Z (^Z) followed by a carriage return. Jeff Rush documented this
418problem in his Python 1.5.2 port. With Readline, a control-D (^D) works
419as per the standard Unix environment.
420
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004213. EMX only has a partial implementation of fcntl(). The fcntl module
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000422in this port supports what EMX supports. If fcntl is important to you,
423please review the EMX C Library Reference (included in .INF format in the
424EMXVIEW.ZIP archive as part of the complete EMX development tools suite).
425Because of other side-effects I have modified the test_fcntl.py test
426script to deactivate the exercising of the missing functionality.
427
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004284. the PyBSDDB3 module has been imported into the Python standard
429library, with the intent of superceding the BSDDB 1.85 module (bsddb).
430As I don't yet have a satisfactory port of Sleepcat's more recent DB
431library (3.3.x/4.0.x/4.1.x), I haven't included a binary of this
432module. I have left the Python part of the PyBSDDB package in this
433distribution for completeness.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000434
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004355. As a consequence of the PyBSDDB3 module being imported, the former
436BSD DB (bsddb) module, linked against the DB v1.85 library from EMX,
437has been renamed bsddb185. The bsddb185 module will not be built by
438default on most platforms, but in the absence of a PyBSDDB3 module I
439have retained it in the EMX port.
440
441Version 1.85 of the DB library is widely known to have bugs, although
442some patches have become available (and are incorporated into the
443included bsddb185 module). Unless you have problems with software
444licenses which would rule out GDBM (and the dbm module because it is
445linked against the GDBM library) or need it for file format compatibility,
446you may be better off deleting it and relying on GDBM.
447
448Any code you have which uses the bsddb module can be modified to use the
449renamed module by changing
450
451 import bsddb
452
453to
454
455 import bsddb185 as bsddb
456
457A side effect of these changes is that the test_whichdb regression test
458fails.
459
4606. The readline module has been linked against ncurses rather than the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000461termcap library supplied with EMX.
462
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004637. I have configured this port to use "/" as the preferred path separator
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000464character, rather than "\" ('\\'), in line with the convention supported
465by EMX. Backslashes are still supported of course, and still appear in
466unexpected places due to outside sources that don't get normalised.
467
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004688. While the DistUtils components are now functional, other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000469packaging/binary handling tools and utilities such as those included in
470the Demo and Tools directories - freeze in particular - are unlikely to
471work. If you do get them going, I'd like to know about your success.
472
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004739. I haven't set out to support the [BEGIN|END]LIBPATH functionality
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000474supported by one of the earlier ports (Rush's??). If it works let me know.
475
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000047610. As a result of the limitations imposed by EMX's library routines, the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000477standard extension module pwd only synthesises a simple passwd database,
478and the grp module cannot be supported at all.
479
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000480I have written pure Python substitutes for pwd and grp, which can process
481real passwd and group files for those applications (such as MailMan) that
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000482require more than EMX emulates. I have placed pwd.py and grp.py in
483Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains
484pwd.pyd) in the PYTHONPATH. If you have become attached to what pwd.pyd
485supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH
486or delete/rename pwd.py & grp.py.
487
488pwd.py & grp.py support locating their data files by looking in the
489environment for them in the following sequence:
490pwd.py: $ETC_PASSWD (%ETC_PASSWD%)
491 $ETC/passwd (%ETC%/passwd)
492 $PYTHONHOME/Etc/passwd (%PYTHONHOME%/Etc/passwd)
493grp.py: $ETC_GROUP (%ETC_GROUP%)
494 $ETC/group (%ETC%/group)
495 $PYTHONHOME/Etc/group (%PYTHONHOME%/Etc/group)
496
497Both modules support using either the ":" character (Unix standard) or
498";" (OS/2, DOS, Windows standard) field separator character, and pwd.py
499implements the following drive letter conversions for the home_directory and
500shell fields (for the ":" separator only):
501 $x -> x:
502 x; -> x:
503
504Example versions of passwd and group are in the Etc subdirectory. Note
505that as of this release, this code fails the regression test. I'm looking
506into why, and hope to have this fixed.
507
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000508Be aware that Python's pwd & group modules are for reading password and
509group information only.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000510
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000051111. EMX's termios routines don't support all of the functionality now
512exposed by the termios module - refer to the EMX documentation to find
513out what is supported.
514
51512. The case sensitive import semantics introduced in Python 2.1 for other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000516case insensitive but case preserving file/operating systems (Windows etc),
517have been incorporated into this port, and are active by default. Setting
518the PYTHONCASEOK environment variable (to any value) reverts to the
519previous (case insensitive) semantics.
520
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000052113. Because I am statically linking ncurses, the _curses_panel
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000522module has potential problems arising from separate library data areas.
523To avoid this, I have configured the _curses_.pyd (imported as
524"_curses_panel") to import the ncurses symbols it needs from _curses.pyd.
525As a result the _curses module must be imported before the _curses_panel
526module. As far as I can tell, the modules in the curses package do this.
527If you have problems attempting to use the _curses_panel support please
528let me know, and I'll look into an alternative solution.
529
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053014. sys.platform reports "os2emx" instead of "os2". os.name still
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000531reports "os2". This change was to make it easier to distinguish between
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000532the VAC++ build (formerly maintained by Michael Muller) and the EMX build
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000533(this port), principally for DistUtils.
534
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053515. it appears that the %W substitution in the EMX strftime() routine has
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000536an off-by-one bug. strftime was listed as passing the regression tests
537in previous releases, but this fact appears to have been an oversight in
538the regression test suite. To fix this really requires a portable
539strftime routine - I'm looking into using one from FreeBSD, but its not
540ready yet.
541
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000054216. I have successfully built this port with Andy Zabolotny's ports of
543pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1. To use the
544bsddb185 module with the gcc 3.2.1 build, I had to recompile the DB library
545with gcc 3.2.1 - I don't know why, but trying to import the module built
546against a DB library compiled with gcc 2.8.1 would result in a SYS3175
547error.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000548
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000549I have not attempted to compile Python with any version of gcc prior to
550v2.8.1.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000551
Andrew MacIntyrefae89532003-06-09 08:15:14 +0000552While gcc supports more aggressive optimisation than I use, a lot of
553benchmarking indicates that Python's performance is at best only
554marginally improved by more aggressive optimisation, at least on my
555hardware (AMD Athlon 1.4GHz, VIA C3 800MHz).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000556
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000055717. os.spawnv() and os.spawnve() expose EMX's library routines rather
558than use the emulation in os.py.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000559
560In order to make use of some of the features this makes available in
561the OS/2 environment, you should peruse the relevant EMX documentation
562(EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives
563on Hobbes or LEO). Be aware that I have exposed all the "mode" options
564supported by EMX, but there are combinations that either cannot be
565practically used by/in Python or have the potential to compromise your
566system's stability.
567
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000056818. pythonpm.exe used to be just python.exe with the WINDOWAPI linker
569option set in the pythonpm.def file. In practice, this turns out to do
570nothing useful.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000571
572I have written a replacement which wraps the Python DLL in a genuine
573Presentation Manager application. This version actually runs the
574Python interpreter in a separate thread from the PM shell, in order
575that PythonPM has a functioning message queue as good PM apps should.
576In its current state, PythonPM's window is hidden. It can be displayed,
577although it will have no content as nothing is ever written to the
578window. Only the "hide" button is available. Although the code
579has support for shutting PythonPM down when the Python interpreter is
580still busy (via the "control" menu), this is not well tested and given
581comments I've come across in EMX documentation suggesting that the
582thread killing operation has problems I would suggest caution in
583relying on this capability.
584
585PythonPM processes commandline parameters normally. The standard input,
586output and error streams are only useful if redirected, as PythonPM's
587window is not a console in any form and so cannot accept or display
588anything. This means that the -i option is ineffective.
589
590Because the Python thread doesn't create its own message queue, creating
591PM Windows and performing most PM operations is not possible from within
592this thread. How this will affect supporting PM extensions (such as
593Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of
594WxWindows) is still being researched.
595
596Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result
597of trying. os.spawnv() _does_ work. PythonPM passes all regression tests
598that the standard Python interpreter (python.exe) passes, with the exception
599of test_fork1 and test_socket which both attempt to use os.fork().
600
601I very much want feedback on the performance, behaviour and utility of
602PythonPM. I would like to add a PM console capability to it, but that
603will be a non-trivial effort. I may be able to leverage the code in
604Illya Vaes' Tcl/Tk port, which would make it easier.
605
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000060619. os.chdir() uses EMX's _chdir2(), which supports changing both drive
607and directory at once. Similarly, os.getcwd() uses EMX's _getcwd()
608which returns drive as well as path.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000609
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061020. pyconfig.h is installed in the Include subdirectory with all
611other include files.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000612
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061321. the default build explicitly sets the number of file handles
614available to a Python process to 250. EMX default is 40, which is
615insufficient for the tempfile regression test (test_tempfile) which
616tries to create 100 temporary files.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000617
618This setting can be overridden via the EMXOPT environment variable:
619 set EMXOPT=-h250
620is equivalent to the setting currently used. The emxbind utility (if you
621have it installed) can also be used to permanently change the setting in
622python.exe - please refer to the EMX documentation for more information.
623
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000062422. a pure python strptime module is now part of the Python standard
625library, superceding a platform specific extension module. This module
626leverages the strftime module, and as a result test_strptime fails
627due to the EMX strftime bug in item 20 above.
628
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000629... probably other issues that I've not encountered, or don't remember :-(
630
631If you encounter other difficulties with this port, which can be
632characterised as peculiar to this port rather than to the Python release,
633I would like to hear about them. However I cannot promise to be able to do
634anything to resolve such problems. See the Contact section below...
635
636
637To do...
638--------
639
640In no particular order of apparent importance or likelihood...
641
642- support Tkinter and/or alternative GUI (wxWindows??)
643
644
645Credits
646-------
647
648In addition to people identified above, I'd like to thank:
649- the BDFL, Guido van Rossum, and crew for Python;
650- Dr David Mertz, for trying out a pre-release of this port;
651- the Python-list/comp.lang.python community;
652- John Poltorak, for input about pwd/grp.
653
654Contact
655-------
656
657Constructive feedback, negative or positive, about this port is welcome
658and should be addressed to me at the e-mail addresses below.
659
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000660I have a private mailing list for announcements of fixes & updates to
661this port. If you wish to receive such e-mail announcments, please send
662me an e-mail requesting that you be added to this list.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000663
664Andrew MacIntyre
665E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au
666Web: http://www.andymac.org/
667
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000066818 April, 2003.