blob: b8d2115becca64266a4c563060900c697b49b097 [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 MacIntyreb0f5e5a2003-07-10 12:55:30 +0000295- test_pwd (see "YOU HAVE BEEN WARNED" item 10);
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
Andrew MacIntyreb0f5e5a2003-07-10 12:55:30 +0000497The ETC_PASSWD and ETC_GROUP environment variables are intended to allow
498support for multiple passwd/grp files, where other applications may not
499support as wide a variety of input variations (drive remappings,
500separators etc).
501
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000502Both modules support using either the ":" character (Unix standard) or
503";" (OS/2, DOS, Windows standard) field separator character, and pwd.py
504implements the following drive letter conversions for the home_directory and
505shell fields (for the ":" separator only):
506 $x -> x:
507 x; -> x:
508
Andrew MacIntyreb0f5e5a2003-07-10 12:55:30 +0000509Example versions of passwd and group are in the Etc subdirectory. The
510regression tests (test_pwd and test_grp) will fail if valid password and
511group files cannot be found, but should pass otherwise.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000512
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000513Be aware that Python's pwd & group modules are for reading password and
514group information only.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000515
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000051611. EMX's termios routines don't support all of the functionality now
517exposed by the termios module - refer to the EMX documentation to find
518out what is supported.
519
52012. The case sensitive import semantics introduced in Python 2.1 for other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000521case insensitive but case preserving file/operating systems (Windows etc),
522have been incorporated into this port, and are active by default. Setting
523the PYTHONCASEOK environment variable (to any value) reverts to the
524previous (case insensitive) semantics.
525
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000052613. Because I am statically linking ncurses, the _curses_panel
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000527module has potential problems arising from separate library data areas.
528To avoid this, I have configured the _curses_.pyd (imported as
529"_curses_panel") to import the ncurses symbols it needs from _curses.pyd.
530As a result the _curses module must be imported before the _curses_panel
531module. As far as I can tell, the modules in the curses package do this.
532If you have problems attempting to use the _curses_panel support please
533let me know, and I'll look into an alternative solution.
534
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053514. sys.platform reports "os2emx" instead of "os2". os.name still
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000536reports "os2". This change was to make it easier to distinguish between
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000537the VAC++ build (formerly maintained by Michael Muller) and the EMX build
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000538(this port), principally for DistUtils.
539
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000054015. it appears that the %W substitution in the EMX strftime() routine has
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000541an off-by-one bug. strftime was listed as passing the regression tests
542in previous releases, but this fact appears to have been an oversight in
543the regression test suite. To fix this really requires a portable
544strftime routine - I'm looking into using one from FreeBSD, but its not
545ready yet.
546
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000054716. I have successfully built this port with Andy Zabolotny's ports of
548pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1. To use the
549bsddb185 module with the gcc 3.2.1 build, I had to recompile the DB library
550with gcc 3.2.1 - I don't know why, but trying to import the module built
551against a DB library compiled with gcc 2.8.1 would result in a SYS3175
552error.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000553
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000554I have not attempted to compile Python with any version of gcc prior to
555v2.8.1.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000556
Andrew MacIntyrebac1ea92003-07-16 13:31:11 +0000557This release sees the default optimisation change to
558"-O3 -fomit-frame-pointer". This works fine too for pgcc 2.95 but not
559for gcc 3.2.1.
560
561With gcc 3.2.1, -O3 causes 2 unexpected test failures: test_format and
562test_unicode. Both these tests pass if -O2 is instead of -O3 with this
563compiler, and the performance difference is negligible (in contrast to
564gcc 2.8.1 and pgcc 2.95, where the performance difference between the
5652 optimisation settings approaches 10%).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000566
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000056717. os.spawnv() and os.spawnve() expose EMX's library routines rather
568than use the emulation in os.py.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000569
570In order to make use of some of the features this makes available in
571the OS/2 environment, you should peruse the relevant EMX documentation
572(EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives
573on Hobbes or LEO). Be aware that I have exposed all the "mode" options
574supported by EMX, but there are combinations that either cannot be
575practically used by/in Python or have the potential to compromise your
576system's stability.
577
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000057818. pythonpm.exe used to be just python.exe with the WINDOWAPI linker
579option set in the pythonpm.def file. In practice, this turns out to do
580nothing useful.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000581
582I have written a replacement which wraps the Python DLL in a genuine
583Presentation Manager application. This version actually runs the
584Python interpreter in a separate thread from the PM shell, in order
585that PythonPM has a functioning message queue as good PM apps should.
586In its current state, PythonPM's window is hidden. It can be displayed,
587although it will have no content as nothing is ever written to the
588window. Only the "hide" button is available. Although the code
589has support for shutting PythonPM down when the Python interpreter is
590still busy (via the "control" menu), this is not well tested and given
591comments I've come across in EMX documentation suggesting that the
592thread killing operation has problems I would suggest caution in
593relying on this capability.
594
595PythonPM processes commandline parameters normally. The standard input,
596output and error streams are only useful if redirected, as PythonPM's
597window is not a console in any form and so cannot accept or display
598anything. This means that the -i option is ineffective.
599
600Because the Python thread doesn't create its own message queue, creating
601PM Windows and performing most PM operations is not possible from within
602this thread. How this will affect supporting PM extensions (such as
603Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of
604WxWindows) is still being researched.
605
606Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result
607of trying. os.spawnv() _does_ work. PythonPM passes all regression tests
608that the standard Python interpreter (python.exe) passes, with the exception
609of test_fork1 and test_socket which both attempt to use os.fork().
610
611I very much want feedback on the performance, behaviour and utility of
612PythonPM. I would like to add a PM console capability to it, but that
613will be a non-trivial effort. I may be able to leverage the code in
614Illya Vaes' Tcl/Tk port, which would make it easier.
615
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000061619. os.chdir() uses EMX's _chdir2(), which supports changing both drive
617and directory at once. Similarly, os.getcwd() uses EMX's _getcwd()
618which returns drive as well as path.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000619
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000062020. pyconfig.h is installed in the Include subdirectory with all
621other include files.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000622
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000062321. the default build explicitly sets the number of file handles
624available to a Python process to 250. EMX default is 40, which is
625insufficient for the tempfile regression test (test_tempfile) which
626tries to create 100 temporary files.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000627
628This setting can be overridden via the EMXOPT environment variable:
629 set EMXOPT=-h250
630is equivalent to the setting currently used. The emxbind utility (if you
631have it installed) can also be used to permanently change the setting in
632python.exe - please refer to the EMX documentation for more information.
633
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000063422. a pure python strptime module is now part of the Python standard
635library, superceding a platform specific extension module. This module
636leverages the strftime module, and as a result test_strptime fails
637due to the EMX strftime bug in item 20 above.
638
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000639... probably other issues that I've not encountered, or don't remember :-(
640
641If you encounter other difficulties with this port, which can be
642characterised as peculiar to this port rather than to the Python release,
643I would like to hear about them. However I cannot promise to be able to do
644anything to resolve such problems. See the Contact section below...
645
646
647To do...
648--------
649
650In no particular order of apparent importance or likelihood...
651
652- support Tkinter and/or alternative GUI (wxWindows??)
653
654
655Credits
656-------
657
658In addition to people identified above, I'd like to thank:
659- the BDFL, Guido van Rossum, and crew for Python;
660- Dr David Mertz, for trying out a pre-release of this port;
661- the Python-list/comp.lang.python community;
662- John Poltorak, for input about pwd/grp.
663
664Contact
665-------
666
667Constructive feedback, negative or positive, about this port is welcome
668and should be addressed to me at the e-mail addresses below.
669
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000670I have a private mailing list for announcements of fixes & updates to
671this port. If you wish to receive such e-mail announcments, please send
672me an e-mail requesting that you be added to this list.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000673
674Andrew MacIntyre
675E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au
676Web: http://www.andymac.org/
677
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000067818 April, 2003.