Hello community,

here is the log from the commit of package python-distribute for 
openSUSE:Factory checked in at 2013-01-29 07:02:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-distribute (Old)
 and      /work/SRC/openSUSE:Factory/.python-distribute.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-distribute", Maintainer is "radma...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-distribute/python-distribute.changes      
2012-12-03 11:20:21.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-distribute.new/python-distribute.changes 
2013-01-29 07:02:54.000000000 +0100
@@ -1,0 +2,24 @@
+Mon Dec 31 20:03:54 UTC 2012 - alexan...@exatati.com.br
+
+- Update to 0.6.44:
+  * Issue #341: 0.6.33 fails to build under python 2.4
+
+-------------------------------------------------------------------
+Sun Dec 30 06:54:13 UTC 2012 - alexan...@exatati.com.br
+
+- Update to 0.6.33:
+  * Fix 2 errors with Jython 2.5.
+  * Fix 1 failure with Jython 2.5 and 2.7.
+  * Disable workaround for Jython scripts on Linux systems.
+  * Issue #336: `setup.py` no longer masks failure exit code when tests fail.
+  * Fix issue in pkg_resources where try/except around a platform-dependent
+    import would trigger hook load failures on Mercurial. See pull request 32
+    for details.
+  * Issue #341: Fix a ResourceWarning.
+- Aditional changes from 0.6.32:
+  * Fix test suite with Python 2.6.
+  * Fix some DeprecationWarnings and ResourceWarnings.
+  * Issue #335: Backed out `setup_requires` superceding installed requirements
+    until regression can be addressed.
+
+-------------------------------------------------------------------
--- /work/SRC/openSUSE:Factory/python-distribute/python3-distribute.changes     
2012-12-03 11:20:21.000000000 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-distribute.new/python3-distribute.changes    
    2013-01-29 07:02:54.000000000 +0100
@@ -1,0 +2,24 @@
+Mon Dec 31 20:04:09 UTC 2012 - alexan...@exatati.com.br
+
+- Update to 0.6.34:
+  * Issue #341: 0.6.33 fails to build under python 2.4
+
+-------------------------------------------------------------------
+Sun Dec 30 06:55:03 UTC 2012 - alexan...@exatati.com.br
+
+- Update to 0.6.33:
+  * Fix 2 errors with Jython 2.5.
+  * Fix 1 failure with Jython 2.5 and 2.7.
+  * Disable workaround for Jython scripts on Linux systems.
+  * Issue #336: `setup.py` no longer masks failure exit code when tests fail.
+  * Fix issue in pkg_resources where try/except around a platform-dependent
+    import would trigger hook load failures on Mercurial. See pull request 32
+    for details.
+  * Issue #341: Fix a ResourceWarning.
+- Aditional changes from 0.6.32:
+  * Fix test suite with Python 2.6.
+  * Fix some DeprecationWarnings and ResourceWarnings.
+  * Issue #335: Backed out `setup_requires` superceding installed requirements
+    until regression can be addressed.
+
+-------------------------------------------------------------------

Old:
----
  distribute-0.6.31.tar.gz

New:
----
  distribute-0.6.34.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-distribute.spec ++++++
--- /var/tmp/diff_new_pack.BX4GK4/_old  2013-01-29 07:02:55.000000000 +0100
+++ /var/tmp/diff_new_pack.BX4GK4/_new  2013-01-29 07:02:55.000000000 +0100
@@ -19,7 +19,7 @@
 %define modname distribute
 %define mod2nam setuptools
 Name:           python-%{modname}
-Version:        0.6.31
+Version:        0.6.34
 Release:        0
 Url:            http://packages.python.org/distribute
 Summary:        Easily download, build, install, upgrade, and uninstall Python 
packages

++++++ python3-distribute.spec ++++++
--- /var/tmp/diff_new_pack.BX4GK4/_old  2013-01-29 07:02:55.000000000 +0100
+++ /var/tmp/diff_new_pack.BX4GK4/_new  2013-01-29 07:02:55.000000000 +0100
@@ -19,7 +19,7 @@
 %define modname distribute
 %define mod2nam setuptools
 Name:           python3-%{modname}
-Version:        0.6.31
+Version:        0.6.34
 Release:        0
 Url:            http://packages.python.org/distribute
 Summary:        Easily download, build, install, upgrade, and uninstall Python 
packages

++++++ distribute-0.6.31.tar.gz -> distribute-0.6.34.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/CHANGES.txt 
new/distribute-0.6.34/CHANGES.txt
--- old/distribute-0.6.31/CHANGES.txt   2012-11-25 04:55:56.000000000 +0100
+++ new/distribute-0.6.34/CHANGES.txt   2012-12-31 16:25:59.000000000 +0100
@@ -2,6 +2,34 @@
 CHANGES
 =======
 
+----------
+Unreleased
+----------
+
++ Issue #341: 0.6.33 fails to build under python 2.4
+
+------
+0.6.33
+------
+
+* Fix 2 errors with Jython 2.5.
+* Fix 1 failure with Jython 2.5 and 2.7.
+* Disable workaround for Jython scripts on Linux systems.
+* Issue #336: `setup.py` no longer masks failure exit code when tests fail.
+* Fix issue in pkg_resources where try/except around a platform-dependent
+  import would trigger hook load failures on Mercurial. See pull request 32
+  for details.
+* Issue #341: Fix a ResourceWarning.
+
+------
+0.6.32
+------
+
+* Fix test suite with Python 2.6.
+* Fix some DeprecationWarnings and ResourceWarnings.
+* Issue #335: Backed out `setup_requires` superceding installed requirements
+  until regression can be addressed.
+
 ------
 0.6.31
 ------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/PKG-INFO 
new/distribute-0.6.34/PKG-INFO
--- old/distribute-0.6.31/PKG-INFO      2012-11-25 05:02:40.000000000 +0100
+++ new/distribute-0.6.34/PKG-INFO      2012-12-31 16:26:55.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: distribute
-Version: 0.6.31
+Version: 0.6.34
 Summary: Easily download, build, install, upgrade, and uninstall Python 
packages
 Home-page: http://packages.python.org/distribute
 Author: The fellowship of the packaging
@@ -107,9 +107,9 @@
         
         Download the source tarball, uncompress it, then run the install 
command::
         
-            $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz
-            $ tar -xzvf distribute-0.6.31.tar.gz
-            $ cd distribute-0.6.31
+            $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz
+            $ tar -xzvf distribute-0.6.34.tar.gz
+            $ cd distribute-0.6.34
             $ python setup.py install
         
         ---------------------------
@@ -238,6 +238,34 @@
         CHANGES
         =======
         
+        ----------
+        Unreleased
+        ----------
+        
+        + `Issue #341`_: 0.6.33 fails to build under python 2.4
+        
+        ------
+        0.6.33
+        ------
+        
+        * Fix 2 errors with Jython 2.5.
+        * Fix 1 failure with Jython 2.5 and 2.7.
+        * Disable workaround for Jython scripts on Linux systems.
+        * `Issue #336`_: `setup.py` no longer masks failure exit code when 
tests fail.
+        * Fix issue in pkg_resources where try/except around a 
platform-dependent
+          import would trigger hook load failures on Mercurial. See pull 
request 32
+          for details.
+        * `Issue #341`_: Fix a ResourceWarning.
+        
+        ------
+        0.6.32
+        ------
+        
+        * Fix test suite with Python 2.6.
+        * Fix some DeprecationWarnings and ResourceWarnings.
+        * `Issue #335`_: Backed out `setup_requires` superceding installed 
requirements
+          until regression can be addressed.
+        
         ------
         0.6.31
         ------
@@ -738,6 +766,9 @@
         .. _`Issue #328`: http://bitbucket.org/tarek/distribute/issue/328
         .. _`Issue #329`: http://bitbucket.org/tarek/distribute/issue/329
         .. _`Issue #334`: http://bitbucket.org/tarek/distribute/issue/334
+        .. _`Issue #335`: http://bitbucket.org/tarek/distribute/issue/335
+        .. _`Issue #336`: http://bitbucket.org/tarek/distribute/issue/336
+        .. _`Issue #341`: http://bitbucket.org/tarek/distribute/issue/341
         .. _`Issue 100`: http://bitbucket.org/tarek/distribute/issue/100
         .. _`Issue 101`: http://bitbucket.org/tarek/distribute/issue/101
         .. _`Issue 103`: http://bitbucket.org/tarek/distribute/issue/103
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/README.txt 
new/distribute-0.6.34/README.txt
--- old/distribute-0.6.31/README.txt    2012-11-24 16:11:55.000000000 +0100
+++ new/distribute-0.6.34/README.txt    2012-12-29 23:10:53.000000000 +0100
@@ -99,9 +99,9 @@
 
 Download the source tarball, uncompress it, then run the install command::
 
-    $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz
-    $ tar -xzvf distribute-0.6.31.tar.gz
-    $ cd distribute-0.6.31
+    $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz
+    $ tar -xzvf distribute-0.6.34.tar.gz
+    $ cd distribute-0.6.34
     $ python setup.py install
 
 ---------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/_markerlib/markers.py 
new/distribute-0.6.34/_markerlib/markers.py
--- old/distribute-0.6.31/_markerlib/markers.py 2012-11-24 16:11:55.000000000 
+0100
+++ new/distribute-0.6.34/_markerlib/markers.py 2012-12-17 21:03:01.000000000 
+0100
@@ -25,7 +25,16 @@
 
 _builtin_compile = compile
 
-from platform import python_implementation
+try:
+    from platform import python_implementation
+except ImportError:
+    if os.name == "java":
+        # Jython 2.5 has ast module, but not platform.python_implementation() 
function.
+        def python_implementation():
+            return "Jython"
+    else:
+        raise
+
 
 # restricted set of variables
 _VARS = {'sys.platform': sys.platform,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/distribute.egg-info/PKG-INFO 
new/distribute-0.6.34/distribute.egg-info/PKG-INFO
--- old/distribute-0.6.31/distribute.egg-info/PKG-INFO  2012-11-25 
05:02:37.000000000 +0100
+++ new/distribute-0.6.34/distribute.egg-info/PKG-INFO  2012-12-31 
16:26:53.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: distribute
-Version: 0.6.31
+Version: 0.6.34
 Summary: Easily download, build, install, upgrade, and uninstall Python 
packages
 Home-page: http://packages.python.org/distribute
 Author: The fellowship of the packaging
@@ -107,9 +107,9 @@
         
         Download the source tarball, uncompress it, then run the install 
command::
         
-            $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz
-            $ tar -xzvf distribute-0.6.31.tar.gz
-            $ cd distribute-0.6.31
+            $ curl -O 
http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz
+            $ tar -xzvf distribute-0.6.34.tar.gz
+            $ cd distribute-0.6.34
             $ python setup.py install
         
         ---------------------------
@@ -238,6 +238,34 @@
         CHANGES
         =======
         
+        ----------
+        Unreleased
+        ----------
+        
+        + `Issue #341`_: 0.6.33 fails to build under python 2.4
+        
+        ------
+        0.6.33
+        ------
+        
+        * Fix 2 errors with Jython 2.5.
+        * Fix 1 failure with Jython 2.5 and 2.7.
+        * Disable workaround for Jython scripts on Linux systems.
+        * `Issue #336`_: `setup.py` no longer masks failure exit code when 
tests fail.
+        * Fix issue in pkg_resources where try/except around a 
platform-dependent
+          import would trigger hook load failures on Mercurial. See pull 
request 32
+          for details.
+        * `Issue #341`_: Fix a ResourceWarning.
+        
+        ------
+        0.6.32
+        ------
+        
+        * Fix test suite with Python 2.6.
+        * Fix some DeprecationWarnings and ResourceWarnings.
+        * `Issue #335`_: Backed out `setup_requires` superceding installed 
requirements
+          until regression can be addressed.
+        
         ------
         0.6.31
         ------
@@ -738,6 +766,9 @@
         .. _`Issue #328`: http://bitbucket.org/tarek/distribute/issue/328
         .. _`Issue #329`: http://bitbucket.org/tarek/distribute/issue/329
         .. _`Issue #334`: http://bitbucket.org/tarek/distribute/issue/334
+        .. _`Issue #335`: http://bitbucket.org/tarek/distribute/issue/335
+        .. _`Issue #336`: http://bitbucket.org/tarek/distribute/issue/336
+        .. _`Issue #341`: http://bitbucket.org/tarek/distribute/issue/341
         .. _`Issue 100`: http://bitbucket.org/tarek/distribute/issue/100
         .. _`Issue 101`: http://bitbucket.org/tarek/distribute/issue/101
         .. _`Issue 103`: http://bitbucket.org/tarek/distribute/issue/103
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/distribute_setup.py 
new/distribute-0.6.34/distribute_setup.py
--- old/distribute-0.6.31/distribute_setup.py   2012-11-24 16:11:55.000000000 
+0100
+++ new/distribute-0.6.34/distribute_setup.py   2012-12-29 23:10:53.000000000 
+0100
@@ -49,7 +49,7 @@
             args = [quote(arg) for arg in args]
         return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
 
-DEFAULT_VERSION = "0.6.31"
+DEFAULT_VERSION = "0.6.34"
 DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/";
 SETUPTOOLS_FAKED_VERSION = "0.6c11"
 
@@ -239,7 +239,9 @@
 
 def _patch_file(path, content):
     """Will backup the file then patch it"""
-    existing_content = open(path).read()
+    f = open(path)
+    existing_content = f.read()
+    f.close()
     if existing_content == content:
         # already patched
         log.warn('Already patched.')
@@ -257,7 +259,10 @@
 
 
 def _same_content(path, content):
-    return open(path).read() == content
+    f = open(path)
+    existing_content = f.read()
+    f.close()
+    return existing_content == content
 
 
 def _rename_path(path):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/docs/conf.py 
new/distribute-0.6.34/docs/conf.py
--- old/distribute-0.6.31/docs/conf.py  2012-11-24 16:11:55.000000000 +0100
+++ new/distribute-0.6.34/docs/conf.py  2012-12-29 23:10:53.000000000 +0100
@@ -48,9 +48,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.6.31'
+version = '0.6.34'
 # The full version, including alpha/beta/rc tags.
-release = '0.6.31'
+release = '0.6.34'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/pkg_resources.py 
new/distribute-0.6.34/pkg_resources.py
--- old/distribute-0.6.31/pkg_resources.py      2012-11-25 04:31:08.000000000 
+0100
+++ new/distribute-0.6.34/pkg_resources.py      2012-12-31 16:25:59.000000000 
+0100
@@ -33,6 +33,12 @@
 from os import open as os_open
 from os.path import isdir, split
 
+# Avoid try/except due to potential problems with delayed import mechanisms.
+if sys.version_info >= (3, 3) and sys.implementation.name == "cpython":
+    import importlib._bootstrap as importlib_bootstrap
+else:
+    importlib_bootstrap = None
+
 # This marker is used to simplify the process that checks is the
 # setuptools package was installed by the Setuptools project
 # or by the Distribute project, in case Setuptools creates
@@ -517,7 +523,7 @@
                     seen[key]=1
                     yield self.by_key[key]
 
-    def add(self, dist, entry=None, insert=True, replace=False):
+    def add(self, dist, entry=None, insert=True):
         """Add `dist` to working set, associated with `entry`
 
         If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
@@ -525,9 +531,8 @@
         set's ``.entries`` (if it wasn't already present).
 
         `dist` is only added to the working set if it's for a project that
-        doesn't already have a distribution in the set, unless `replace=True`.
-        If it's added, any callbacks registered with the ``subscribe()`` method
-        will be called.
+        doesn't already have a distribution in the set.  If it's added, any
+        callbacks registered with the ``subscribe()`` method will be called.
         """
         if insert:
             dist.insert_on(self.entries, entry)
@@ -536,7 +541,7 @@
             entry = dist.location
         keys = self.entry_keys.setdefault(entry,[])
         keys2 = self.entry_keys.setdefault(dist.location,[])
-        if not replace and dist.key in self.by_key:
+        if dist.key in self.by_key:
             return      # ignore hidden distros
 
         self.by_key[dist.key] = dist
@@ -546,8 +551,7 @@
             keys2.append(dist.key)
         self._added_new(dist)
 
-    def resolve(self, requirements, env=None, installer=None,
-                replacement=True, replace_conflicting=False):
+    def resolve(self, requirements, env=None, installer=None, 
replacement=True):
         """List all distributions needed to (recursively) meet `requirements`
 
         `requirements` must be a sequence of ``Requirement`` objects.  `env`,
@@ -557,12 +561,6 @@
         will be invoked with each requirement that cannot be met by an
         already-installed distribution; it should return a ``Distribution`` or
         ``None``.
-
-        Unless `replace_conflicting=True`, raises a VersionConflict exception 
if
-        any requirements are found on the path that have the correct name but
-        the wrong version.  Otherwise, if an `installer` is supplied it will be
-        invoked to obtain the correct version of the requirement and activate
-        it.
         """
 
         requirements = list(requirements)[::-1]  # set up the stack
@@ -582,18 +580,10 @@
             if dist is None:
                 # Find the best distribution and add it to the map
                 dist = self.by_key.get(req.key)
-                if dist is None or (dist not in req and replace_conflicting):
-                    ws = self
+                if dist is None:
                     if env is None:
-                        if dist is None:
-                            env = Environment(self.entries)
-                        else:
-                            # Use an empty environment and workingset to avoid
-                            # any further conflicts with the conflicting
-                            # distribution
-                            env = Environment([])
-                            ws = WorkingSet([])
-                    dist = best[req.key] = env.best_match(req, ws, installer)
+                        env = Environment(self.entries)
+                    dist = best[req.key] = env.best_match(req, self, installer)
                     if dist is None:
                         #msg = ("The '%s' distribution was not found on this "
                         #       "system, and is required by this application.")
@@ -1341,13 +1331,8 @@
 
 register_loader_type(type(None), DefaultProvider)
 
-try:
-    # CPython >=3.3
-    import _frozen_importlib
-except ImportError:
-    pass
-else:
-    register_loader_type(_frozen_importlib.SourceFileLoader, DefaultProvider)
+if importlib_bootstrap is not None:
+    register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
 
 
 class EmptyProvider(NullProvider):
@@ -1776,20 +1761,20 @@
                     for dist in find_distributions(os.path.join(path_item, 
entry)):
                         yield dist
                 elif not only and lower.endswith('.egg-link'):
-                    for line in open(os.path.join(path_item, entry)):
+                    entry_file = open(os.path.join(path_item, entry))
+                    try:
+                        entry_lines = entry_file.readlines()
+                    finally:
+                        entry_file.close()
+                    for line in entry_lines:
                         if not line.strip(): continue
                         for item in 
find_distributions(os.path.join(path_item,line.rstrip())):
                             yield item
                         break
 register_finder(ImpWrapper,find_on_path)
 
-try:
-    # CPython >=3.3
-    import _frozen_importlib
-except ImportError:
-    pass
-else:
-    register_finder(_frozen_importlib.FileFinder, find_on_path)
+if importlib_bootstrap is not None:
+    register_finder(importlib_bootstrap.FileFinder, find_on_path)
 
 _declare_state('dict', _namespace_handlers={})
 _declare_state('dict', _namespace_packages={})
@@ -1814,7 +1799,6 @@
 
 def _handle_ns(packageName, path_item):
     """Ensure that named package includes a subpath of path_item (if needed)"""
-
     importer = get_importer(path_item)
     if importer is None:
         return None
@@ -1824,19 +1808,14 @@
     module = sys.modules.get(packageName)
     if module is None:
         module = sys.modules[packageName] = types.ModuleType(packageName)
-        module.__path__ = []
-        _set_parent_ns(packageName)
+        module.__path__ = []; _set_parent_ns(packageName)
     elif not hasattr(module,'__path__'):
         raise TypeError("Not a package:", packageName)
     handler = _find_adapter(_namespace_handlers, importer)
-    subpath = handler(importer, path_item, packageName, module)
+    subpath = handler(importer,path_item,packageName,module)
     if subpath is not None:
-        path = module.__path__
-        path.append(subpath)
-        loader.load_module(packageName)
-        for path_item in path:
-            if path_item not in module.__path__:
-                module.__path__.append(path_item)
+        path = module.__path__; path.append(subpath)
+        loader.load_module(packageName); module.__path__ = path
     return subpath
 
 def declare_namespace(packageName):
@@ -1896,13 +1875,8 @@
 register_namespace_handler(ImpWrapper,file_ns_handler)
 register_namespace_handler(zipimport.zipimporter,file_ns_handler)
 
-try:
-    # CPython >=3.3
-    import _frozen_importlib
-except ImportError:
-    pass
-else:
-    register_namespace_handler(_frozen_importlib.FileFinder, file_ns_handler)
+if importlib_bootstrap is not None:
+    register_namespace_handler(importlib_bootstrap.FileFinder, file_ns_handler)
 
 
 def null_ns_handler(importer, path_item, packageName, module):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/release.py 
new/distribute-0.6.34/release.py
--- old/distribute-0.6.31/release.py    2012-11-24 16:11:55.000000000 +0100
+++ new/distribute-0.6.34/release.py    2012-12-29 23:10:53.000000000 +0100
@@ -20,7 +20,7 @@
 except Exception:
        pass
 
-VERSION = '0.6.31'
+VERSION = '0.6.34'
 
 def get_next_version():
        digits = map(int, VERSION.split('.'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setup.py 
new/distribute-0.6.34/setup.py
--- old/distribute-0.6.31/setup.py      2012-11-24 16:11:55.000000000 +0100
+++ new/distribute-0.6.34/setup.py      2012-12-29 23:10:53.000000000 +0100
@@ -15,8 +15,10 @@
     from distutils import dir_util, file_util, util, log
     log.set_verbosity(1)
     fl = FileList()
-    for line in open("MANIFEST.in"):
+    manifest_file = open("MANIFEST.in")
+    for line in manifest_file:
         fl.process_template_line(line)
+    manifest_file.close()
     dir_util.create_tree(tmp_src, fl.files)
     outfiles_2to3 = []
     dist_script = os.path.join("build", "src", "distribute_setup.py")
@@ -39,10 +41,12 @@
 
 d = {}
 init_path = convert_path('setuptools/command/__init__.py')
-exec(open(init_path).read(), d)
+init_file = open(init_path)
+exec(init_file.read(), d)
+init_file.close()
 
 SETUP_COMMANDS = d['__all__']
-VERSION = "0.6.31"
+VERSION = "0.6.34"
 
 from setuptools import setup, find_packages
 from setuptools.command.build_py import build_py as _build_py
@@ -81,10 +85,8 @@
         entry_points = os.path.join('distribute.egg-info', 'entry_points.txt')
 
         if not os.path.exists(entry_points):
-            try:
-                _test.run(self)
-            finally:
-                return
+            _test.run(self)
+            return # even though _test.run will raise SystemExit
 
         f = open(entry_points)
 
@@ -132,21 +134,27 @@
     _before_install()
 
 # return contents of reStructureText file with linked issue references
-def _linkified(rstfile):
+def _linkified(rst_path):
     bitroot = 'http://bitbucket.org/tarek/distribute'
     revision = re.compile(r'\b(issue\s*#?\d+)\b', re.M | re.I)
 
-    rstext = open(rstfile).read()    
+    rst_file = open(rst_path)
+    rst_content = rst_file.read()
+    rst_file.close()
 
-    anchors = revision.findall(rstext) # ['Issue #43', ...]
+    anchors = revision.findall(rst_content) # ['Issue #43', ...]
     anchors = sorted(set(anchors))
-    rstext = revision.sub(r'`\1`_', rstext)
-    rstext += "\n"
+    rst_content = revision.sub(r'`\1`_', rst_content)
+    rst_content += "\n"
     for x in anchors:
         issue = re.findall(r'\d+', x)[0]
-        rstext += '.. _`%s`: %s/issue/%s\n' % (x, bitroot, issue)
-    rstext += "\n"
-    return rstext
+        rst_content += '.. _`%s`: %s/issue/%s\n' % (x, bitroot, issue)
+    rst_content += "\n"
+    return rst_content
+
+readme_file = open('README.txt')
+long_description = readme_file.read() + _linkified('CHANGES.txt')
+readme_file.close()
 
 dist = setup(
     name="distribute",
@@ -156,7 +164,7 @@
     author="The fellowship of the packaging",
     author_email="distutils-...@python.org",
     license="PSF or ZPL",
-    long_description = open('README.txt').read() + _linkified('CHANGES.txt'),
+    long_description = long_description,
     keywords = "CPAN PyPI distutils eggs package management",
     url = "http://packages.python.org/distribute";,
     test_suite = 'setuptools.tests',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/command/develop.py 
new/distribute-0.6.34/setuptools/command/develop.py
--- old/distribute-0.6.31/setuptools/command/develop.py 2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/command/develop.py 2012-12-29 
22:31:25.000000000 +0100
@@ -132,7 +132,9 @@
     def uninstall_link(self):
         if os.path.exists(self.egg_link):
             log.info("Removing %s (link to %s)", self.egg_link, self.egg_base)
-            contents = [line.rstrip() for line in open(self.egg_link)]
+            egg_link_file = open(self.egg_link)
+            contents = [line.rstrip() for line in egg_link_file]
+            egg_link_file.close()
             if contents not in ([self.egg_path], [self.egg_path, 
self.setup_path]):
                 log.warn("Link points to %s: uninstall aborted", contents)
                 return
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/command/easy_install.py 
new/distribute-0.6.34/setuptools/command/easy_install.py
--- old/distribute-0.6.31/setuptools/command/easy_install.py    2012-11-24 
17:09:49.000000000 +0100
+++ new/distribute-0.6.34/setuptools/command/easy_install.py    2012-12-29 
22:31:25.000000000 +0100
@@ -491,7 +491,7 @@
             self.cant_write_to_target()
         else:
             try:
-                f.write("import os;open(%r,'w').write('OK')\n" % (ok_file,))
+                f.write("import os; f = open(%r, 'w'); f.write('OK'); 
f.close()\n" % (ok_file,))
                 f.close(); f=None
                 executable = sys.executable
                 if os.name=='nt':
@@ -1788,6 +1788,11 @@
 
 def fix_jython_executable(executable, options):
     if sys.platform.startswith('java') and is_sh(executable):
+        # Workaround for Jython is not needed on Linux systems.
+        import java
+        if java.lang.System.getProperty("os.name") == "Linux":
+            return executable
+
         # Workaround Jython's sys.executable being a .sh (an invalid
         # shebang line interpreter)
         if options:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/command/upload.py 
new/distribute-0.6.34/setuptools/command/upload.py
--- old/distribute-0.6.31/setuptools/command/upload.py  2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/command/upload.py  2012-12-29 
22:31:25.000000000 +0100
@@ -109,8 +109,9 @@
         data['comment'] = comment
 
         if self.sign:
-            data['gpg_signature'] = (os.path.basename(filename) + ".asc",
-                                     open(filename+".asc").read())
+            asc_file = open(filename + ".asc")
+            data['gpg_signature'] = (os.path.basename(filename) + ".asc", 
asc_file.read())
+            asc_file.close()
 
         # set up the authentication
         auth = "Basic " + base64.encodestring(self.username + ":" + 
self.password).strip()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/command/upload_docs.py 
new/distribute-0.6.34/setuptools/command/upload_docs.py
--- old/distribute-0.6.31/setuptools/command/upload_docs.py     2012-11-24 
16:11:55.000000000 +0100
+++ new/distribute-0.6.34/setuptools/command/upload_docs.py     2012-12-29 
22:31:25.000000000 +0100
@@ -105,7 +105,9 @@
             shutil.rmtree(tmp_dir)
 
     def upload_file(self, filename):
-        content = open(filename, 'rb').read()
+        f = open(filename, 'rb')
+        content = f.read()
+        f.close()
         meta = self.distribution.metadata
         data = {
             ':action': 'doc_upload',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/dist.py 
new/distribute-0.6.34/setuptools/dist.py
--- old/distribute-0.6.31/setuptools/dist.py    2012-11-25 04:31:09.000000000 
+0100
+++ new/distribute-0.6.34/setuptools/dist.py    2012-12-17 21:03:01.000000000 
+0100
@@ -242,10 +242,9 @@
         """Resolve pre-setup requirements"""
         from pkg_resources import working_set, parse_requirements
         for dist in working_set.resolve(
-            parse_requirements(requires), installer=self.fetch_build_egg,
-            replace_conflicting=True
+            parse_requirements(requires), installer=self.fetch_build_egg
         ):
-            working_set.add(dist, replace=True)
+            working_set.add(dist)
 
     def finalize_options(self):
         _Distribution.finalize_options(self)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/sandbox.py 
new/distribute-0.6.34/setuptools/sandbox.py
--- old/distribute-0.6.31/setuptools/sandbox.py 2012-10-19 15:29:10.000000000 
+0200
+++ new/distribute-0.6.34/setuptools/sandbox.py 2012-12-17 21:03:01.000000000 
+0100
@@ -1,5 +1,8 @@
 import os, sys, __builtin__, tempfile, operator, pkg_resources
-_os = sys.modules[os.name]
+if os.name == "java":
+    import org.python.modules.posix.PosixModule as _os
+else:
+    _os = sys.modules[os.name]
 try:
     _file = file
 except NameError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/tests/doctest.py 
new/distribute-0.6.34/setuptools/tests/doctest.py
--- old/distribute-0.6.31/setuptools/tests/doctest.py   2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/tests/doctest.py   2012-12-29 
22:31:25.000000000 +0100
@@ -1968,7 +1968,9 @@
         runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
 
     # Read the file, convert it to a test, and run it.
-    s = open(filename).read()
+    f = open(filename)
+    s = f.read()
+    f.close()
     test = parser.get_doctest(s, globs, name, filename, 0)
     runner.run(test)
 
@@ -2353,7 +2355,9 @@
 
     # Find the file and read it.
     name = os.path.basename(path)
-    doc = open(path).read()
+    f = open(path)
+    doc = f.read()
+    f.close()
 
     # Convert it to a test, and wrap it in a DocFileCase.
     test = parser.get_doctest(doc, globs, name, path, 0)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/tests/test_develop.py 
new/distribute-0.6.34/setuptools/tests/test_develop.py
--- old/distribute-0.6.31/setuptools/tests/test_develop.py      2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/tests/test_develop.py      2012-12-29 
22:31:25.000000000 +0100
@@ -89,8 +89,12 @@
         self.assertEqual(content, ['easy-install.pth', 'foo.egg-link'])
 
         # Check that we are using the right code.
-        path = open(os.path.join(site.USER_SITE, 'foo.egg-link'), 
'rt').read().split()[0].strip()
-        init = open(os.path.join(path, 'foo', '__init__.py'), 
'rt').read().strip()
+        egg_link_file = open(os.path.join(site.USER_SITE, 'foo.egg-link'), 
'rt')
+        path = egg_link_file.read().split()[0].strip()
+        egg_link_file.close()
+        init_file = open(os.path.join(path, 'foo', '__init__.py'), 'rt')
+        init = init_file.read().strip()
+        init_file.close()
         if sys.version < "3":
             self.assertEqual(init, 'print "foo"')
         else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/distribute-0.6.31/setuptools/tests/test_easy_install.py 
new/distribute-0.6.34/setuptools/tests/test_easy_install.py
--- old/distribute-0.6.31/setuptools/tests/test_easy_install.py 2012-11-25 
04:44:23.000000000 +0100
+++ new/distribute-0.6.34/setuptools/tests/test_easy_install.py 2012-12-17 
21:03:02.000000000 +0100
@@ -13,14 +13,12 @@
 import distutils.core
 
 from setuptools.sandbox import run_setup, SandboxViolation
-from setuptools.command.easy_install import easy_install, get_script_args, main
+from setuptools.command.easy_install import easy_install, 
fix_jython_executable, get_script_args, main
 from setuptools.command.easy_install import  PthDistributions
 from setuptools.command import easy_install as easy_install_pkg
 from setuptools.dist import Distribution
-from pkg_resources import working_set, VersionConflict
 from pkg_resources import Distribution as PRDistribution
 import setuptools.tests.server
-import pkg_resources
 
 try:
     # import multiprocessing solely for the purpose of testing its existence
@@ -53,7 +51,7 @@
     sys.exit(
         load_entry_point('spec', 'console_scripts', 'name')()
     )
-""" % sys.executable
+""" % fix_jython_executable(sys.executable, "")
 
 SETUP_PY = """\
 from setuptools import setup
@@ -236,7 +234,7 @@
         f = open(egg_file, 'w')
         try:
             f.write('Name: foo\n')
-        except:
+        finally:
             f.close()
 
         sys.path.append(target)
@@ -275,16 +273,48 @@
         SandboxViolation.
         """
 
-        test_pkg = create_setup_requires_package(self.dir)
+        test_setup_attrs = {
+            'name': 'test_pkg', 'version': '0.0',
+            'setup_requires': ['foobar'],
+            'dependency_links': [os.path.abspath(self.dir)]
+        }
+
+        test_pkg = os.path.join(self.dir, 'test_pkg')
         test_setup_py = os.path.join(test_pkg, 'setup.py')
+        test_setup_cfg = os.path.join(test_pkg, 'setup.cfg')
+        os.mkdir(test_pkg)
+
+        f = open(test_setup_py, 'w')
+        f.write(textwrap.dedent("""\
+            import setuptools
+            setuptools.setup(**%r)
+        """ % test_setup_attrs))
+        f.close()
 
+        foobar_path = os.path.join(self.dir, 'foobar-0.1.tar.gz')
+        make_trivial_sdist(
+            foobar_path,
+            textwrap.dedent("""\
+                import setuptools
+                setuptools.setup(
+                    name='foobar',
+                    version='0.1'
+                )
+            """))
+
+        old_stdout = sys.stdout
+        old_stderr = sys.stderr
+        sys.stdout = StringIO.StringIO()
+        sys.stderr = StringIO.StringIO()
         try:
-            quiet_context(
-                lambda: reset_setup_stop_context(
-                    lambda: run_setup(test_setup_py, ['install'])
-            ))
+            reset_setup_stop_context(
+                lambda: run_setup(test_setup_py, ['install'])
+            )
         except SandboxViolation:
             self.fail('Installation caused SandboxViolation')
+        finally:
+            sys.stdout = old_stdout
+            sys.stderr = old_stderr
 
 
 class TestSetupRequires(unittest.TestCase):
@@ -330,7 +360,7 @@
             tempdir_context(install_at)
 
         # create an sdist that has a build-time dependency.
-        quiet_context(lambda: self.create_sdist(install))
+        self.create_sdist(install)
 
         # there should have been two or three requests to the server
         #  (three happens on Python 3.3a)
@@ -357,81 +387,6 @@
             installer(dist_path)
         tempdir_context(build_sdist)
 
-    def test_setup_requires_overrides_version_conflict(self):
-        """
-        Regression test for issue #323.
-
-        Ensures that a distribution's setup_requires requirements can still be
-        installed and used locally even if a conflicting version of that
-        requirement is already on the path.
-        """
-
-        pr_state = pkg_resources.__getstate__()
-        fake_dist = PRDistribution('does-not-matter', project_name='foobar',
-                                   version='0.0')
-        working_set.add(fake_dist)
-
-        def setup_and_run(temp_dir):
-            test_pkg = create_setup_requires_package(temp_dir)
-            test_setup_py = os.path.join(test_pkg, 'setup.py')
-            try:
-                stdout, stderr = quiet_context(
-                    lambda: reset_setup_stop_context(
-                        # Don't even need to install the package, just running
-                        # the setup.py at all is sufficient
-                        lambda: run_setup(test_setup_py, ['--name'])
-                ))
-            except VersionConflict:
-                self.fail('Installing setup.py requirements caused '
-                          'VersionConflict')
-
-            lines = stdout.splitlines()
-            self.assertGreater(len(lines), 0)
-            self.assert_(lines[-1].strip(), 'test_pkg')
-
-        try:
-            tempdir_context(setup_and_run)
-        finally:
-            pkg_resources.__setstate__(pr_state)
-
-
-def create_setup_requires_package(path):
-    """Creates a source tree under path for a trivial test package that has a
-    single requirement in setup_requires--a tarball for that requirement is
-    also created and added to the dependency_links argument.
-    """
-
-    test_setup_attrs = {
-        'name': 'test_pkg', 'version': '0.0',
-        'setup_requires': ['foobar==0.1'],
-        'dependency_links': [os.path.abspath(path)]
-    }
-
-    test_pkg = os.path.join(path, 'test_pkg')
-    test_setup_py = os.path.join(test_pkg, 'setup.py')
-    test_setup_cfg = os.path.join(test_pkg, 'setup.cfg')
-    os.mkdir(test_pkg)
-
-    f = open(test_setup_py, 'w')
-    f.write(textwrap.dedent("""\
-        import setuptools
-        setuptools.setup(**%r)
-    """ % test_setup_attrs))
-    f.close()
-
-    foobar_path = os.path.join(path, 'foobar-0.1.tar.gz')
-    make_trivial_sdist(
-        foobar_path,
-        textwrap.dedent("""\
-            import setuptools
-            setuptools.setup(
-                name='foobar',
-                version='0.1'
-            )
-        """))
-
-    return test_pkg
-
 
 def make_trivial_sdist(dist_path, setup_py):
     """Create a simple sdist tarball at dist_path, containing just a
@@ -466,7 +421,6 @@
         cd(orig_dir)
         shutil.rmtree(temp_dir)
 
-
 def environment_context(f, **updates):
     """
     Invoke f in the context
@@ -480,7 +434,6 @@
             del os.environ[key]
         os.environ.update(old_env)
 
-
 def argv_context(f, repl):
     """
     Invoke f in the context
@@ -492,7 +445,6 @@
     finally:
         sys.argv[:] = old_argv
 
-
 def reset_setup_stop_context(f):
     """
     When the distribute tests are run using setup.py test, and then
@@ -506,21 +458,3 @@
         f()
     finally:
         distutils.core._setup_stop_after = setup_stop_after
-
-
-def quiet_context(f):
-    """
-    Redirect stdout/stderr to StringIO objects to prevent console output from
-    distutils commands.
-    """
-
-    old_stdout = sys.stdout
-    old_stderr = sys.stderr
-    new_stdout = sys.stdout = StringIO.StringIO()
-    new_stderr = sys.stderr = StringIO.StringIO()
-    try:
-        f()
-    finally:
-        sys.stdout = old_stdout
-        sys.stderr = old_stderr
-    return new_stdout.getvalue(), new_stderr.getvalue()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/tests/test_markerlib.py 
new/distribute-0.6.34/setuptools/tests/test_markerlib.py
--- old/distribute-0.6.31/setuptools/tests/test_markerlib.py    2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/tests/test_markerlib.py    2012-12-17 
21:03:02.000000000 +0100
@@ -16,15 +16,15 @@
         
         os_name = os.name
         
-        self.assert_(interpret(""))
+        self.assertTrue(interpret(""))
         
-        self.assert_(interpret("os.name != 'buuuu'"))
-        self.assert_(interpret("python_version > '1.0'"))
-        self.assert_(interpret("python_version < '5.0'"))
-        self.assert_(interpret("python_version <= '5.0'"))
-        self.assert_(interpret("python_version >= '1.0'"))
-        self.assert_(interpret("'%s' in os.name" % os_name))
-        self.assert_(interpret("'buuuu' not in os.name"))
+        self.assertTrue(interpret("os.name != 'buuuu'"))
+        self.assertTrue(interpret("python_version > '1.0'"))
+        self.assertTrue(interpret("python_version < '5.0'"))
+        self.assertTrue(interpret("python_version <= '5.0'"))
+        self.assertTrue(interpret("python_version >= '1.0'"))
+        self.assertTrue(interpret("'%s' in os.name" % os_name))
+        self.assertTrue(interpret("'buuuu' not in os.name"))
         
         self.assertFalse(interpret("os.name == 'buuuu'"))
         self.assertFalse(interpret("python_version < '1.0'"))
@@ -36,7 +36,7 @@
         
         environment = default_environment()
         environment['extra'] = 'test'
-        self.assert_(interpret("extra == 'test'", environment))
+        self.assertTrue(interpret("extra == 'test'", environment))
         self.assertFalse(interpret("extra == 'doc'", environment))
         
         def raises_nameError():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/distribute-0.6.31/setuptools/tests/test_resources.py 
new/distribute-0.6.34/setuptools/tests/test_resources.py
--- old/distribute-0.6.31/setuptools/tests/test_resources.py    2012-10-19 
15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/tests/test_resources.py    2012-12-17 
21:03:02.000000000 +0100
@@ -561,6 +561,15 @@
         if (sys.version_info >= (3,) and os.environ.get("LC_CTYPE")
             in (None, "C", "POSIX")):
             return
+
+        class java:
+            class lang:
+                class System:
+                    @staticmethod
+                    def getProperty(property):
+                        return ""
+        sys.modules["java"] = java
+
         platform = sys.platform
         sys.platform = 'java1.5.0_13'
         stdout = sys.stdout
@@ -584,6 +593,7 @@
                              '#!%s -x\n' % self.non_ascii_exe)
             self.assertTrue('Unable to adapt shebang line' in 
sys.stdout.getvalue())
         finally:
+            del sys.modules["java"]
             sys.platform = platform
             sys.stdout = stdout
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/distribute-0.6.31/setuptools/tests/win_script_wrapper.txt 
new/distribute-0.6.34/setuptools/tests/win_script_wrapper.txt
--- old/distribute-0.6.31/setuptools/tests/win_script_wrapper.txt       
2012-10-19 15:29:10.000000000 +0200
+++ new/distribute-0.6.34/setuptools/tests/win_script_wrapper.txt       
2012-12-29 22:31:25.000000000 +0100
@@ -16,7 +16,8 @@
     >>> import os, sys, tempfile
     >>> from setuptools.command.easy_install import nt_quote_arg
     >>> sample_directory = tempfile.mkdtemp()
-    >>> open(os.path.join(sample_directory, 'foo-script.py'), 'w').write(
+    >>> f = open(os.path.join(sample_directory, 'foo-script.py'), 'w')
+    >>> f.write(
     ... """#!%(python_exe)s
     ... import sys
     ... input = repr(sys.stdin.read())
@@ -26,6 +27,7 @@
     ... if __debug__:
     ...     print 'non-optimized'
     ... """ % dict(python_exe=nt_quote_arg(sys.executable)))
+    >>> f.close()
 
 Note that the script starts with a Unix-style '#!' line saying which
 Python executable to run.  The wrapper will use this to find the
@@ -34,9 +36,11 @@
 We'll also copy cli.exe to the sample-directory with the name foo.exe:
 
     >>> import pkg_resources
-    >>> open(os.path.join(sample_directory, 'foo.exe'), 'wb').write(
+    >>> f = open(os.path.join(sample_directory, 'foo.exe'), 'wb')
+    >>> f.write(
     ...     pkg_resources.resource_string('setuptools', 'cli.exe')
     ...     )
+    >>> f.close()
 
 When the copy of cli.exe, foo.exe in this example, runs, it examines
 the path name it was run with and computes a Python script path name
@@ -77,7 +81,8 @@
 options as usual. For example, to run in optimized mode and
 enter the interpreter after running the script, you could use -Oi:
 
-    >>> open(os.path.join(sample_directory, 'foo-script.py'), 'w').write(
+    >>> f = open(os.path.join(sample_directory, 'foo-script.py'), 'w')
+    >>> f.write(
     ... """#!%(python_exe)s  -Oi  
     ... import sys
     ... input = repr(sys.stdin.read())
@@ -88,6 +93,7 @@
     ...     print 'non-optimized'
     ... sys.ps1 = '---'
     ... """ % dict(python_exe=nt_quote_arg(sys.executable)))
+    >>> f.close()
 
     >>> input, output = os.popen4(nt_quote_arg(os.path.join(sample_directory, 
'foo.exe')))
     >>> input.close()
@@ -105,18 +111,24 @@
     >>> import os, sys, tempfile
     >>> from setuptools.command.easy_install import nt_quote_arg
     >>> sample_directory = tempfile.mkdtemp()
-    >>> open(os.path.join(sample_directory, 'bar-script.pyw'), 'w').write(
+    >>> f = open(os.path.join(sample_directory, 'bar-script.pyw'), 'w')
+    >>> f.write(
     ... """#!%(python_exe)s
     ... import sys
-    ... open(sys.argv[1], 'wb').write(repr(sys.argv[2]))
+    ... f = open(sys.argv[1], 'wb')
+    ... f.write(repr(sys.argv[2]))
+    ... f.close()
     ... """ % dict(python_exe=nt_quote_arg(sys.executable)))
+    >>> f.close()
 
 We'll also copy gui.exe to the sample-directory with the name bar.exe:
 
     >>> import pkg_resources
-    >>> open(os.path.join(sample_directory, 'bar.exe'), 'wb').write(
+    >>> f = open(os.path.join(sample_directory, 'bar.exe'), 'wb')
+    >>> f.write(
     ...     pkg_resources.resource_string('setuptools', 'gui.exe')
     ...     )
+    >>> f.close()
 
 Finally, we'll run the script and check the result:
 
@@ -126,8 +138,10 @@
     >>> input.close()
     >>> print output.read()
     <BLANKLINE>
-    >>> print open(os.path.join(sample_directory, 'test_output.txt'), 
'rb').read()
+    >>> f = open(os.path.join(sample_directory, 'test_output.txt'), 'rb')
+    >>> print f.read()
     'Test Argument'
+    >>> f.close()
 
 
 We're done with the sample_directory:

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to