Warning on Windows

Bug #430645 reported by John A Meinel
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
John A Meinel

Bug Description

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don't know for sure why we are getting this, but on Windows I'm now
seeing:
$ bzr st
C:\Users\jameinel\dev\bzr\bzr.dev\bzrlib\osutils.py:928: UserWarning:
bzr: warning: Failed to load compiled extensions:
    No module named _readdir_pyx
    Bazaar can run, but performance may be reduced.
    Check Bazaar is correctly installed or set ignore_missing_extensions
  % '\n '.join(_extension_load_failures,))

The main thing is that it is *expected* that we won't build _readdir_pyx
on Windows, so we certainly shouldn't be warning that we are failing to
load it. Arguably we shouldn't be trying to import it in the first place.

 affects bzr
 status confirmed
 importance critical
 assignee jameinel

(only in bzr.dev, but we certainly wouldn't want to release 2.1.0b1 with
this bug :)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwxzkACgkQJdeBCYSNAAOBjACdGC2gVW3iwYvGWFSUt8YjaIGp
UxQAn2rCzTGBpbINiD8Dw1wf2j9f35CR
=wU8E
-----END PGP SIGNATURE-----

Related branches

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 430645] [NEW] Warning on Windows

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel wrote:
> Public bug reported:
>
> I don't know for sure why we are getting this, but on Windows I'm now
> seeing:
> $ bzr st
> C:\Users\jameinel\dev\bzr\bzr.dev\bzrlib\osutils.py:928: UserWarning:
> bzr: warning: Failed to load compiled extensions:
> No module named _readdir_pyx
> Bazaar can run, but performance may be reduced.
> Check Bazaar is correctly installed or set ignore_missing_extensions
> % '\n '.join(_extension_load_failures,))
>
>
> The main thing is that it is *expected* that we won't build _readdir_pyx
> on Windows, so we certainly shouldn't be warning that we are failing to
> load it. Arguably we shouldn't be trying to import it in the first place.
>
> affects bzr
> status confirmed
> importance critical
> assignee jameinel
>
> (only in bzr.dev, but we certainly wouldn't want to release 2.1.0b1 with
> this bug :)
>
> John
> =:->

This appears to be caused by this function:
def file_kind_from_stat_mode_thunk(mode):
   global file_kind_from_stat_mode
   if file_kind_from_stat_mode is file_kind_from_stat_mode_thunk:
       try:
           from bzrlib._readdir_pyx import UTF8DirReader
           file_kind_from_stat_mode = UTF8DirReader().kind_from_mode
       except ImportError, e:
           failed_to_load_extension(e)
           from bzrlib._readdir_py import (
               _kind_from_mode as file_kind_from_stat_mode
               )
   return file_kind_from_stat_mode(mode)
file_kind_from_stat_mode = file_kind_from_stat_mode_thunk

^- note that it is using a bound member function which is a bit strange.
But also that it always uses the _readdir_pyx version.

I doubt this function is terribly performance critical, so I don't think
missing the lib will require a warning, versus earlier when we make use
of the UTF8DirReader code.

So I propose:

=== modified file 'bzrlib/osutils.py'
- --- bzrlib/osutils.py 2009-09-11 06:39:56 +0000
+++ bzrlib/osutils.py 2009-09-16 11:20:53 +0000
@@ -1828,7 +1828,8 @@
             from bzrlib._readdir_pyx import UTF8DirReader
             file_kind_from_stat_mode = UTF8DirReader().kind_from_mode
         except ImportError, e:
- - failed_to_load_extension(e)
+ # This is one time where we won't warn that an extension
failed to
+ # load. The extension is never available on Windows anyway.
             from bzrlib._readdir_py import (
                 _kind_from_mode as file_kind_from_stat_mode
                 )

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwyh0ACgkQJdeBCYSNAAM+3wCglnUJVJk0lg+cMSnWuOBWKmVy
rsgAoKA6EPT1rU/kir9y5ZhM0rqmYb1q
=qCLQ
-----END PGP SIGNATURE-----

Changed in bzr:
status: Confirmed → Fix Released
John A Meinel (jameinel)
Changed in bzr:
milestone: none → 2.1.0b1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.