[Python-3000] Windows, sys.argv and unicode

Paul Moore p.f.moore at gmail.com
Sat Feb 16 19:29:07 CET 2008


On 16/02/2008, Giovanni Bajo <rasky at develer.com> wrote:
> On Sat, 16 Feb 2008 12:40:52 -0500, Phillip J. Eby wrote:
>
> >>BTW: is there a long-time plan to make the Python core *not* link
> >>against msvcrt dll anymore but only rely on Windows APIs (or maybe also
> >>the static C runtime, I don't really care)?
> >
> > How would this affect using MinGW to build Python extensions?
>
> AFAICT, it would make python.dll not depend on any msvcrt.dll, and thus
> being compatible with any extension, compiled with any compiler (with any
> version of msvcrt, or without msvcrt at all).
>
> Putting an end to this annoying "what version of Visual Studio / msvcrt
> do I need for this version of Python?" is a sensible goal, IMHO.

Actually, it would mean that there was no way of building extensions,
as Python would be using a static C runtime, which extensions wouldn't
have access to (so a FILE* from an extension would be totally
incompatible with the core CRT, a memory block malloc'd in an
extension couldn't be freed by the core, etc...)

In practice, it's possible to take a more relaxed view (differing CRTs
can be used, but only as long as nothing CRT-dependent gets passed
across the boundaries) but it's not completely clear what is affected,
and so the official policy is strict.

If you avoided the static CRT, and only used Windows APIs, that would
avoid this issue, but that means reimplementing everything -
malloc/free, FILE*, stdin/stdout/stderr, etc etc. I don't think anyone
is contemplating that.

Paul.


More information about the Python-3000 mailing list