[PATCH] win32: msvcr71.dll should be used for python 2.4 and 2.5

Adrian Buehlmann adrian at cadifra.com
Fri Aug 12 05:11:33 CDT 2011


On 2011-08-12 11:44, Shun-ichi Goto wrote:
> # HG changeset patch
> # User Shun-ichi GOTO <shunichi.goto at gmail.com>
> # Date 1312781547 -32400
> # Node ID 3173f07f60c5443a0c19125df1953dd8893441e3
> # Parent  216d34de964afd692e08b6fa4b22748d00bce1fe
> win32: msvcr71.dll should be used for python 2.4 and 2.5

If that's true, then this patch should go into the stable branch.

> Following is list of C-Runtime for versions of CPython on windows:
>  - python 2.4.5 => MSVCR71.dll
>  - python 2.5.4 => MSVCR71.dll

..

>  - python 2.6.6 => MSVCR90.dll

I can confirm this line with

$ python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> import ctypes.util
>>> ctypes.util.find_msvcrt()
'msvcr90.dll'
>>>

>  - python 2.7   => MSVCR90.dll
>  - python 3.1.2 => MSVCR90.dll
> 
> diff -r 216d34de964a -r 3173f07f60c5 mercurial/pure/osutil.py
> --- a/mercurial/pure/osutil.py	Thu Dec 09 13:40:28 2010 +0900
> +++ b/mercurial/pure/osutil.py	Mon Aug 08 14:32:27 2011 +0900
> @@ -73,7 +73,7 @@
>              # find_msvcrt was introduced in Python 2.6
>              return ctypes.util.find_msvcrt()
>          except AttributeError:
> -            return 'msvcr80.dll' # CPython 2.5
> +            return 'msvcr71.dll' # CPython 2.5 and 2.4
>  
>      _crt = ctypes.PyDLL(_crtname())

I haven't tested this patch, but it looks good to me. I think we can
trust Shun-ichi GOTO's investigations.

Current TortoiseHg 2.X is using python 2.6.6, so TortoiseHg should not be
affected by this change.


More information about the Mercurial-devel mailing list