[Python-3000-checkins] r57116 - in python/branches/py3k: Doc/library/tempfile.rst Lib/os.py Lib/plat-mac/bundlebuilder.py Lib/site.py Lib/tempfile.py Lib/test/regrtest.py Lib/test/test_bz2.py Lib/test/test_mhlib.py Lib/test/test_select.py Lib/test/test_signal.py Lib/test/test_support.py Lib/test/test_threadsignals.py Lib/test/test_urllib2.py Lib/urllib.py Tools/freeze/freeze.py

skip.montanaro python-3000-checkins at python.org
Fri Aug 17 04:30:30 CEST 2007


Author: skip.montanaro
Date: Fri Aug 17 04:30:27 2007
New Revision: 57116

Modified:
   python/branches/py3k/Doc/library/tempfile.rst
   python/branches/py3k/Lib/os.py
   python/branches/py3k/Lib/plat-mac/bundlebuilder.py
   python/branches/py3k/Lib/site.py
   python/branches/py3k/Lib/tempfile.py
   python/branches/py3k/Lib/test/regrtest.py
   python/branches/py3k/Lib/test/test_bz2.py
   python/branches/py3k/Lib/test/test_mhlib.py
   python/branches/py3k/Lib/test/test_select.py
   python/branches/py3k/Lib/test/test_signal.py
   python/branches/py3k/Lib/test/test_support.py
   python/branches/py3k/Lib/test/test_threadsignals.py
   python/branches/py3k/Lib/test/test_urllib2.py
   python/branches/py3k/Lib/urllib.py
   python/branches/py3k/Tools/freeze/freeze.py
Log:
some RiscOS stuff I missed before (was only looking for "RISCOS")

Modified: python/branches/py3k/Doc/library/tempfile.rst
==============================================================================
--- python/branches/py3k/Doc/library/tempfile.rst	(original)
+++ python/branches/py3k/Doc/library/tempfile.rst	Fri Aug 17 04:30:27 2007
@@ -171,9 +171,6 @@
 
    #. A platform-specific location:
 
-      * On RiscOS, the directory named by the :envvar:`Wimp$ScrapDir` environment
-        variable.
-
       * On Windows, the directories :file:`C:\\TEMP`, :file:`C:\\TMP`,
         :file:`\\TEMP`, and :file:`\\TMP`, in that order.
 

Modified: python/branches/py3k/Lib/os.py
==============================================================================
--- python/branches/py3k/Lib/os.py	(original)
+++ python/branches/py3k/Lib/os.py	Fri Aug 17 04:30:27 2007
@@ -3,7 +3,7 @@
 This exports:
   - all functions from posix, nt, os2, mac, or ce, e.g. unlink, stat, etc.
   - os.path is one of the modules posixpath, ntpath, or macpath
-  - os.name is 'posix', 'nt', 'os2', 'mac', 'ce' or 'riscos'
+  - os.name is 'posix', 'nt', 'os2', 'mac' or 'ce'
   - os.curdir is a string representing the current directory ('.' or ':')
   - os.pardir is a string representing the parent directory ('..' or '::')
   - os.sep is the (or a most common) pathname separator ('/' or ':' or '\\')
@@ -112,20 +112,6 @@
     __all__.extend(_get_exports_list(ce))
     del ce
 
-elif 'riscos' in _names:
-    name = 'riscos'
-    linesep = '\n'
-    from riscos import *
-    try:
-        from riscos import _exit
-    except ImportError:
-        pass
-    import riscospath as path
-
-    import riscos
-    __all__.extend(_get_exports_list(riscos))
-    del riscos
-
 else:
     raise ImportError, 'no os specific module found'
 
@@ -404,62 +390,58 @@
     raise error, last_exc, tb
 
 
-if name == "riscos":
-    # On RISC OS, all env access goes through getenv and putenv
-    from riscosenviron import _Environ
-else:
-    # Change environ to automatically call putenv(), unsetenv if they exist.
-    from _abcoll import MutableMapping  # Can't use collections (bootstrap)
+# Change environ to automatically call putenv(), unsetenv if they exist.
+from _abcoll import MutableMapping  # Can't use collections (bootstrap)
 
-    class _Environ(MutableMapping):
-        def __init__(self, environ, keymap, putenv, unsetenv):
-            self.keymap = keymap
-            self.putenv = putenv
-            self.unsetenv = unsetenv
-            self.data = data = {}
-            for key, value in environ.items():
-                data[keymap(key)] = str(value)
-        def __getitem__(self, key):
-            return self.data[self.keymap(key)]
-        def __setitem__(self, key, value):
-            value = str(value)
-            self.putenv(key, value)
-            self.data[self.keymap(key)] = value
-        def __delitem__(self, key):
-            self.unsetenv(key)
-            del self.data[self.keymap(key)]
-        def __iter__(self):
-            for key in self.data:
-                yield key
-        def __len__(self):
-            return len(self.data)
-        def copy(self):
-            return dict(self)
-        def setdefault(self, key, value):
-            if key not in self:
-                self[key] = value
-            return self[key]
+class _Environ(MutableMapping):
+    def __init__(self, environ, keymap, putenv, unsetenv):
+        self.keymap = keymap
+        self.putenv = putenv
+        self.unsetenv = unsetenv
+        self.data = data = {}
+        for key, value in environ.items():
+            data[keymap(key)] = str(value)
+    def __getitem__(self, key):
+        return self.data[self.keymap(key)]
+    def __setitem__(self, key, value):
+        value = str(value)
+        self.putenv(key, value)
+        self.data[self.keymap(key)] = value
+    def __delitem__(self, key):
+        self.unsetenv(key)
+        del self.data[self.keymap(key)]
+    def __iter__(self):
+        for key in self.data:
+            yield key
+    def __len__(self):
+        return len(self.data)
+    def copy(self):
+        return dict(self)
+    def setdefault(self, key, value):
+        if key not in self:
+            self[key] = value
+        return self[key]
 
-    try:
-        _putenv = putenv
-    except NameError:
-        _putenv = lambda key, value: None
-    else:
-        __all__.append("putenv")
+try:
+    _putenv = putenv
+except NameError:
+    _putenv = lambda key, value: None
+else:
+    __all__.append("putenv")
 
-    try:
-        _unsetenv = unsetenv
-    except NameError:
-        _unsetenv = lambda key: _putenv(key, "")
-    else:
-        __all__.append("unsetenv")
+try:
+    _unsetenv = unsetenv
+except NameError:
+    _unsetenv = lambda key: _putenv(key, "")
+else:
+    __all__.append("unsetenv")
 
-    if name in ('os2', 'nt'): # Where Env Var Names Must Be UPPERCASE
-        _keymap = lambda key: str(key.upper())
-    else:  # Where Env Var Names Can Be Mixed Case
-        _keymap = lambda key: str(key)
+if name in ('os2', 'nt'): # Where Env Var Names Must Be UPPERCASE
+    _keymap = lambda key: str(key.upper())
+else:  # Where Env Var Names Can Be Mixed Case
+    _keymap = lambda key: str(key)
 
-    environ = _Environ(environ, _keymap, _putenv, _unsetenv)
+environ = _Environ(environ, _keymap, _putenv, _unsetenv)
 
 
 def getenv(key, default=None):

Modified: python/branches/py3k/Lib/plat-mac/bundlebuilder.py
==============================================================================
--- python/branches/py3k/Lib/plat-mac/bundlebuilder.py	(original)
+++ python/branches/py3k/Lib/plat-mac/bundlebuilder.py	Fri Aug 17 04:30:27 2007
@@ -272,7 +272,7 @@
 
 MAYMISS_MODULES = ['mac', 'os2', 'nt', 'ntpath', 'dos', 'dospath',
     'win32api', 'ce', '_winreg', 'nturl2path', 'sitecustomize',
-    'org.python.core', 'riscos', 'riscosenviron', 'riscospath'
+    'org.python.core'
 ]
 
 STRIP_EXEC = "/usr/bin/strip"

Modified: python/branches/py3k/Lib/site.py
==============================================================================
--- python/branches/py3k/Lib/site.py	(original)
+++ python/branches/py3k/Lib/site.py	Fri Aug 17 04:30:27 2007
@@ -180,7 +180,7 @@
         prefixes.append(sys.exec_prefix)
     for prefix in prefixes:
         if prefix:
-            if sys.platform in ('os2emx', 'riscos'):
+            if sys.platform == 'os2emx':
                 sitedirs = [os.path.join(prefix, "Lib", "site-packages")]
             elif os.sep == '/':
                 sitedirs = [os.path.join(prefix,

Modified: python/branches/py3k/Lib/tempfile.py
==============================================================================
--- python/branches/py3k/Lib/tempfile.py	(original)
+++ python/branches/py3k/Lib/tempfile.py	Fri Aug 17 04:30:27 2007
@@ -159,9 +159,6 @@
             dirlist.append(dirname)
         except _Folder.error:
             pass
-    elif _os.name == 'riscos':
-        dirname = _os.getenv('Wimp$ScrapDir')
-        if dirname: dirlist.append(dirname)
     elif _os.name == 'nt':
         dirlist.extend([ r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
     else:

Modified: python/branches/py3k/Lib/test/regrtest.py
==============================================================================
--- python/branches/py3k/Lib/test/regrtest.py	(original)
+++ python/branches/py3k/Lib/test/regrtest.py	Fri Aug 17 04:30:27 2007
@@ -947,33 +947,6 @@
         test_threadedtempfile
         test_threading
         """,
-    'riscos':
-        """
-        test_asynchat
-        test_atexit
-        test_bsddb
-        test_bsddb3
-        test_commands
-        test_crypt
-        test_dbm
-        test_dl
-        test_fcntl
-        test_fork1
-        test_gdbm
-        test_grp
-        test_largefile
-        test_locale
-        test_mmap
-        test_openpty
-        test_poll
-        test_pty
-        test_pwd
-        test_sundry
-        test_thread
-        test_threaded_import
-        test_threadedtempfile
-        test_threading
-        """,
     'darwin':
         """
         test__locale

Modified: python/branches/py3k/Lib/test/test_bz2.py
==============================================================================
--- python/branches/py3k/Lib/test/test_bz2.py	(original)
+++ python/branches/py3k/Lib/test/test_bz2.py	Fri Aug 17 04:30:27 2007
@@ -11,7 +11,7 @@
 import bz2
 from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
 
-has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx", "riscos")
+has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx")
 
 class BaseTest(unittest.TestCase):
     "Base for other testcases."

Modified: python/branches/py3k/Lib/test/test_mhlib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_mhlib.py	(original)
+++ python/branches/py3k/Lib/test/test_mhlib.py	Fri Aug 17 04:30:27 2007
@@ -13,8 +13,7 @@
 import sys
 import mhlib
 
-if (sys.platform.startswith("win") or sys.platform=="riscos" or
-      sys.platform.startswith("atheos")):
+if sys.platform.startswith("win") or sys.platform.startswith("atheos"):
     # mhlib.updateline() renames a file to the name of a file that already
     # exists.  That causes a reasonable OS <wink> to complain in test_sequence
     # here, like the "OSError: [Errno 17] File exists" raised on Windows.

Modified: python/branches/py3k/Lib/test/test_select.py
==============================================================================
--- python/branches/py3k/Lib/test/test_select.py	(original)
+++ python/branches/py3k/Lib/test/test_select.py	Fri Aug 17 04:30:27 2007
@@ -42,7 +42,7 @@
 
 def test():
     import sys
-    if sys.platform[:3] in ('win', 'mac', 'os2', 'riscos'):
+    if sys.platform[:3] in ('win', 'mac', 'os2'):
         if verbose:
             print("Can't test select easily on", sys.platform)
         return

Modified: python/branches/py3k/Lib/test/test_signal.py
==============================================================================
--- python/branches/py3k/Lib/test/test_signal.py	(original)
+++ python/branches/py3k/Lib/test/test_signal.py	Fri Aug 17 04:30:27 2007
@@ -3,7 +3,7 @@
 import signal
 import os, sys, time
 
-if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
+if sys.platform[:3] in ('win', 'os2'):
     raise TestSkipped, "Can't test signal on %s" % sys.platform
 
 MAX_DURATION = 20   # Entire test should last at most 20 sec.

Modified: python/branches/py3k/Lib/test/test_support.py
==============================================================================
--- python/branches/py3k/Lib/test/test_support.py	(original)
+++ python/branches/py3k/Lib/test/test_support.py	Fri Aug 17 04:30:27 2007
@@ -142,8 +142,6 @@
 if os.name == 'java':
     # Jython disallows @ in module names
     TESTFN = '$test'
-elif os.name == 'riscos':
-    TESTFN = 'testfile'
 else:
     TESTFN = '@test'
 

Modified: python/branches/py3k/Lib/test/test_threadsignals.py
==============================================================================
--- python/branches/py3k/Lib/test/test_threadsignals.py	(original)
+++ python/branches/py3k/Lib/test/test_threadsignals.py	Fri Aug 17 04:30:27 2007
@@ -7,7 +7,7 @@
 import sys
 from test.test_support import run_unittest, TestSkipped
 
-if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
+if sys.platform[:3] in ('win', 'os2'):
     raise TestSkipped, "Can't test signal on %s" % sys.platform
 
 process_pid = os.getpid()

Modified: python/branches/py3k/Lib/test/test_urllib2.py
==============================================================================
--- python/branches/py3k/Lib/test/test_urllib2.py	(original)
+++ python/branches/py3k/Lib/test/test_urllib2.py	Fri Aug 17 04:30:27 2007
@@ -26,10 +26,6 @@
         # urllib.pathname2url works, unfortunately...
         if os.name == 'mac':
             fname = '/' + fname.replace(':', '/')
-        elif os.name == 'riscos':
-            import string
-            fname = os.expand(fname)
-            fname = fname.translate(string.maketrans("/.", "./"))
 
         file_url = "file://%s" % fname
         f = urllib2.urlopen(file_url)

Modified: python/branches/py3k/Lib/urllib.py
==============================================================================
--- python/branches/py3k/Lib/urllib.py	(original)
+++ python/branches/py3k/Lib/urllib.py	Fri Aug 17 04:30:27 2007
@@ -46,8 +46,6 @@
     from macurl2path import url2pathname, pathname2url
 elif os.name == 'nt':
     from nturl2path import url2pathname, pathname2url
-elif os.name == 'riscos':
-    from rourl2path import url2pathname, pathname2url
 else:
     def url2pathname(pathname):
         """OS-specific conversion from a relative URL of the 'file' scheme

Modified: python/branches/py3k/Tools/freeze/freeze.py
==============================================================================
--- python/branches/py3k/Tools/freeze/freeze.py	(original)
+++ python/branches/py3k/Tools/freeze/freeze.py	Fri Aug 17 04:30:27 2007
@@ -125,7 +125,7 @@
     # default the exclude list for each platform
     if win: exclude = exclude + [
         'dos', 'dospath', 'mac', 'macpath', 'macfs', 'MACFS', 'posix',
-        'os2', 'ce', 'riscos', 'riscosenviron', 'riscospath',
+        'os2', 'ce',
         ]
 
     fail_import = exclude[:]


More information about the Python-3000-checkins mailing list