blob: ffc518195ac660e4183d6ff3b84bef7ba6c9fc5a [file] [log] [blame]
Andrew MacIntyrec2138af2003-12-02 12:23:07 +00001This is a port of Python 2.4 to OS/2 using the EMX development tools
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00002=========================================================================
3
4What's new since the previous release
5-------------------------------------
6
Andrew MacIntyrec2138af2003-12-02 12:23:07 +00007Another day, another version...
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00008
Andrew MacIntyre41d97d62002-02-17 05:23:30 +00009
10Licenses and info about Python and EMX
11--------------------------------------
12
Andrew MacIntyrec2138af2003-12-02 12:23:07 +000013Please read the file README.Python-2.4 included in this package for
14information about Python 2.4. This file is the README file from the
15Python 2.4 source distribution available via http://www.python.org/
16and its mirrors. The file LICENCE.Python-2.4 is the text of the Licence
17from the Python 2.4 source distribution.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000018
19Note that the EMX package that this package depends on is released under
20the GNU General Public Licence. Please refer to the documentation
21accompanying the EMX Runtime libraries for more information about the
22implications of this. A copy of version 2 of the GPL is included as the
23file COPYING.gpl2.
24
25Readline and GDBM are covered by the GNU General Public Licence. I think
26Eberhard Mattes' porting changes to BSD DB v1.85 are also GPL'ed (BSD DB
27itself is BSD Licenced). ncurses and expat appear to be covered by MIT
28style licences - please refer to the source distributions for more detail.
29zlib is distributable under a very free license. GNU MP and GNU UFC are
30under the GNU LGPL (see file COPYING.lib).
31
32My patches to the Python-2.x source distributions, and any other packages
33used in this port, are placed in the public domain.
34
35This software is provided 'as-is', without any express or implied warranty.
36In no event will the author be held liable for any damages arising from the
37use of the software.
38
39I do hope however that it proves useful to someone.
40
41
42Other ports
43-----------
44
45There have been ports of previous versions of Python to OS/2.
46
47The best known would be that by Jeff Rush, most recently of version
481.5.2. Jeff used IBM's Visual Age C++ (v3) for his ports, and his
Andrew MacIntyrec2138af2003-12-02 12:23:07 +000049patches have been included in the Python 2.4 source distribution.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000050
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000051Andy Zabolotny implemented a port of Python v1.5.2 using the EMX
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000052development tools. His patches against the Python v1.5.2 source
53distribution have become the core of this port, and without his efforts
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000054this port wouldn't exist. Andy's port also appears to have been
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000055compiled with his port of gcc 2.95.2 to EMX, which I have but have
Andrew MacIntyrefae89532003-06-09 08:15:14 +000056chosen not to use for the binary distribution of this port (see item 16
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000057of the "YOU HAVE BEEN WARNED" section below).
58
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000059It is possible to have these earlier ports still usable after installing
60this port - see the README.os2emx.multiple_versions file, contributed by
61Dr David Mertz, for a suggested approach to achieving this.
62
63
64Software requirements
65---------------------
66
67This package requires the EMX Runtime package, available from the
68Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/)
69archives of OS/2 software. I have used EMX version 0.9d fix04 in
70developing this port.
71
72My development system is running OS/2 v4 with fixpack 12.
73
743rd party software which has been linked into dynamically loaded modules:
75- ncurses (see http://dickey.his.com/ for more info, v5.2)
76- GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1)
77- GNU GDBM (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000078- zlib (derived from Hung-Chi Chu's port of v1.1.3, v1.1.4)
79- expat (distributed with Python, v1.95.6)
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000080- GNU MP (Peter Meerwald's port available from LEO, v2.0.2)
81- GNU UFC (Kai Uwe Rommel's port available from LEO, v2.0.4)
82
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000083
84About this port
85---------------
86
87I have attempted to make this port as complete and functional as I can,
88notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below.
89
90Core components:
91
92Python.exe is linked as an a.out executable, ie using EMX method E1
93to compile & link the executable. This is so that fork() works (see
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000094"YOU HAVE BEEN WARNED" item 1).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000095
Andrew MacIntyrec2138af2003-12-02 12:23:07 +000096Python24.dll is created as a normal OMF DLL, with an OMF import
Andrew MacIntyre41d97d62002-02-17 05:23:30 +000097library and module definition file. There is also an a.out (.a) import
Andrew MacIntyreffcf8992002-08-18 06:28:21 +000098library to support linking the DLL to a.out executables. The DLL
99requires the EMX runtime DLLs.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000100
101This port has been built with complete support for multithreading.
102
103Modules:
104
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000105With the exception of modules that have a significant code size, or are
106not recommended or desired for normal use, the standard modules are now
107built into the core DLL rather than configured as dynamically loadable
108modules. This is for both reasons of performance (startup time) and
109memory use (lots of small DLLs fragment the address space).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000110
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000111I haven't yet changed the building of Python's dynamically loadable
112modules over to using the DistUtils.
113
114See "YOU HAVE BEEN WARNED" item 3 for notes about the fcntl module, and
115"YOU HAVE BEEN WARNED" item 10 for notes about the pwd and grp modules.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000116
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000117This port supports case sensitive module import semantics, matching
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000118the Windows release. This can be deactivated by setting the PYTHONCASEOK
119environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED"
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000120item 12.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000121
122Optional modules:
123
124Where I've been able to locate the required 3rd party packages already
125ported to OS/2, I've built and included them.
126
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000127These include ncurses (_curses, _curses_panel), BSD DB (bsddb185),
128GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), GNU MP (mpz)
129and GNU UFC (crypt).
130
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000131Expat is now included in the Python release sourceball, and the pyexpat
132module is always built.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000133
134I have built these modules statically linked against the 3rd party
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000135libraries. Unfortunately my attempts to use the dll version of GNU
136readline have been a dismal failure, in that when the dynamically
137linked readline module is active other modules immediately provoke a
138core dump when imported.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000139
140Only the BSD DB package (part of the BSD package distributed with EMX)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000141needs source modifications to be used for this port, pertaining to use
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000142of errno with multithreading.
143
144The other packages, except for ncurses and zlib, needed Makefile changes
145for multithreading support but no source changes.
146
147The _curses_panel module is a potential problem - see "YOU HAVE BEEN
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000148WARNED" item 13.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000149
150Upstream source patches:
151
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000152No updates to the Python 2.4 release have become available.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000153
154Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes
155bug fixes for the BSD DB library. The bsddb module included in this
156port incorporates these fixes.
157
158Library and other distributed Python code:
159
160The Python standard library lives in the Lib directory. All the standard
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000161library code included with the Python 2.4 source distribution is included
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000162in the binary archive, with the exception of the dos-8x3 and tkinter
163subdirectories which have been omitted to reduce the size of the binary
164archive - the dos-8x3 components are unnecessary duplicates and Tkinter
165is not supported by this port (yet). All the plat-* subdirectories in the
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000166source distribution have also been omitted, except for the plat-os2emx
167subdirectory.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000168
169The Tools and Demo directories contain a collection of Python scripts.
170To reduce the size of the binary archive, the Demo/sgi, Demo/Tix,
171Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been
172omitted as not being supported by this port. The Misc directory has
173also been omitted.
174
175All subdirectories omitted from the binary archive can be reconstituted
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000176from the Python 2.4 source distribution, if desired.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000177
178Support for building Python extensions:
179
180The Config subdirectory contains the files describing the configuration
181of the interpreter and the Makefile, import libraries for the Python DLL,
182and the module definition file used to create the Python DLL. The
183Include subdirectory contains all the standard Python header files
184needed for building extensions.
185
186As I don't have the Visual Age C++ compiler, I've made no attempt to
187have this port support extensions built with that compiler.
188
189
190Packaging
191---------
192
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000193This port is packaged as follows:
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000194- python-2.4-os2emx-bin-03????.zip (binaries, library modules)
195- python-2.4-os2emx-src-03???? (patches+makefiles for non-Python code)
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000196
197As all the Python specific patches for the port are now part of the
198Python release tarball, only the patches and makefiles involved in
199building external libraries for optional extensions are included in
200the source archive.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000201
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000202Documentation for the Python language, as well as the Python 2.4
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000203source distibution, can be obtained from the Python website
204(http://www.python.org/) or the Python project pages at Sourceforge
205(http://sf.net/projects/python/).
206
207
208Installation
209------------
210
211Obtain and install, as per the included instructions, the EMX runtime
212package.
213
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000214Unpack this archive, preserving the subdirectories, in the root directory
215of the drive where you want Python to live.
216
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000217Add the Python directory (eg C:\Python24) to the PATH and LIBPATH
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000218variables in CONFIG.SYS.
219
220You should then set the PYTHONHOME and PYTHONPATH environment variables
221in CONFIG.SYS.
222
223PYTHONHOME should be set to Python's top level directory. PYTHONPATH
224should be set to the semicolon separated list of principal Python library
225directories.
226I use:
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000227 SET PYTHONHOME=F:/Python24
228 SET PYTHONPATH=F:/Python24/Lib;F:/Python24/Lib/plat-os2emx;
229 F:/Python24/Lib/lib-dynload;F:/Python24/Lib/site-packages
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000230
231NOTE!: the PYTHONPATH setting above is linewrapped for this document - it
232should all be on one line in CONFIG.SYS!
233
234If you wish to use the curses module, you should set the TERM and TERMINFO
235environment variables appropriately.
236
237If you don't already have ncurses installed, I have included a copy of the
238EMX subset of the Terminfo database included with the ncurses-5.2 source
239distribution. This can be used by setting the TERMINFO environment variable
240to the path of the Terminfo subdirectory below the Python home directory.
241On my system this looks like:
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000242 SET TERMINFO=F:/Python24/Terminfo
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000243
244For the TERM environment variable, I would try one of the following:
245 SET TERM=ansi
246 SET TERM=os2
247 SET TERM=window
248
249You will have to reboot your system for these changes to CONFIG.SYS to take
250effect.
251
252If you wish to compile all the included Python library modules to bytecode,
253you can change into the Python home directory and run the COMPILEALL.CMD
254batch file.
255
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000256You can execute the regression tests included with the Python 2.4 source
257distribution by changing to the Python 2.4 home directory and executing the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000258REGRTEST.CMD batch file. The following tests are known to fail at this
259time:
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000260- test_mhlib (I don't know of any port of MH to OS/2);
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000261- test_strptime (see "YOU HAVE BEEN WARNED" item 22);
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000262- test_time (see "YOU HAVE BEEN WARNED" item 22);
263- test_posixpath (see "YOU HAVE BEEN WARNED" item 23).
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000264
265Note that some of the network related tests expect the loopback interface
266(interface "lo", with IP address 127.0.0.1) to be enabled, which from my
267experience is not the default configuration. Additionally, test_popen2
268expects the "cat" utility (such as found in ports of the GNU tools) to
269be installed.
270
271
272Building from source
273--------------------
274
275With the EMX port now checked into Python's CVS repository, the build
276infrastructure is part of the Python release sourceball.
277
278Prerequisites
279
280First and foremost, you need an operational EMX development installation -
281EMX v0.9d with fix04 (the latest at time of writing) & the gcc 2.8.1
282compiler released by Eberhard Mattes is the recommended setup.
283
284If you have a different version of gcc installed, see "YOU HAVE BEEN
285WARNED" item 16.
286
287Other items of software required:-
288
289- GNU make (I'm using v3.76.1)
290- rm, cp, mkdir from the GNU file utilities package
291- GNU find
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000292- GNU sed
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000293
294Procedure
295
2960. all changes mentioned apply to files in the PC/os2emx subdirectory
297 of the Python release source tree. make is also executed from this
298 directory, so change into this directory before proceeding.
299
3001. decide if you need to change the location of the Python installation.
301 If you wish to do this, set the value of the Makefile variable LIB_DIR
302 to the directory you wish to use for PYTHONHOME
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000303 (eg /usr/local/lib/python2.4).
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000304
305 If you want Python to find its library without the PYTHONHOME
306 environment variable set, set the value of the Makefile variable
307 FIXED_PYHOME to "yes" (uncomment the appropriate line).
308
3092. If you wish the Python executables (python.exe, pythonpm.exe & pgen.exe)
310 to be installed in a directory other than the PYTHONHOME directory, set
311 the value of the Makefile variable EXE_DIR to the appropriate directory.
312
Andrew MacIntyrec2138af2003-12-02 12:23:07 +00003133. If you wish the Python core DLL (python24.dll) to be installed in a
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000314 directory other than the directory in which the Python executables are
315 installed (by default, the PYTHONHOME directory), set the value of the
316 Makefile variable DLL_DIR to the appropriate directory. This DLL must
317 be placed in a directory on the system's LIBPATH, or that gets set
318 with BEGINLIBPATH or ENDLIBPATH.
319
3204. If you have installed any of the libraries that can be used to build
321 optional Python modules, set the value of the relevant HAVE_<package>
322 Makefile variable to "yes". The Makefile currently supports:
323
324 library Makefile variable
325 ........................................
326 zlib (1.1.4) HAVE_ZLIB
327 GNU UltraFast Crypt HAVE_UFC
328 Tcl/Tk HAVE_TCLTK (not known to work)
329 GNU MP HAVE_GMPZ
330 GNU Readline HAVE_GREADLINE
331 BSD DB (v1.85) HAVE_BSDDB
332 ncurses HAVE_NCURSES
333 GNU gdbm HAVE_GDBM
334 libbz2 HAVE_BZ2
335
336 Please note that you need to check that what you have installed
337 is compatible with Python's build options. In particular, the
338 BSD DB v1.85 library needs to be rebuilt with a source patch for
339 multithread support (doesn't change the library's reentrant status
340 but allows it to be linked to Python which is multithreaded).
341 Widely available binary packages of other librarys & DLLs are
342 not built/linked with multithread support. Beware!
343
344 Also note that the Makefile currently expects any libraries to be
345 found with the default library search path. You may need to add
346 -L switches to the LDFLAGS Makefile variable if you have installed
347 libraries in directories not in the default search path (which can
348 be controlled by the LIBRARY_PATH environment variable used by EMX).
349
3505. make
351
352 It is usually a good idea to redirect the stdout and stderr streams
353 of the make process to log files, so that you can review any messages.
354
3556. make test
356
357 This runs the Python regression tests, and completion is a sign of
358 a usable build. You should check the list of skipped modules to
359 ensure that any optional modules you selected have been built;
360 checking the list of failures against the list of known failures
361 elsewhere in this document is also prudent.
362
3637. make install
364 >>>>>> NOT YET COMPLETE <<<<<<
365
3668. change to a directory outside the Python source tree and start Python.
367 Check the version and build date to confirm satisfactory installation.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000368
369
370YOU HAVE BEEN WARNED!!
371----------------------
372
373I know about a number of nasties in this port.
374
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00003751. Eberhard Mattes, author of EMX, writes in his documentation that fork()
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000376is very inefficient in the OS/2 environment. It also requires that the
377executable be linked in a.out format rather than OMF. Use the os.exec
378and/or the os.spawn family of functions where possible.
379
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00003802. In the absence of GNU Readline, terminating the interpreter requires a
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000381control-Z (^Z) followed by a carriage return. Jeff Rush documented this
382problem in his Python 1.5.2 port. With Readline, a control-D (^D) works
383as per the standard Unix environment.
384
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00003853. EMX only has a partial implementation of fcntl(). The fcntl module
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000386in this port supports what EMX supports. If fcntl is important to you,
387please review the EMX C Library Reference (included in .INF format in the
388EMXVIEW.ZIP archive as part of the complete EMX development tools suite).
389Because of other side-effects I have modified the test_fcntl.py test
390script to deactivate the exercising of the missing functionality.
391
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00003924. the PyBSDDB3 module has been imported into the Python standard
393library, with the intent of superceding the BSDDB 1.85 module (bsddb).
394As I don't yet have a satisfactory port of Sleepcat's more recent DB
395library (3.3.x/4.0.x/4.1.x), I haven't included a binary of this
396module. I have left the Python part of the PyBSDDB package in this
397distribution for completeness.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000398
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00003995. As a consequence of the PyBSDDB3 module being imported, the former
400BSD DB (bsddb) module, linked against the DB v1.85 library from EMX,
401has been renamed bsddb185. The bsddb185 module will not be built by
402default on most platforms, but in the absence of a PyBSDDB3 module I
403have retained it in the EMX port.
404
405Version 1.85 of the DB library is widely known to have bugs, although
406some patches have become available (and are incorporated into the
407included bsddb185 module). Unless you have problems with software
408licenses which would rule out GDBM (and the dbm module because it is
409linked against the GDBM library) or need it for file format compatibility,
410you may be better off deleting it and relying on GDBM.
411
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000412Any code you have which uses the v1.85 bsddb module can be modified to
413use the renamed module by changing
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000414
415 import bsddb
416
417to
418
419 import bsddb185 as bsddb
420
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004216. The readline module has been linked against ncurses rather than the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000422termcap library supplied with EMX.
423
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004247. I have configured this port to use "/" as the preferred path separator
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000425character, rather than "\" ('\\'), in line with the convention supported
426by EMX. Backslashes are still supported of course, and still appear in
427unexpected places due to outside sources that don't get normalised.
428
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004298. While the DistUtils components are now functional, other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000430packaging/binary handling tools and utilities such as those included in
431the Demo and Tools directories - freeze in particular - are unlikely to
432work. If you do get them going, I'd like to know about your success.
433
Andrew MacIntyre631e87f2003-04-21 14:33:04 +00004349. I haven't set out to support the [BEGIN|END]LIBPATH functionality
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000435supported by one of the earlier ports (Rush's??). If it works let me know.
436
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000043710. As a result of the limitations imposed by EMX's library routines, the
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000438standard extension module pwd only synthesises a simple passwd database,
439and the grp module cannot be supported at all.
440
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000441I have written pure Python substitutes for pwd and grp, which can process
442real passwd and group files for those applications (such as MailMan) that
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000443require more than EMX emulates. I have placed pwd.py and grp.py in
444Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains
445pwd.pyd) in the PYTHONPATH. If you have become attached to what pwd.pyd
446supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH
447or delete/rename pwd.py & grp.py.
448
449pwd.py & grp.py support locating their data files by looking in the
450environment for them in the following sequence:
451pwd.py: $ETC_PASSWD (%ETC_PASSWD%)
452 $ETC/passwd (%ETC%/passwd)
453 $PYTHONHOME/Etc/passwd (%PYTHONHOME%/Etc/passwd)
454grp.py: $ETC_GROUP (%ETC_GROUP%)
455 $ETC/group (%ETC%/group)
456 $PYTHONHOME/Etc/group (%PYTHONHOME%/Etc/group)
457
Andrew MacIntyreb0f5e5a2003-07-10 12:55:30 +0000458The ETC_PASSWD and ETC_GROUP environment variables are intended to allow
459support for multiple passwd/grp files, where other applications may not
460support as wide a variety of input variations (drive remappings,
461separators etc).
462
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000463Both modules support using either the ":" character (Unix standard) or
464";" (OS/2, DOS, Windows standard) field separator character, and pwd.py
465implements the following drive letter conversions for the home_directory and
466shell fields (for the ":" separator only):
467 $x -> x:
468 x; -> x:
469
Andrew MacIntyreb0f5e5a2003-07-10 12:55:30 +0000470Example versions of passwd and group are in the Etc subdirectory. The
471regression tests (test_pwd and test_grp) will fail if valid password and
472group files cannot be found, but should pass otherwise.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000473
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000474Be aware that Python's pwd & group modules are for reading password and
475group information only.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000476
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000047711. EMX's termios routines don't support all of the functionality now
478exposed by the termios module - refer to the EMX documentation to find
479out what is supported.
480
48112. The case sensitive import semantics introduced in Python 2.1 for other
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000482case insensitive but case preserving file/operating systems (Windows etc),
483have been incorporated into this port, and are active by default. Setting
484the PYTHONCASEOK environment variable (to any value) reverts to the
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000485previous (case insensitive) semantics. This can be an issue with some
486file management utilities that do not preserve the case of file and
487directory names.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000488
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000048913. Because I am statically linking ncurses, the _curses_panel
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000490module has potential problems arising from separate library data areas.
491To avoid this, I have configured the _curses_.pyd (imported as
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000492"_curses_panel") to import the ncurses symbols it needs from _curses.dll
493(which is the curses module, but with a .dll extension rather than .pyd
494so that the dynamic loader can actually import the symbols from it as a
495DLL).
496
497The site module (Lib/site.py) has code added to tweak BEGINLIBPATH so
498that _curses.dll is found when _curses_panel is imported. If you have
499problems attempting to use the _curses_panel support please let me know,
500and I'll have another look at this.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000501
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000050214. sys.platform reports "os2emx" instead of "os2". os.name still
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000503reports "os2". This change was to make it easier to distinguish between
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000504the VAC++ build (formerly maintained by Michael Muller) and the EMX build
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000505(this port), principally for DistUtils.
506
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000050715. it appears that the %W substitution in the EMX strftime() routine has
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000508an off-by-one bug. strftime was listed as passing the regression tests
509in previous releases, but this fact appears to have been an oversight in
510the regression test suite. To fix this really requires a portable
511strftime routine - I'm looking into using one from FreeBSD, but its not
512ready yet.
513
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000051416. I have successfully built this port with Andy Zabolotny's ports of
515pgcc 2.95 and gcc 3.2.1, in addition to EM's gcc 2.8.1. To use the
516bsddb185 module with the gcc 3.2.1 build, I had to recompile the DB library
517with gcc 3.2.1 - I don't know why, but trying to import the module built
518against a DB library compiled with gcc 2.8.1 would result in a SYS3175
519error.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000520
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000521I have not attempted to compile Python with any version of gcc prior to
522v2.8.1.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000523
Andrew MacIntyrebac1ea92003-07-16 13:31:11 +0000524This release sees the default optimisation change to
Andrew MacIntyrec2138af2003-12-02 12:23:07 +0000525"-O3 -fomit-frame-pointer -mprobe". This works fine too for pgcc 2.95
526but not for gcc 3.2.1.
Andrew MacIntyrebac1ea92003-07-16 13:31:11 +0000527
528With gcc 3.2.1, -O3 causes 2 unexpected test failures: test_format and
529test_unicode. Both these tests pass if -O2 is instead of -O3 with this
530compiler, and the performance difference is negligible (in contrast to
531gcc 2.8.1 and pgcc 2.95, where the performance difference between the
5322 optimisation settings approaches 10%).
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000533
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000053417. os.spawnv() and os.spawnve() expose EMX's library routines rather
535than use the emulation in os.py.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000536
537In order to make use of some of the features this makes available in
538the OS/2 environment, you should peruse the relevant EMX documentation
539(EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives
540on Hobbes or LEO). Be aware that I have exposed all the "mode" options
541supported by EMX, but there are combinations that either cannot be
542practically used by/in Python or have the potential to compromise your
543system's stability.
544
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000054518. pythonpm.exe used to be just python.exe with the WINDOWAPI linker
546option set in the pythonpm.def file. In practice, this turns out to do
547nothing useful.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000548
549I have written a replacement which wraps the Python DLL in a genuine
550Presentation Manager application. This version actually runs the
551Python interpreter in a separate thread from the PM shell, in order
552that PythonPM has a functioning message queue as good PM apps should.
553In its current state, PythonPM's window is hidden. It can be displayed,
554although it will have no content as nothing is ever written to the
555window. Only the "hide" button is available. Although the code
556has support for shutting PythonPM down when the Python interpreter is
557still busy (via the "control" menu), this is not well tested and given
558comments I've come across in EMX documentation suggesting that the
559thread killing operation has problems I would suggest caution in
560relying on this capability.
561
562PythonPM processes commandline parameters normally. The standard input,
563output and error streams are only useful if redirected, as PythonPM's
564window is not a console in any form and so cannot accept or display
565anything. This means that the -i option is ineffective.
566
567Because the Python thread doesn't create its own message queue, creating
568PM Windows and performing most PM operations is not possible from within
569this thread. How this will affect supporting PM extensions (such as
570Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of
571WxWindows) is still being researched.
572
573Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result
574of trying. os.spawnv() _does_ work. PythonPM passes all regression tests
575that the standard Python interpreter (python.exe) passes, with the exception
576of test_fork1 and test_socket which both attempt to use os.fork().
577
578I very much want feedback on the performance, behaviour and utility of
579PythonPM. I would like to add a PM console capability to it, but that
580will be a non-trivial effort. I may be able to leverage the code in
581Illya Vaes' Tcl/Tk port, which would make it easier.
582
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000058319. os.chdir() uses EMX's _chdir2(), which supports changing both drive
584and directory at once. Similarly, os.getcwd() uses EMX's _getcwd()
585which returns drive as well as path.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000586
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000058720. pyconfig.h is installed in the Include subdirectory with all
588other include files.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000589
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000059021. the default build explicitly sets the number of file handles
591available to a Python process to 250. EMX default is 40, which is
592insufficient for the tempfile regression test (test_tempfile) which
593tries to create 100 temporary files.
Andrew MacIntyreffcf8992002-08-18 06:28:21 +0000594
595This setting can be overridden via the EMXOPT environment variable:
596 set EMXOPT=-h250
597is equivalent to the setting currently used. The emxbind utility (if you
598have it installed) can also be used to permanently change the setting in
599python.exe - please refer to the EMX documentation for more information.
600
Andrew MacIntyre631e87f2003-04-21 14:33:04 +000060122. a pure python strptime module is now part of the Python standard
602library, superceding a platform specific extension module. This module
603leverages the strftime module, and as a result test_strptime fails
604due to the EMX strftime bug in item 20 above.
605
Andrew MacIntyrec2138af2003-12-02 12:23:07 +000060623. test_posixpath attempts to exercise various Posix path related
607functionality. Most of the sub-tests pass, but the "ismount" and
608"samestat" subtests fail:
609- EMX provides not satisfactory mount point emulation, so "ismount"
610 cannot succeed;
611- EMX documents that successive stat() calls will produce different
612 results, so "samestat" cannot succeed.
613
614test_posixpath should skip these tests on EMX.
615
61624. I have had a report that attempting to use the Bittorrent package
617(http://bitconjurer.org/BitTorrent/) with this port causes traps not
618long after starting the download; this using the "headless" download
619script on eCS v1.1. I have not been able to duplicate this myself,
620but the indications I have suggest a failure in the 32 bit TCP/IP
621stack (v4.3.2? on eCS v1.1) - on my v4.0 FP12 system with MPTS fixpack
622WR8425 applied (16 bit TCP/IP stack v4.02), BitTorrent appears to work
623normally in testing on a 100Mbit LAN. With the curses.panel fix (see
624item 13 above), the BitTorrent curses downloader works too. I'd
625appreciate any success or failure reports with BitTorrent, though
626I've regretfully recommended that the person who reported the failure
627take this up with eCS support. Since this report, I have received a
628followup which suggests that the problem may have been a buggy network
629card driver. I think it suffices to say that BitTorrent is a fair stress
630test of a system's networking capability.
631
63225. In the absence of an EMX implementation of the link() function, I've
633implemented a crude Python emulation, in the file
634Lib/plat-os2emx/_emx_link.py. This is imported into the os module, and
635becomes available as os.link() in the normal way.
636
637The emulation copies the source file in binary mode, and will fail if
638disk space is exhausted. The call fails if the target already exists.
639There are no guarantees to thread safety with this emulation - beware!
640
641The emulation was written to support a link() based file locking system
642used in GNU Mailman.
643
Andrew MacIntyreb8882002004-04-11 12:05:28 +000064426. AF_UNIX sockets, otherwise known as Unix domain sockets, are now
645supported. Unfortunately, there are some traps arising from the
646implementation in IBM's TCP/IP stack:-
647- the path name must start with '\\socket\\' ('/socket/' won't work!),
648 with the length of the full path name less than 108 characters;
649- unlike Unix, the socket endpoints don't exist in the filesystem;
650- by default, sockets are in binary mode.
651
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000652... probably other issues that I've not encountered, or don't remember :-(
653
654If you encounter other difficulties with this port, which can be
655characterised as peculiar to this port rather than to the Python release,
656I would like to hear about them. However I cannot promise to be able to do
657anything to resolve such problems. See the Contact section below...
658
659
660To do...
661--------
662
663In no particular order of apparent importance or likelihood...
664
665- support Tkinter and/or alternative GUI (wxWindows??)
666
667
668Credits
669-------
670
671In addition to people identified above, I'd like to thank:
672- the BDFL, Guido van Rossum, and crew for Python;
673- Dr David Mertz, for trying out a pre-release of this port;
674- the Python-list/comp.lang.python community;
675- John Poltorak, for input about pwd/grp.
676
677Contact
678-------
679
680Constructive feedback, negative or positive, about this port is welcome
681and should be addressed to me at the e-mail addresses below.
682
Andrew MacIntyre631e87f2003-04-21 14:33:04 +0000683I have a private mailing list for announcements of fixes & updates to
684this port. If you wish to receive such e-mail announcments, please send
685me an e-mail requesting that you be added to this list.
Andrew MacIntyre41d97d62002-02-17 05:23:30 +0000686
687Andrew MacIntyre
688E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au
689Web: http://www.andymac.org/
690
Andrew MacIntyreb8882002004-04-11 12:05:28 +000069111 April, 2004.