Thomas Heller wrote: >Mike Brown <mike at skew.org> writes: > > > >>I thought it would be nice to try to improve the mimetypes module by having >>it, on Windows, query the Registry to get the mapping of filename extensions >>to media types, since the mimetypes code currently just blindly checks >>posix-specific paths for httpd-style mapping files. However, it seems that the >>way to get mappings from the Windows registry is excessively slow in Python. >> >>I'm told that the reason has to do with the limited subset of APIs that are >>exposed in the _winreg module. I think it is that EnumKey(key, index) is >>querying for the entire list of subkeys for the given key every time you call >>it. Or something. Whatever the situation is, the code I tried below is way >>slower than I think it ought to be. >> >>Does anyone have any suggestions (besides "write it in C")? Could _winreg >>possibly be improved to provide an iterator or better interface to get the >>subkeys? (or certain ones? There are a lot of keys under HKEY_CLASSES_ROOT, >>and I only need the ones that start with a period). >> >> > >See this post I made some time ago: ><http://mail.python.org/pipermail/python-dev/2004-January/042198.html> > > > >>Should I file this as a feature request? >> >> > >If you still think it should be changed in the core, you should work on >a patch. > >Thomas > > > I could file a patch if no one else is looking at it. The solution would be to use RegEnumKeyEx and remove RegQueryInfoKey. This loses compatability with win16 which I guess is ok. Garth
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4