Rev 4750: (mbp) Fix bug #446033 by skipping non-existing entries in readdir. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Oct 15 22:28:22 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4750 [merge]
revision-id: pqm at pqm.ubuntu.com-20091015212814-i4j0hjrcob5cdw6j
parent: pqm at pqm.ubuntu.com-20091015201628-3au8qv0a86i6uk8q
parent: john at arbash-meinel.com-20091015194718-03501qjvwifiy3c5
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-10-15 22:28:14 +0100
message:
  (mbp) Fix bug #446033 by skipping non-existing entries in readdir.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/_readdir_pyx.pyx        readdir.pyx-20060609152855-rm6v321vuaqyh9tu-1
  setup.py                       setup.py-20050314065409-02f8a0a6e3f9bc70
=== modified file 'NEWS'
--- a/NEWS	2009-10-15 18:18:44 +0000
+++ b/NEWS	2009-10-15 21:28:14 +0000
@@ -78,6 +78,9 @@
 Bug Fixes
 *********
 
+* Avoid "NoneType has no attribute st_mode" error when files disappear
+  from a directory while it's being read.  (Martin Pool, #446033)
+
 Improvements
 ************
 

=== modified file 'bzrlib/_readdir_pyx.pyx'
--- a/bzrlib/_readdir_pyx.pyx	2009-07-27 04:24:36 +0000
+++ b/bzrlib/_readdir_pyx.pyx	2009-10-08 07:03:05 +0000
@@ -343,8 +343,10 @@
                             raise OSError(errno, "lstat: " + strerror(errno),
                                 path + "/" + entry.d_name)
                         else:
-                            kind = _missing
-                            statvalue = None
+                            # the file seems to have disappeared after being
+                            # seen by readdir - perhaps a transient temporary
+                            # file.  there's no point returning it.
+                            continue
                     # We append a 5-tuple that can be modified in-place by the C
                     # api:
                     # inode to sort on (to replace with top_path)

=== modified file 'setup.py'
--- a/setup.py	2009-10-12 20:12:32 +0000
+++ b/setup.py	2009-10-15 21:28:14 +0000
@@ -335,9 +335,6 @@
     # Ensure tbzrlib itself is on sys.path
     sys.path.append(tbzr_root)
 
-    # Ensure our COM "entry-point" is on sys.path
-    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
-
     packages.append("tbzrlib")
 
     # collect up our icons.
@@ -365,17 +362,6 @@
     excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
                        win32ui crawler.Crawler""".split())
 
-    # NOTE: We still create a DLL version of the Python implemented shell
-    # extension for testing purposes - but it is *not* registered by
-    # default - our C++ one is instead.  To discourage people thinking
-    # this DLL is still necessary, its called 'tbzr_old.dll'
-    tbzr = dict(
-        modules=["tbzr"],
-        create_exe = False, # we only want a .dll
-        dest_base = 'tbzr_old',
-    )
-    com_targets.append(tbzr)
-
     # tbzrcache executables - a "console" version for debugging and a
     # GUI version that is generally used.
     tbzrcache = dict(
@@ -406,8 +392,7 @@
     console_targets.append(tracer)
 
     # The C++ implemented shell extensions.
-    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
-                            "build", "dist")
+    dist_dir = os.path.join(tbzr_root, "shellext", "build")
     data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
     data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
 
@@ -644,7 +629,6 @@
                        'tools/win32/bzr_postinstall.py',
                        ]
     gui_targets = []
-    com_targets = []
     data_files = topics_files + plugins_files
 
     if 'qbzr' in plugins:
@@ -695,7 +679,6 @@
     setup(options=options_list,
           console=console_targets,
           windows=gui_targets,
-          com_server=com_targets,
           zipfile='lib/library.zip',
           data_files=data_files,
           cmdclass={'install_data': install_data_with_bytecompile},




More information about the bazaar-commits mailing list