Index: Include/osdefs.h
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Include/osdefs.h,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Include/osdefs.h	2001/05/02 21:48:07	1.1.1.1
+++ Include/osdefs.h	2001/05/02 23:07:45	1.1.1.1.2.1
@@ -30,6 +30,15 @@
 #define DELIM ','
 #endif
 
+/* o.flebbe@science-computing.de */
+#ifdef __SYMBIAN32__
+#define SEP '\\'
+#define ALTSEP '/'
+#define MAXPATHLEN 256
+#define DELIM ';'
+#define PREFIX "?:"
+#define EXEC_PREFIX "?:"
+#endif
 
 /* Filename separator */
 #ifndef SEP
Index: Include/pythonrun.h
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Include/pythonrun.h,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Include/pythonrun.h	2001/05/02 21:48:07	1.1.1.1
+++ Include/pythonrun.h	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -84,10 +84,10 @@
 DL_IMPORT(PyObject *) _PyBuiltin_Init(void);
 DL_IMPORT(PyObject *) _PySys_Init(void);
 DL_IMPORT(void) _PyImport_Init(void);
-DL_IMPORT(void) init_exceptions(void);
+//DL_IMPORT(void) init_exceptions(void);
 
 /* Various internal finalizers */
-DL_IMPORT(void) fini_exceptions(void);
+//DL_IMPORT(void) fini_exceptions(void);
 DL_IMPORT(void) _PyImport_Fini(void);
 DL_IMPORT(void) PyMethod_Fini(void);
 DL_IMPORT(void) PyFrame_Fini(void);
Index: Lib/BaseHTTPServer.py
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Lib/BaseHTTPServer.py,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Lib/BaseHTTPServer.py	2001/05/02 21:48:08	1.1.1.1
+++ Lib/BaseHTTPServer.py	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -87,7 +87,7 @@
 
 class HTTPServer(SocketServer.TCPServer):
 
-    allow_reuse_address = 1    # Seems to make sense in testing environment
+    allow_reuse_address = 0    # Seems to make sense in testing environment, but EPOC doesnt have it
 
     def server_bind(self):
         """Override server_bind to store the server name."""
Index: Lib/SocketServer.py
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Lib/SocketServer.py,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Lib/SocketServer.py	2001/05/02 21:48:08	1.1.1.1
+++ Lib/SocketServer.py	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -529,7 +529,9 @@
     # read and we need to flush the line; (b) big writes to unbuffered
     # files are typically optimized by stdio even when big reads
     # aren't.
-    rbufsize = -1
+
+	# EPOC is confused when reading from buffered sockets ;-(
+    rbufsize = 0
     wbufsize = 0
 
     def setup(self):
Index: Lib/os.py
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Lib/os.py,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Lib/os.py	2001/05/02 21:48:08	1.1.1.1
+++ Lib/os.py	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -1,4 +1,4 @@
-r"""OS routines for Mac, DOS, NT, or Posix depending on what system we're on.
+"""OS routines for Mac, DOS, NT, or Posix depending on what system we're on.
 
 This exports:
   - all functions from posix, nt, dos, os2, mac, or ce, e.g. unlink, stat, etc.
@@ -146,6 +146,25 @@
     import ce
     __all__.extend(_get_exports_list(ce))
     del ce
+elif 'epoc' in _names:
+    name = 'epoc'
+    linesep = '\r\n'
+    curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';' ; altsep='/' ;
+    defpath = '?:\\System\\Programs'
+    from epoc import *
+    for i in ['_exit']:
+        try:
+            exec "from epoc import " + i
+        except ImportError:
+            pass
+    # We can use the standard Windows path.
+    import ntpath
+    path = ntpath
+    del ntpath
+
+    import epoc
+    __all__.extend(_get_exports_list(epoc))
+    del epoc
 
 elif 'riscos' in _names:
     name = 'riscos'
Index: Modules/_sre.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Modules/_sre.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Modules/_sre.c	2001/05/02 21:48:10	1.1.1.1
+++ Modules/_sre.c	2001/05/07 20:12:06	1.1.1.1.2.1
@@ -347,10 +347,11 @@
 #define SRE_SEARCH sre_search
 
 #if defined(HAVE_UNICODE)
-
+#ifndef MAKMAKE  /* epoc32 makmake workaround */
 #define SRE_RECURSIVE
 #include "_sre.c"
 #undef SRE_RECURSIVE
+#endif
 
 #undef SRE_SEARCH
 #undef SRE_MATCH
Index: Modules/posixmodule.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Modules/posixmodule.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.2
diff -u -r1.1.1.1 -r1.1.1.1.2.2
--- Modules/posixmodule.c	2001/05/02 21:48:11	1.1.1.1
+++ Modules/posixmodule.c	2001/05/06 09:21:05	1.1.1.1.2.2
@@ -110,6 +110,21 @@
 #endif  /* ! __WATCOMC__ || __QNX__ */
 #endif /* ! __IBMC__ */
 
+#ifdef __SYMBIAN32__
+#undef HAVE_EXECV      
+#undef HAVE_FORK
+#undef HAVE_GETEGID    
+#undef HAVE_GETEUID    
+#undef HAVE_GETGID     
+#undef HAVE_GETPPID    
+#undef HAVE_GETUID     
+#undef HAVE_KILL       
+#undef HAVE_PIPE       
+#undef HAVE_POPEN      
+#undef HAVE_SYSTEM	
+#undef HAVE_WAIT       
+#undef HAVE_TTYNAME
+#endif 
 #ifndef _MSC_VER
 
 #ifdef HAVE_UNISTD_H
@@ -1141,6 +1156,7 @@
 #endif
 
 
+#ifdef HAVE_UMASK
 static char posix_umask__doc__[] =
 "umask(new_mask) -> old_mask\n\
 Set the current numeric umask and return the previous umask.";
@@ -1156,7 +1172,7 @@
 		return posix_error();
 	return PyInt_FromLong((long)i);
 }
-
+#endif
 
 static char posix_unlink__doc__[] =
 "unlink(path) -> None\n\
@@ -1200,6 +1216,7 @@
 #endif /* HAVE_UNAME */
 
 
+#ifdef HAVE_UTIME
 static char posix_utime__doc__[] =
 "utime(path, (atime, utime)) -> None\n\
 utime(path, None) -> None\n\
@@ -1255,7 +1272,7 @@
 #undef ATIME
 #undef MTIME
 }
-
+#endif
 
 /* Process operations */
 
@@ -5269,13 +5286,17 @@
 #ifdef HAVE_SYSTEM
 	{"system",	posix_system, METH_VARARGS, posix_system__doc__},
 #endif
+#ifdef HAVE_UMASK
 	{"umask",	posix_umask, METH_VARARGS, posix_umask__doc__},
+#endif
 #ifdef HAVE_UNAME
 	{"uname",	posix_uname, METH_VARARGS, posix_uname__doc__},
 #endif /* HAVE_UNAME */
 	{"unlink",	posix_unlink, METH_VARARGS, posix_unlink__doc__},
 	{"remove",	posix_unlink, METH_VARARGS, posix_remove__doc__},
+#ifdef HAVE_UTIME
 	{"utime",	posix_utime, METH_VARARGS, posix_utime__doc__},
+#endif
 #ifdef HAVE_TIMES
 	{"times",	posix_times, METH_VARARGS, posix_times__doc__},
 #endif /* HAVE_TIMES */
@@ -5625,8 +5646,13 @@
 #define INITFUNC initos2
 #define MODNAME "os2"
 #else
+#if defined(__SYMBIAN32__)
+#define INITFUNC initepoc
+#define MODNAME "epoc"
+#else
 #define INITFUNC initposix
 #define MODNAME "posix"
+#endif
 #endif
 #endif
 
Index: Modules/python.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Modules/python.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Modules/python.c	2001/05/02 21:48:11	1.1.1.1
+++ Modules/python.c	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -7,5 +7,8 @@
 int
 main(int argc, char **argv)
 {
+#ifdef __SYMBIAN32__
+	Python_epoc_init(& argc, &argv);
+#endif
 	return Py_Main(argc, argv);
 }
Index: Modules/socketmodule.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Modules/socketmodule.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Modules/socketmodule.c	2001/05/02 21:48:11	1.1.1.1
+++ Modules/socketmodule.c	2001/05/06 09:21:05	1.1.1.1.2.1
@@ -140,7 +140,10 @@
 
 #include <sys/types.h>
 
+#ifdef HAVE_SIGNAL_H
 #include <signal.h>
+#endif
+
 #ifndef MS_WINDOWS
 #include <netdb.h>
 #include <sys/socket.h>
@@ -242,6 +245,9 @@
 #endif
 
 
+#ifdef __SYMBIAN32__
+#undef SO_REUSEADDR
+#endif
 /* Convenience function to raise an error according to errno
    and return a NULL pointer from a function. */
 
@@ -831,6 +837,8 @@
 info is a pair (hostaddr, port).";
 
 
+#ifndef __SYMBIAN32__
+
 /* s.setblocking(1 | 0) method */
 
 static PyObject *
@@ -880,7 +888,7 @@
 \n\
 Set the socket to blocking (flag is true) or non-blocking (false).\n\
 This uses the FIONBIO ioctl with the O_NDELAY flag.";
-
+#endif
 
 #ifdef RISCOS
 /* s.sleeptaskw(1 | 0) method */
@@ -1518,8 +1526,10 @@
 			send_doc},
 	{"sendto",	(PyCFunction)PySocketSock_sendto, METH_VARARGS,
 			sendto_doc},
+#ifndef __SYMBIAN32__
 	{"setblocking",	(PyCFunction)PySocketSock_setblocking, METH_VARARGS,
 			setblocking_doc},
+#endif
 	{"setsockopt",	(PyCFunction)PySocketSock_setsockopt, METH_VARARGS,
 			setsockopt_doc},
 	{"shutdown",	(PyCFunction)PySocketSock_shutdown, METH_VARARGS,
@@ -2607,7 +2617,9 @@
 /* We have incomplete socket support. */
 	insint(d, "SOCK_RAW", SOCK_RAW);
 	insint(d, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+#ifndef __SYMBIAN32__
 	insint(d, "SOCK_RDM", SOCK_RDM);
+#endif
 #endif
 
 #ifdef	SO_DEBUG
Index: Modules/timemodule.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Modules/timemodule.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Modules/timemodule.c	2001/05/02 21:48:11	1.1.1.1
+++ Modules/timemodule.c	2001/05/20 21:18:35	1.1.1.1.2.1
@@ -146,6 +146,20 @@
 }
 #endif /* HAVE_CLOCK */
 
+#if defined( __SYMBIAN32__)
+extern double epoc_clock();
+
+static PyObject *
+time_clock(PyObject *self, PyObject *args)
+{
+	if (!PyArg_ParseTuple(args, ":clock"))
+		return NULL;
+	return PyFloat_FromDouble(epoc_clock());
+}
+#define HAVE_CLOCK /* So it gets included in the methods */
+
+#endif
+
 #if defined(MS_WIN32) && !defined(MS_WIN64)
 /* Due to Mark Hammond */
 static PyObject *
@@ -506,7 +520,7 @@
 
 static PyMethodDef time_methods[] = {
 	{"time",	time_time, METH_VARARGS, time_doc},
-#ifdef HAVE_CLOCK
+#if defined( HAVE_CLOCK)
 	{"clock",	time_clock, METH_VARARGS, clock_doc},
 #endif
 	{"sleep",	time_sleep, METH_VARARGS, sleep_doc},
Index: Python/import.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Python/import.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.2
diff -u -r1.1.1.1 -r1.1.1.1.2.2
--- Python/import.c	2001/05/02 21:48:12	1.1.1.1
+++ Python/import.c	2001/06/17 20:59:39	1.1.1.1.2.2
@@ -634,7 +634,7 @@
 static FILE *
 open_exclusive(char *filename)
 {
-#if defined(O_EXCL)&&defined(O_CREAT)&&defined(O_WRONLY)&&defined(O_TRUNC)
+#if defined(O_EXCL)&&defined(O_CREAT)&&defined(O_WRONLY)&&defined(O_TRUNC)&&!defined(__SYMBIAN32__)
 	/* Use O_EXCL to avoid a race condition when another process tries to
 	   write the same file.  When that happens, our open() call fails,
 	   which is just fine (since it's only a cache).
Index: Python/pythonrun.c
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Python/pythonrun.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
--- Python/pythonrun.c	2001/05/02 21:48:12	1.1.1.1
+++ Python/pythonrun.c	2001/05/02 23:07:45	1.1.1.1.2.1
@@ -1395,10 +1395,15 @@
 	sigaction(sig, NULL, &context);
 	return context.sa_handler;
 #else
+#ifdef HAVE_SIGNAL_H
 	PyOS_sighandler_t handler;
 	handler = signal(sig, SIG_IGN);
 	signal(sig, handler);
+
 	return handler;
+#else
+	return NULL;
+#endif
 #endif
 }
 
@@ -1414,6 +1419,9 @@
 	sigaction(sig, &context, NULL);
 	return oldhandler;
 #else
+#ifdef HAVE_SIGNAL_H
+
 	return signal(sig, handler);
+#endif
 #endif
 }
Index: RISCOS/support/AddToPath
===================================================================
RCS file: /cvsroot/epocpython/epocpython/RISCOS/support/AddToPath,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
Binary files /tmp/cvswEZpF5 and /tmp/cvs8ULrY5 differ
Index: Tools/idle/Icons/folder.gif
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Tools/idle/Icons/folder.gif,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
Binary files /tmp/cvs6A9kB8 and /tmp/cvs4Sccfb differ
Index: Tools/idle/Icons/minusnode.gif
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Tools/idle/Icons/minusnode.gif,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
Binary files /tmp/cvs0LXxYd and /tmp/cvsmCwrGg differ
Index: Tools/idle/Icons/tk.gif
===================================================================
RCS file: /cvsroot/epocpython/epocpython/Tools/idle/Icons/tk.gif,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.2.1
diff -u -r1.1.1.1 -r1.1.1.1.2.1
Binary files /tmp/cvs0h7Caj and /tmp/cvsInujDl differ
