Commits

holger krekel committed 0f5a580

fix issue23 (reported on pytest issue tracker) by catching NotImplementedError which is apparently raised on some windows machines

Comments (0)

Files changed (4)

 
 (c) Holger Krekel and others, 2004-2010
 """
-__version__ = '1.4.1'
+__version__ = '1.4.2.dev0'
 
 from py import _apipkg
 

py/_path/local.py

             pass
         try:
             os.symlink(src, dest)
-        except (OSError, AttributeError): # AttributeError on win32
+        except (OSError, AttributeError, NotImplementedError):
             pass
 
         return udir
         name='py',
         description='library with cross-python path, ini-parsing, io, code, log facilities',
         long_description = open('README.txt').read(),
-        version='1.4.1',
+        version='1.4.2.dev0',
         url='http://pylib.org',
         license='MIT license',
         platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
     )
 
 if __name__ == '__main__':
-    main()
+    main()

testing/path/test_local.py

             if i>=3:
                 assert not numdir.new(ext=str(i-3)).check()
 
+    def test_make_numbered_dir_NotImplemented_Error(self, tmpdir, monkeypatch):
+        def notimpl(x, y):
+            raise NotImplementedError(42)
+        monkeypatch.setattr(py.std.os, 'symlink', notimpl)
+        x = tmpdir.make_numbered_dir(rootdir=tmpdir, lock_timeout=0)
+        assert x.relto(tmpdir)
+        assert x.check()
+
     def test_locked_make_numbered_dir(self, tmpdir):
         for i in range(10):
             numdir = local.make_numbered_dir(prefix='base2.', rootdir=tmpdir,