469,579 Members | 1,023 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Success Natively Compiling Python-2.3.4 in Mingw?

Hello all.

After a search on Google it would seem that the users of
Mingw have not had good results in compiling the python
sources natively. See at least:

[1] http://uucode.com/texts/python-mingw/python-mingw.html
Having said that, kindly allow me to report that Mingw32 can
now compile python-2.3.4 sources natively. Both Mingw make files
and DEV-C++ project files can now compile the python sources.
There is surely more to be done to remove even more rough
edges; but the results are very promising.

The compiled python is, for now, renamed to python23 so as to keep
my clean working copy of Python-2.1 unaffected.
+---------------------------------------------------------------+
My system:
+---------------------------------------------------------------+
+ Win98
+ Mingw v. 3.2
+ DEV-C++ v. 4.9.8.5
+ MYSYS v. 1.0.9
+---------------------------------------------------------------+
For file sizes, here is the list:
+---------------------------------------------------------------+
PYTHON23 EXE 11,776 20/06/04 19:24 python23.exe
PYTHONW EXE 12,800 20/06/04 19:29 pythonw.exe
PYTHON23 DLL 1,224,704 20/06/04 20:05 python23.dll
W9XPOPEN EXE 12,288 19/06/04 8:07 w9xpopen.exe
+---------------------------------------------------------------+
Running python23 from MSYS:
+---------------------------------------------------------------+
$ python23 -i
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information.
1+2 3

+---------------------------------------------------------------+
Summary of regrtest.main() output:
+---------------------------------------------------------------+
204 tests OK.
1 test failed:
test_datetime
50 tests skipped:
test_aepack test_al test_bsddb test_bsddb185 test_bsddb3 test_bz2
test_cd test_cl test_commands test_crypt test_curses test_dbm
test_dl test_email_codecs test_fcntl test_fork1 test_gdbm test_gl
test_grp test_gzip test_imgfile test_ioctl test_largefile
test_linuxaudiodev test_macfs test_macostools test_mhlib test_mpz
test_nis test_normalization test_openpty test_ossaudiodev
test_pep277 test_plistlib test_poll test_posix test_pty test_pwd
test_resource test_scriptpackages test_signal test_socket_ssl
test_socketserver test_sunaudiodev test_timeout test_timing
test_urllibnet test_zipfile test_zipimport test_zlib
6 skips unexpected on win32:
test_bz2 test_zipfile test_bsddb test_zipimport test_gzip
test_zlib
+---------------------------------------------------------------+
More on test_datetime:
+---------------------------------------------------------------+
E:\Python23>python23
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information. from test import test_datetime Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\PYTHON23\lib\test\test_datetime.py", line 2821, in ?
Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
TypeError: cannot create 'USTimeZone' instances

+---------------------------------------------------------------+
A closer inspection of test test_socket:
+---------------------------------------------------------------+
$ /e/python23/python23.exe -i
Python 2.3.4 (#0, Jun 20 2004, 04:00:28) [Mingw 32 bit (AMD)] on win32
Type "help", "copyright", "credits" or "license" for more information. import test_socket as t
t.test_main() testCrucialConstants (test_socket.GeneralModuleTests) ... ok
testDefaultTimeout (test_socket.GeneralModuleTests) ... ok
testGetServByName (test_socket.GeneralModuleTests) ... ok
testGetSockOpt (test_socket.GeneralModuleTests) ... ok
testHostnameRes (test_socket.GeneralModuleTests) ... ok
testIPv4toString (test_socket.GeneralModuleTests) ... ok
testIPv6toString (test_socket.GeneralModuleTests) ... ok
testInterpreterCrash (test_socket.GeneralModuleTests) ... ok
testNtoH (test_socket.GeneralModuleTests) ... ok
testRefCountGetNameInfo (test_socket.GeneralModuleTests) ... ok
testSendAfterClose (test_socket.GeneralModuleTests) ... ok
testSetSockOpt (test_socket.GeneralModuleTests) ... ok
testSockName (test_socket.GeneralModuleTests) ... ok
testSocketError (test_socket.GeneralModuleTests) ... ok
testStringToIPv4 (test_socket.GeneralModuleTests) ... ok
testStringToIPv6 (test_socket.GeneralModuleTests) ... ok
testFromFd (test_socket.BasicTCPTest) ... ok
testOverFlowRecv (test_socket.BasicTCPTest) ... ok
testOverFlowRecvFrom (test_socket.BasicTCPTest) ... ok
testRecv (test_socket.BasicTCPTest) ... ok
testRecvFrom (test_socket.BasicTCPTest) ... ok
testSendAll (test_socket.BasicTCPTest) ... ok
testShutdown (test_socket.BasicTCPTest) ... ok
testTCPTimeout (test_socket.TCPTimeoutTest) ... ok
testTimeoutZero (test_socket.TCPTimeoutTest) ... ok
testExceptionTree (test_socket.TestExceptions) ... ok
testRecvFrom (test_socket.BasicUDPTest) ... ok
testSendtoAndRecv (test_socket.BasicUDPTest) ... ok
testTimeoutZero (test_socket.UDPTimeoutTest) ... ok
testUDPTimeout (test_socket.UDPTimeoutTest) ... ok
testAccept (test_socket.NonBlockingTCPTests) ... ERROR
ERROR
testConnect (test_socket.NonBlockingTCPTests) ... ok
testRecv (test_socket.NonBlockingTCPTests) ... ERROR
testSetBlocking (test_socket.NonBlockingTCPTests) ... ok
testFullRead (test_socket.FileObjectClassTestCase) ... ok
testReadline (test_socket.FileObjectClassTestCase) ... ok
testSmallRead (test_socket.FileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.FileObjectClassTestCase) ... ok
testFullRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedReadline (test_socket.UnbufferedFileObjectClassTestCase) ... ok
testFullRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.LineBufferedFileObjectClassTestCase) ... ok
testFullRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testReadline (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testSmallRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (test_socket.SmallBufferedFileObjectClassTestCase) ... ok

================================================== ====================
ERROR: testAccept (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 543, in testAccept
read, write, err = select.select([self.serv], [], [])
ValueError: filedescriptor out of range in select()

================================================== ====================
ERROR: testAccept (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 117, in _tearDown
self.fail(msg)
File "E:\PYTHON234\PYTHON-2.3.4\lib\unittest.py", line 270, in fail
raise self.failureException, msg
AssertionError: (10061, 'Connection refused')

================================================== ====================
ERROR: testRecv (test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "E:\PYTHON23\lib\test\test_socket.py", line 571, in testRecv
read, write, err = select.select([conn], [], [])
ValueError: filedescriptor out of range in select()

----------------------------------------------------------------------
Ran 51 tests in 14.340s

FAILED (errors=3)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "E:\PYTHON23\lib\test\test_socket.py", line 752, in test_main
test_support.run_unittest(*tests)
File "test_support.py", line 262, in run_unittest
run_suite(suite, testclass)
File "test_support.py", line 246, in run_suite
raise TestFailed(msg)
test.test_support.TestFailed: errors occurred; run in verbose mode for details

+---------------------------------------------------------------+
Test test_socket passes or fails?
+---------------------------------------------------------------+
Why regrtest.main() is reporting that test_socket passes, when
test_socket itself reports that it fails is beyond me. Mind you,
however, that the socket module itself can run the simple echo
client/server(s) that were modified by me and which came with
python21 without problems.
+---------------------------------------------------------------+
Summary of changes:
+---------------------------------------------------------------+
Number of files changed in source Python-2.3.4.tar.bz2: 10
+---------------------------------------------------------------+
Overview of all changes which number 16:
+---------------------------------------------------------------+
[1] 3 changes in socketmodule.c
[2] 1 change in socketmodule.h
(The test fails or passes?)
[3] 2 changes in posixmodule.c
[4] 1 change in _csv.c
[5] 5 changes in datetimemodule.c
(test_datetime.py is the (only?) test that fails;
Note that the module appears loadable, however.
And seems able to run some of its methods; after all
test_calendar passes).
[6] 1 change in _winreg.c
[7] 1 change in ../PC/pyconfig.h
[8] Not using python_nt.rc
(Using pythoncore_private.rc, & python_mingw.rc instead).
[9] 1 change in dynload_win.c
[10] 1 change in thread_pthread.c (This file is ignored, I think).
+---------------------------------------------------------------+
Sources are guarded:
+---------------------------------------------------------------+
Most changes guard the original source and are in the form of:
/* My addition/change */
/* Comment...*/
#if defined(__MINGW32__)
/*define or do something*/
#else
original python source code here
#endif
+---------------------------------------------------------------+
Last words:
+---------------------------------------------------------------+
If someone can kindly verify that the failed tests are not
serious (they don't seem to be; I even don't have the datetime
module in my current Python-2.1) or can be fixed, or if many people
are interested in documentation of the source changes, then I'll
be more than happy to share them.

Peace

--
Q. The purpose of life?

[A]: "I created the jinn and humankind only that they might
worship Me." (Translation, Qur'an, 51:56)

[b]: "Let us hear the conclusion of the whole matter:
Fear God, and keep his commandments: for this is the
whole duty of man." (KJV, Ecclesiastes 12:13)
Jul 18 '05 #1
1 2315
ab***@earth.co.jp (A. B., Khalid) wrote in message news:<8a**************************@posting.google. com>...
Hello all.
If someone can kindly verify that the failed tests are not
serious (they don't seem to be; I even don't have the datetime
module in my current Python-2.1) or can be fixed, or if many people
are interested in documentation of the source changes, then I'll
be more than happy to share them.

Peace


Providing patches for a working mingw compilation would be great.

Carl
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Stephan Deibel | last post: by
reply views Thread by Johnathan Doe | last post: by
reply views Thread by Stephan Deibel | last post: by
29 posts views Thread by Maurice LING | last post: by
1 post views Thread by Matej Kenda | last post: by
reply views Thread by mmarkzon | last post: by
reply views Thread by phoolimin | last post: by
1 post views Thread by krishnakant Mane | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.