Re: [Python-Dev] PEP 553 V2 - builtin breakpoint() (was Re: PEP 553: Built-in debug())

2017-09-08 Thread steve
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It would appear to be more secure to define specific meanings for
particular values of the environment variable.  S
-BEGIN PGP SIGNATURE-
Version: CryptUp 4.4.3 Gmail Encryption https://cryptup.org
Comment: Seamlessly send, receive and search encrypted email

wsFcBAEBCAAQBQJZsogwCRAplraUdy0hlgAAvBoQALGf9Fx4fnp4zmoYD6Qc
y5XEbRZnHdnZUg4/k51qb5U5FRoQCSnFzJMltFD+5BuSTLCG8H0Bm9w1LL+N
8Rcg5j0rgXMY5FACK//jCV11uqi7eqVUst99oLPvtYSbGd9CFH5S8yCxT9Sz
fl6Cw8Err828l18phAQ1fgq+AG9Y9vMtGDwLcj4XN5OlWEcpX/rB5HPppylH
/xuProaU+Xluig6Gh09meRPSnd1GT+Y6T3E90AypnwbQiUiMVLTCVOXPRFuR
vlODvAULpw2Pn4D191rgu3Rwou6DcTRmeJMrNhHLOfMEwGMXAkpZdJYGkVvj
vgwmr2ZOD/CafzqQHgi22en0qwPQTZUK9MhqrVcT4pIPfshNfjQ34fe3qdnt
sEPxDb4KjFVUBfZVbnxEvLIIf5C3Gir9sEq8LxoCU/2eG8jkxbxNKmhDfFEi
lvHF/HSyU0AYhwK/MWsagiGmE+6MHL3URpl6Lp/jaKTvVIVhIxAEp+GKxp36
04v/elaiF++p82jjMFGvUWeqIj4hJJG94RFybXZ53TE5gK6jmOkCixtW8A6E
LRFRr9C0f8mKM5d3JmZSCJVtIjoIerFyTTz4prm3S482mLxEeHvcYslhTZI3
yPn0sGIaTDcMk3PvJ8psjrQaEziuOGcDOLX2LYsr9IxKk/kbShmjKs9UBcm9
FNCp
=acbU
-END PGP SIGNATURE-


-BEGIN PGP PUBLIC KEY BLOCK-
Version: CryptUp 4.3.6 Gmail Encryption https://cryptup.org
Comment: Seamlessly send, receive and search encrypted email

xsFNBFlt3m8BEAC/1rDdusFArgznDbnluLfvIt3Wyl6DzFshtDIGUECuuGTG
xcNLxAwLt60z3pabKxFW7w5RDyHcqRqB8RDDYfVw1FiPfAiYcdc6kMFmBoa4
veADYol0maZEGWdg9hmsbmcCuUZ6bHAKAlAdFlLV8T/SmayhwGzk5qGl2WqY
VxqDhVPVBkjt/YBdzE++CY+7Gjqm1EqhWMe+cm2HwrZk51+KWCWSmZj8VieG
jM9qogS+atleJhF14XbRmrF/OUq5odaJcIlYPy2MFnxNz9lsjVRLvkPGs4Z7
p+LFujj7B7QpW+B9ibrrktGOfPA+gVEBukWEapgghgF7C4X/xE5VfgdX9bHu
q52gEuKQWX4weHJDbBykkceZWXlMy2bmWuoXJIQ+rwerGLA3BeuQphmW841d
G2tRx4QRBuEUGNfcCLf57Dp7OMf4pu6+JGnCSmf3l2Se38jLqH/c4ySw7sCA
slhCKTlzjt6hvvAHlOGOpwSVTzNgSb4LRdcFlgjAYE0TXwgsVzY4bc+cdMfQ
rkruoZnQ+Eg0M+XauO3hIZujvcEckiiBjON6VWGLsgLOl/qAyKwzoFvQnnxK
qvh7LGnRBtXkVuT3Q/HP8lBtJ1mUOvuKkrq/L75Xjtvj3LBPOFe9knLzvz+M
tzzRR6Tv2MVVd3n5NqHvAuRDMw6IyEEwxf2MpQARAQABzSJTdGV2ZSBIb2xk
ZW4gPHN0ZXZlQGhvbGRlbndlYi5jb20+wsF1BBABCAApBQJZbd5yBgsJBwgD
AgkQKZa2lHctIZYEFQgCCgMWAgECGQECGwMCHgEAAM+JD/0YSpIaMYSo7Wqz
YL13yyzukd27352glbTQosuLG31UgjbTx7rgK02EkXAOjVJCOpt8IqRVKEyI
S8dAdg4k/rS4DeAiSD1wNlyVxD3TQbFZlDE8L6Gbj7CvdVg64Dm1mby+/YQX
XrRAay48fCHWQyLwsvep/sc8k9wL2l7lXVETgbmo8vz0IeYevgZenYJGYWaY
hEUnThdbcnjMJQArLt4VyVVLBxMRUg1ggf/ccmVjI8JqS+V1vyGDgHqBwDLp
gdJcb6q1poUasD5Zdl3MCpbe3Z/6kUiaQIDkzAKSJdmHxwP2LnOG2I6Kkosk
x3fDv6hR3hkG7jv8bv1jyuZzqSgv55wdLbBMNfeDsY14e0q0IRK6cYYiFGyU
/y02Yj5KnDRqrMuDXuNcJ8CrkgcfWDUlHn5k0wmBEQCaAvm6amxYSvg8pqdz
PtM53GcoZZ/5mDxGCq2j3beyqmYVI1Cp9rPGc9C7TfBJm72dc+TjaGjGQWbU
3DQHH/B5Ny4EJwPu7pFwGF/wQBnym9/aud2tb6d1+l4svQtC1XDzk/m/Hedt
Metx3vuqEuUnFkucTl1v+Kk56GnG0mQTBmRg+xhRStqRkK+JYC/5MIasxcE5
cOTrTkoZzsET5+chNEdnK5JKi6gCMaLZIh7zjkLEP8gNP6vTEoJouZpSjBb5
qNPSwV+b587BTQRZbd5vARAAsw8xPylNT0VFDAdX2kgKCB7RsjTp6uYy5KuW
jvO8f/WoUhJxKO5yLHzdJ5+nU33U7w73UhdeMBuon5bTeddIIczO6DcZjuiP
OJVQeZCpjQbx58lPdvvT4/m16duHiYeD0ONDEchd03mbx0RSVB2Qo/KPy6cb
etvdBF893uIJSvJKY/vDmi8yuYsbfnxmirPGMT8DqY3O02g6nZuUp8iQbDEQ
xHwp9PZZ5A3ZewG95uY7QgRv8we97QHjGc/Nzr284zHIAOJeqiRNd+xnqCZs
mm31lw0ITxwJERKZTAIOgPGejpuLd4zuqS+P385fhsC1RSQJOuozlkiraOSI
R76QhOgdSMsMNDr8PRMaDYOLWgXq5vIDQ+7CmH7b6EFM77Acxblf7V1LHjHm
IOCgQVRCf27F4M0GulcNOEioQFAYlPGtsI4SshvOguy8eybN+T/mh3R66WrZ
RVUHnoURkAkEJ1p+r6amAaQCr+OYHztkjd+6KgW6jQJWsCWcii8lzyWf1oPT
g/eZsF7gqArR7H0FkWPFnKPUaJe2AEDXzLlTCf1tN/KDegx8aW1kC+wXUqFj
VG0tL1s5CRwVSRhXqt4hV4ARrmeoP6R5IQVvRRomPemisvd+qNHFasWU0El7
S7LVZ+ppS6YejowjscHXDREnoux9Q+v014qTnHYR40qvr8sAEQEAAcLBXwQY
AQgAEwUCWW3ecwkQKZa2lHctIZYCGwwAADPkD/9sQInKpiSxeddX0j9ygH5y
RdPIZ8fX9rA/E3qp06dLIj0sQo3wpX+8LhxwTGbB/pM6yd5SjNt1A/j9tpS4
Rg6uzqe7ezmMuQTKczOL9/2yFhNpGaPOnFUs2nEFfHv4IGO96rqanDOEfUDo
kz/zXoxzehnpbxEUC5+azR46laTrEyRdX9R5UhvY2EA8kuL2hKGQg5OXdaMJ
dqtGLyGSa+XTOAvCD0DalJA6T4tDHjOlyUI2GaGs53it3dLAT4sUeBZMATGW
vbR+FJbM/dQVvT39ogtzDilL5je2dGZUQMdqwyfPL3HkDmfkr7ESEJEjQD+I
/0fzH5jGm0q67bI2B54ddLCy7/60ViFPDYDi57gMEq5lXx6uBQgQMh49vgfO
9ywulUyH2ueFijaTJulNQPpn0fhMTm/20SLI2qHYtLI/g/veMDva/UPuolr1
kQk0BRaLmR8audc4SrGWObGDgVfEmqqHdzJu97ZX6lEKtCcLh/n1u0SbmyEX
SF/iStR5tnURIGrykEM+lkeJVmc0Yuh67DCiJC14Widnfy2f5FbcfyRsUs/Y
5WsqgXXroxDWXy/892paz8LmswX08y/sdxGKzr1GmMq8Ib5CixjmFuDhaKpp
WhOOGXLkTeGK+W2ARm/xq2YLcmpTBm48ABwRHfTYm6WbrVMXjlWbqwhr3mWT
2g==
=0xrN
-END PGP PUBLIC KEY BLOCK-
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.7 patch levels turning two digit

2014-06-23 Thread Steve Dower
> Antoine Pitrou wrote:
> Le 23/06/2014 15:27, M.-A. Lemburg a écrit :
>>
>> Not sure what you mean. We've had binary wininst distributions for 
>> Windows for more than a decade, and egg and msi distributions for 8 
>> years :-)
>>
>> But without access to the VS 2008 compiler that is needed to compile 
>> those extensions,
> 
> It does seem to be available:
> http://www.microsoft.com/en-us/download/details.aspx?id=13276
> 
> What am I missing?

That's the service pack, which will only install if you already have VS 2008 
installed.

The only official source for VS 2008 these days is through an MSDN 
subscription, though there's a link floating around that will get to an ISO of 
VC 2008 Express (but it could disappear or move at any time, which would break 
the link for good).

It's also possible to get VC9 standalone through the Windows SDK for Windows 7 
and .NET 3.5, but this installer has bugs, and distutils does not detect VC 
installs properly (it only detects Visual Studio and then assumes VC). This is 
fixable with a few extra files and registry keys, but not simple.

The best answer here is making VC9 available in a long-term, unsupported manner 
(support is the main MSFT concern - simply throwing products out there and 
forgetting about them is very counter-cultural). I'm working on getting people 
to recognize the importance of keeping the old compilers available, but it's an 
uphill battle. Obviously I'll post here as soon as I have something I can 
officially share. :)

Cheers,
Steve

> Regards
> 
> Antoine.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Remaining decisions on PEP 471 -- os.scandir()

2014-07-21 Thread Steve Dower
Victor Stinner wrote:
> 2014-07-20 18:50 GMT+02:00 Antoine Pitrou :
>> Have you tried modifying importlib's _bootstrap.py to use scandir() 
>> instead of listdir() + stat()?
>
> IMO the current os.scandir() API does not fit importlib requirements.
> importlib usually wants fresh data, whereas DirEntry cache cannot be
> invalidated. It's probably possible to cache some os.stat() result in
> importlib, but it looks like it requires a non trivial refactoring of
> the code. I don't know importlib enough to suggest how to change it.

The data is completely fresh at the time it is obtained, which is identical to 
using stat(). There will always be a race-condition between looking and doing, 
which is why we still use exception handling on actions.

> By the way, DirEntry constructor is not documented in the PEP. Should
> we document it? It might be a way to "invalidate the cache":
>
> entry = DirEntry(os.path.dirname(entry.path), entry.name)
>
> Maybe it is an abuse of the API. A clear_cache() method would be less
> ugly :-) But maybe Ben Hoyt does not want to promote keeping DirEntry
> for a long time?

DirEntry is a convenient way to return a tuple without returning a tuple, 
that's all. If you want up to date info, call os.stat() and pass in the path. 
This should just be a better (and ideally transparent) substitute for 
os.listdir() in every single context.

Personally I'd make it a string subclass and put one-shot properties on it 
(i.e. call/cache stat() on first access where we don't already know the 
answer), which I think is close enough to where it's landed that I'm happy. (As 
far as bikeshedding goes, I prefer "_DirEntry" and no docs :) )

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 476: Enabling certificate validation by default!

2014-08-30 Thread Steve Dower
This sounds great, but the disable switch worries me if it's an ENVVAR=1 kind 
of deal. Those switches have a tendency on Windows of becoming "well known 
tricks" and they get set globally and permanently, often by application 
installers or sysadmins (PYTHONPATH suffers the exact same problem).

It sounds like the likely approach is a certificate name, which is fine, 
provided there's no option for "accept everything". I just wanted to get an 
early vote in against a boolean switch.

Cheers,
Steve

Top-posted from my Windows Phone

From: R. David Murray<mailto:[email protected]>
Sent: ‎8/‎30/‎2014 6:33
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 476: Enabling certificate validation by default!

On Sat, 30 Aug 2014 14:03:57 +0200, "M.-A. Lemburg"  wrote:
> On 30.08.2014 12:55, Antoine Pitrou wrote:
> > On Sat, 30 Aug 2014 12:46:47 +0200
> > "M.-A. Lemburg"  wrote:
> >>> That use case should be served with the SSL_CERT_DIR and SSL_CERT_FILE
> >>> env vars (or, better, by specific settings *inside* the application).
> >>>
> >>> I'm against multiplying environment variables, as it makes it more
> >>> difficult to assess the actual security of a setting. The danger of an
> >>> ill-secure setting is much more severe than with hash randomization.
> >>
> >> You have a point there. So how about just a python run-time switch
> >> and no env var ?
> >
> > Well, why not, but does it have a value over letting the code properly
> > configure their SSLContext?
>
> Yes, because when Python changes the default to be validating
> and more secure, application developers will do the same as
> they do now: simply use the defaults ;-)

But neither of those addresses the articulated use case: someone *using*
a program implemented in python that does not itself provide a way to
disable the new default security (because it is *new*).  Only an
environment variable will do that.

Since the environment variable is opt-in, I think the "consenting
adults" argument applies to Alex's demure about "multiple connections".
It could still emit the warnings.

--David
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-23 Thread Steve Dower
Larry Hastings wrote:
> 
> On 09/19/2014 03:31 PM, Barry Warsaw wrote:
> I think we need a Python 3.5 Release Schedule PEP.
> 
> Just checked it in as PEP 478.  It should show up here in a few minutes:
> http://legacy.python.org/dev/peps/pep-0478/
>
> Key facts:
> . Beta 1 is May 24th 2015, about a month after the end of the PyCon US 2015 
> sprints.
> . Final release is September 13, 2015, just over a year from now.
>
> Comments?

Martin is no longer producing the Windows installers - that task has been 
handed to me. I'm planning to have a rewritten installer (also in the same 
repo) that should be easier to modify and maintain, as well as being able to 
produce alternative packages (such as a Python 3.5 or stdlib merge module, for 
example), though that doesn't necessarily need to go into the PEP.

I'm also considering/experimenting with installing into "Program Files" by 
default, but I suspect that isn't going to work out yet.

I'd like to move the Windows versions onto the next release of VC (currently 
"VC 14" until the branding team figures out what to call it). There isn't a 
promised RTM date for VC 14 yet, so it looks like the best available compiler 
by Beta 1 will be a "Go Live" RC. (The "Go Live" marking basically means "we 
think this is ready for use, but expect a round of minor updates/fixes soon - 
the compiler is least likely to be updated, my guess is that it'll be Visual 
Studio UI mostly).

I personally don't have any qualms about using the RC compiler for Beta 1, and 
Beta 2 will almost certainly use VC 14 RTM, but I know when I proposed this 
topic that some people were concerned about having the final version available 
for Python 3.5 Beta. 

So far I've been building regularly with internal versions of VC and haven't 
been hitting any major issues with Python (OpenSSL has some issues, but I've 
been filing bugs on both sides so they should be worked out soon enough). My 
work is at http://hg.python.org/sandbox/steve.dower (branch: VC14) for anyone 
interested.

For the alphas, I'm contemplating producing two builds (VC 10 and VC 14), but I 
obviously want to settle on one or the other by Beta. Last time we discussed 
it, there was strong support for changing compiler, but I have a better idea of 
the timeline now and it's tighter than I thought...

Thoughts, anyone?

Cheers,
Steve

> /arry
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-23 Thread Steve Dower
"This new compiler has the incredibly awesome feature of being forwards 
compatible
right? Like in 10 years stuff compiled with a newer compiler will still work?"

That's the promise at least :)

All the macros that leaked implementation details (like file descriptors) are 
now isolated so if they change it won't break existing applications. It'll 
still be possible for newer compiler versions to break them, but the design now 
obviously discourages it. There's also an official guarantee, so if it is 
broken in future it'll be treated as a bug. As much as I'd love to make solid 
promises, I can only pass on the promises that were made to me.

But yes, we should have forward compatibility with later MSVC versions, which 
will help avoid the situation where it's hard to get hold of the right 
compiler...

Top-posted from my Windows Phone

From: Donald Stufft<mailto:[email protected]>
Sent: ‎9/‎23/‎2014 18:50
To: Nick Coghlan<mailto:[email protected]>
Cc: Steve Dower<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] 3.5 release schedule PEP


On Sep 23, 2014, at 9:48 PM, Nick Coghlan 
mailto:[email protected]>> wrote:

On 24 September 2014 03:05, Steve Dower 
mailto:[email protected]>> wrote:
Larry Hastings wrote:

On 09/19/2014 03:31 PM, Barry Warsaw wrote:
I think we need a Python 3.5 Release Schedule PEP.

Just checked it in as PEP 478.  It should show up here in a few minutes:
http://legacy.python.org/dev/peps/pep-0478/

Key facts:
. Beta 1 is May 24th 2015, about a month after the end of the PyCon US 2015 
sprints.
. Final release is September 13, 2015, just over a year from now.

Comments?

Martin is no longer producing the Windows installers - that task has been 
handed to me. I'm planning to have a rewritten installer (also in the same 
repo) that should be easier to modify and maintain, as well as being able to 
produce alternative packages (such as a Python 3.5 or stdlib merge module, for 
example), though that doesn't necessarily need to go into the PEP.

I'm also considering/experimenting with installing into "Program Files" by 
default, but I suspect that isn't going to work out yet.

I'd like to move the Windows versions onto the next release of VC (currently 
"VC 14" until the branding team figures out what to call it). There isn't a 
promised RTM date for VC 14 yet, so it looks like the best available compiler 
by Beta 1 will be a "Go Live" RC. (The "Go Live" marking basically means "we 
think this is ready for use, but expect a round of minor updates/fixes soon - 
the compiler is least likely to be updated, my guess is that it'll be Visual 
Studio UI mostly).

I personally don't have any qualms about using the RC compiler for Beta 1, and 
Beta 2 will almost certainly use VC 14 RTM, but I know when I proposed this 
topic that some people were concerned about having the final version available 
for Python 3.5 Beta.

So far I've been building regularly with internal versions of VC and haven't 
been hitting any major issues with Python (OpenSSL has some issues, but I've 
been filing bugs on both sides so they should be worked out soon enough). My 
work is at http://hg.python.org/sandbox/steve.dower (branch: VC14) for anyone 
interested.

For the alphas, I'm contemplating producing two builds (VC 10 and VC 14), but I 
obviously want to settle on one or the other by Beta. Last time we discussed 
it, there was strong support for changing compiler, but I have a better idea of 
the timeline now and it's tighter than I thought...

Thoughts, anyone?

It's ultimately up to Larry as RM, but I'd personally favour targeting
the newer compiler and runtime, even with the slight risk of
potentially needing to slip our schedule. There's also a fair amount
of wiggle room between the first beta and the first release candidate.

Regards,
Nick.

--
Nick Coghlan   |   [email protected]<mailto:[email protected]>   |   
Brisbane, Australia
___
Python-Dev mailing list
[email protected]<mailto:[email protected]>
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/donald%40stufft.io

This new compiler has the incredibly awesome feature of being forwards 
compatible
right? Like in 10 years stuff compiled with a newer compiler will still work?

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-24 Thread Steve Dower
> Paul Moore wrote:
> On 24 September 2014 14:16, Mike Miller  wrote:
>> It has been a supported option for just shy of 15 years on 2.X...
>> most if not all the bugs (setuptools) were fixed a decade ago, and
>> right now thousands, if not millions of people are running it under
>> Program Files right now. I can vouch for several thousand because a
>> company I work for distributes Python and pip there for its customers
>> all around the world w/o issue.
>
> One thing that I presume would be an issue. Isn't Program Files protected in
> newer versions of Windows? I haven't tested this myself, so I may be wrong 
> about
> this. So take the following with a pinch of salt.

It's protected very well in newer versions. You typically need to be an 
administrator AND have opted in to being able to modify system files without 
warning.

> Assuming so, that means that if Python is installed there, the standard "pip
> install XXX" would not work unless run in an elevated shell. We are currently
> trying to focus on a unified message for how users should install 
> distributions
> from PyPI, by using pip install.
> I'm not sure it's a good idea to complicate that message yet by adding
> provisos about managing the system Python (which is the only one most Windows
> users will use).

This is my main concern. Until pip install --user is the default (or the 
fallback if there are no write permissions on the destination), a default that 
locks users out of the simplest PyPI experience is a genuine problem. Yes, 
users can elevate to run pip, but I'd prefer pip to use elevation if it has it 
and to use per-user if not.

There also isn't a great story for per-user Python installs on Windows, but 
that becomes fairly cheap with the installer rewrite.

> I know this is only the same situation as Unix users have, but Windows users
> don't have a distro offering packaged versions of PyPI modules.
> I also know we should be moving towards promoting --user, but I don't think
> we're quite ready for that yet. And my speculation doesn't compete with your
> real-life experience, certainly. But I would suggest carefully checking before
> making the switch.

A good reason to decide early on a change like this, or at least to promote it 
as an option in 3.5 and make it the default in 3.6.

Cheers,
Steve

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-24 Thread Steve Dower
Donald Stufft wrote:
> One thing about *nix is even though you can’t write to your normal Python
> install location without root, invoking pip with permissions (assuming you 
> have
> them) is as easy as prefacing it with ``sudo`` in most cases. Does Windows 
> have
> an equivalent or do you need to launch a whole new shell?

Unfortunately not. The "easy way" is for the executable to declare that it 
needs administrative privileges, and then the OS will take over and let you 
approve/reject/sign-in/etc. according to your settings.

I don't believe this is the right solution anyway, as very many Windows users 
won't be able to do this (particularly in IT managed environments). Having 'pip 
install' do a per-user install automatically is something that will actually 
work, at the cost/benefit of not affecting other users.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-24 Thread Steve Dower
> Mike Miller wrote:
> Paul Moore wrote:
>>> One thing that I presume would be an issue. Isn't Program Files
>>> protected in newer versions of Windows?
> 
> Yes, that's the feature that protects from malicious users/code editing 
> "import
> os" to run "format c:\", spam your address book, or look for credit card
> numbers, etc.
> 
> It is the same on Mac and other Unix systems, even Windows since Vista came 
> out,
> almost 10 years ago.
> 
>>
>> This is my main concern. Until pip install --user is the default (or
>> the fallback if there are no write permissions on the destination),
>>> real-life experience, certainly. But I would suggest carefully
>>> checking before making the switch.
> 
> Windows users know how to elevate now, especially developer types.

Sure, but there are plenty of not-quite developer types using Python, plenty 
using locked down machines, and plenty who simply don't trust arbitrary code 
when it wants to elevate. The ability to become an admin does not preclude the 
need to support non-admin users.

> It should be billed as a "feature for your protection" not something to be
> feared. Microsoft decided security was worth the pain of changing over its
> billions of users. Why not Python?
> 
> In my experience pip --user works just fine also. We use it on our unmanned
> media players successfully.

This is good to know. Maybe we aren't as far away as we think.

> We also write Windows services, which run under a system account, where it is
> imperative everything is running from a secure file system.
> 
>> A good reason to decide early on a change like this,
>> or at least to promote it as an option in 3.5 and make it the default in 3.6.
> 
> It's already an option! It always has been --> Custom install. I can't 
> remember
> a time when it didn't work perfectly.

Agreed. I mean it'll become an obvious option (one of the radio buttons at the 
start), and eventually the default option.

As a slight aside, do you enable the option to compile PYC/PYO files on 
install? Unless your users are running as admin, you won't get caching on these 
for the stdlib when it's installed into Program Files.

Cheers,
Steve

> -Mike
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-24 Thread Steve Dower
M.-A. Lemburg wrote:
> 
> I'd rather be conservative here and wait for another Python release before
> switching VC versions. There are a few important questions that need answers
> before we can consider a new VC version:
> 
> * Will there be free versions available ?
> 
> * Will those free editions include the 64-bit compilers ?
> 
> * Will those free editions include the optimizing compilers ?
> 
> * Is there a roadmap for how long these free versions will remain
> officially available ?
> 
> * Are there issues compiling 3rd party libraries with it ?
> 
> E.g. the numeric and science stacks, the web stacks,
> the deployment stacks, etc.
> 
> * What license terms will the new version have ?
> 
> E.g. GPL compatibility issues, weird exceptions,
> 
> * What will the pricing structure look like ?
> 
> While core devs will get free MSDN licenses, most other 3rd party
> providers will have to buy licenses for the compiler, unless
> they can use the free versions.
> 
> An alternative would be targeting VC13 instead of VC14, in case it has good
> answers for the above questions. It's been around for a year now, so there
> should be more experience available with this version.

(Nit - it's actually VC12 a.k.a. "Visual Studio 2013" - VC13 was skipped. This 
is what happens when you have separate engineering and marketing teams :) )

I don't have good answers to all of these yet, but none of them are going to be 
any worse than for VC12. I've forwarded these questions to the people on the VC 
team who do get to choose the answers, and while I'm not expecting to hear 
specifics back from them, they are at least aware of the concerns and how 
important their product is to our community.

There will be free versions available, but I don't know what format they'll be 
in. Those free editions should include identical compilers to the paid ones - 
the cases where that hasn't been true have been bugs or due to assumptions that 
were proven to be incorrect.

The main improvement in this version is that all versions from VC14 should be 
binary compatible, and so there will always be a free compiler, but it may be 
VC15/16/etc. and not VC14.

There are certainly issues with 3rd party libraries, largely because all 
projects have a tendency to take dependencies on compiler/library internals. 
OpenSSL, for example, redefines the stdout/in/err macros based on the VC 
version, but the new definitions are no longer valid with VC14, and so they are 
fixing that. Python itself has a few issues that I have already fixed in my 
branch. There will certainly be other issues, but an advantage of starting 
early is that bugs in the compiler itself can be fixed in the compiler.

The license should not change significantly from previous versions. GPL 
incompatibilities are because the GPL wants to be incompatible with licenses 
based on different ideologies - AFAIK there's never been anything in the VC 
licenses preventing whatever redistribution license you like.

Part of my improvements to /PCBuild will help avoid the need for Visual Studio 
entirely, but the free versions should always be sufficient for building and 
debugging. I have no insight or control over the pricing structure.

Cheers,
Steve

> --
> Marc-Andre Lemburg
> eGenix.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-25 Thread Steve Dower
Chris Angelico wrote:
> On Thu, Sep 25, 2014 at 6:50 AM, Steve Dower  
> wrote:
>> Donald Stufft wrote:
>>> One thing about *nix is even though you can’t write to your normal
>>> Python install location without root, invoking pip with permissions
>>> (assuming you have
>>> them) is as easy as prefacing it with ``sudo`` in most cases. Does
>>> Windows have an equivalent or do you need to launch a whole new shell?
>>
>> Unfortunately not. The "easy way" is for the executable to declare that it
> needs administrative privileges, and then the OS will take over and let you
> approve/reject/sign-in/etc. according to your settings.
> 
> When you say the executable declares this, is that a static (compile/link 
> time)
> declaration, or a run-time one? That is, could pip defer the declaration until
> it's parsed its command line args and decided that it'll be installing into 
> the
> system directory, but NOT make that declaration if it's given --user, or if 
> it's
> running inside a venv, or anything else that means it doesn't need that power?
> If so, that could actually be a very powerful feature: a user without admin
> privs (or choosing not to exercise them) is still able to install into a venv,
> but if s/he forgets to activate the venv, the "hey, I want to modify system
> files" prompt will be the alarm that says the situation is not what was
> expected. That's what happens on my Linux system - I get errors back if I 
> don't
> use sudo, but in a venv, everything works without being root.

It's a compile time option (it's specified in the manifest you can embed into 
an executable) but it is possible to explicitly launch a separate process with 
the flag. Most programs that look like they can elevate on-demand are really 
launching a background process to do the work - you can't change the user for a 
process once it's started in Windows.

This process can obviously be the same one you started with (maybe with 
different command line args), and the main observable difference is that you 
get fewer access denied errors.

So yes, pip can certainly do this, and if it's already running elevated then it 
shouldn't reprompt, but it's not entirely trivial to get this right ("are you 
denied write access to that directory because you're not admin or because it's 
on read-only media?") and it's considerably easier to try it, fail on access 
issues, but provide a flag for the user to force elevation. "pip --sudo install 
..." would be fine by me :)

Cheers,
Steve
 
> ChrisA
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] 3.5 release schedule PEP

2014-09-25 Thread Steve Dower
> Paul Moore wrote:
> On 25 September 2014 17:05, Steve Dower  wrote:
>> So yes, pip can certainly do this, and if it's already running
>> elevated then it shouldn't reprompt, but it's not entirely trivial to
>> get this right ("are you denied write access to that directory because
>> you're not admin or because it's on read-only media?") and it's
>> considerably easier to try it, fail on access issues, but provide a
>> flag for the user to force elevation. "pip --sudo install ..." would
>> be fine by me :)
> 
> I thought one issue with running an elevated command line subprocess from a
> non-elevated one, was that the elevated one didn't have access to the
> non-elevated console, so it popped up its own independent console window, 
> which
> disappeared immediately the process completed (hence losing any error 
> messages).
> I definitely recall easy_install did that at one stage, and it was a real 
> pain.
> Or is that something the parent process can affect, and the cmd/easy_install
> pair just didn't do so?

I'm not sure you can do it automatically, but if you own both sides of the 
application you can set up a pipe between the two processes and let the 
unelevated side forward stdio.

Again, this isn't trivial to get right. The design for the elevation model 
seems to have focused mainly on GUI rather than console, probably assuming that 
people who need to elevate from the console will elevate the shell itself (this 
is a guess - I have no insight into how the Windows team designed this), so 
there are limitations we have to work within.

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-09-26 Thread Steve Dower
Hi all,

(This is advance notice since people on this list will be interested. Official 
announcements are coming when setuptools makes their next release.)

Microsoft has released a compiler package targeting Python 2.7 (i.e. VC9). 
We've produced this package to help library developers build wheels for 
Windows, but also to help users unblock themselves when they need to build C 
extensions themselves.

The Microsoft Visual C++ Compiler for Python 2.7 is available from: 
http://aka.ms/vcpython27 

This package contains all the tools and headers required to build C extension 
modules for Python 2.7 32-bit and 64-bit (note that some extension modules 
require 3rd party dependencies such as OpenSSL or libxml2 that are not 
included). Other versions of Python built with Visual C++ 2008 are also 
supported.

You can install the package without requiring administrative privileges and, 
with the latest version of setuptools (when it releases), use tools such as 
pip, wheel, or a setup.py file to produce binaries on Windows.

Unfortunately, this package isn't necessarily going to help with building 
CPython 2.7 itself, as the build process is complicated and Visual Studio 2008 
is practically required. However, as most people aren't building CPython on 
Windows, this isn't a huge issue. This compiler package should be sufficient 
for most extension modules.

I should also point out that VC9 is no longer supported by Microsoft. This 
means there won't be any improvements or bug fixes coming, and there's no 
official support offered. Feel free to contact me directly 
 if there are issues with the package.

Cheers,
Steve

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-09-27 Thread Steve Dower
It'll help with the numerical stack, but only a little. The devs involved have 
largely figured it out already and I can't provide a good Fortran compiler or 
BLAS library, which is what they need.

It'll be much more valuable for the small packages that have one vital C 
extension - currently those are basically unusable without a wheel or a 
compiler. Many DB and XML packages seem to fall into this category. It also 
works for Cython, so anything that uses Cython should work with just these 
compilers.

Cheers,
Steve

Top-posted from my Windows Phone

From: Christian Heimes<mailto:[email protected]>
Sent: ‎9/‎27/‎2014 7:19
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

On 26.09.2014 20:01, Steve Dower wrote:
> Hi all,
>
> (This is advance notice since people on this list will be interested. 
> Official announcements are coming when setuptools makes their next release.)
>
> Microsoft has released a compiler package targeting Python 2.7 (i.e. VC9). 
> We've produced this package to help library developers build wheels for 
> Windows, but also to help users unblock themselves when they need to build C 
> extensions themselves.
>
> The Microsoft Visual C++ Compiler for Python 2.7 is available from: 
> http://aka.ms/vcpython27

Awesome! :) Thanks a lot, Steve!

Is it possible to compile extensions from Python's numerical stack such
as NumPy, SciPy and SciKit, too?

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-09-27 Thread Steve Dower
Plain distutils won't detect it. It would be easy enough to fix 2.7.9, but 
"update Python" is a big/impossible ask for a lot of people, whereas "update 
setuptools" is easy and also covers Python 2.6 and <3.3.

The compiler installer can't set the keys that distutils looks for without 
losing the per-user installation, and it may also corrupt actual installs of 
Visual Studio. A monkey patch via setuptools was the best way to handle this - 
covers pip and Cython and can be ported to other libraries that care but avoid 
setuptools.

Now that we have a patch, there's very limited value in fixing 2.7.9, IMO. But 
I'm willing to be convinced - we can always add a version check to the 
setuptools patch.

Cheers,
Steve

Top-posted from my Windows Phone

From: Antoine Pitrou<mailto:[email protected]>
Sent: ‎9/‎27/‎2014 5:13
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

On Fri, 26 Sep 2014 18:01:31 +
Steve Dower  wrote:
> Hi all,
>
> (This is advance notice since people on this list will be interested. 
> Official announcements are coming when setuptools makes their next release.)

When you mention "setuptools", do you imply it doesn't work with plain
distutils?

Regards

Antoine.


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-09-27 Thread Steve Dower
The SDK compilers are not easily fixable (I've tried). The installation is 
basically corrupt as far as the non-x86 compilers are concerned.

The package we just put out is exactly the same files as the SDK with those 
issues fixed. There's no reason to encourage the SDK at all now (which was the 
point of the whole exercise from my point of view).

Cheers,
Steve

Top-posted from my Windows Phone

From: Antoine Pitrou<mailto:[email protected]>
Sent: ‎9/‎27/‎2014 8:32
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

On Sat, 27 Sep 2014 14:10:48 +0100
Paul Moore  wrote:
> On 27 September 2014 14:01, Nick Coghlan  wrote:
> > I personally believe we should treat handling both this and the SDK
> > compilers properly as a platform-enablement bug for distutils and
> > ensure they work properly with the currently maintained branches
> > (including 2.7).
>
> +1

+1 as well.

Regards

Antoine.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-09-29 Thread Steve Dower
Paul Moore wrote:
> File "C:\Apps\Python27\Lib\distutils\msvc9compiler.py", line 299, in
> query_vcvarsall
> 
> raise ValueError(str(list(result.keys(
> 
> ValueError: [u'path', u'include', u'lib']
> 
> 
> Failed building wheel for blist
> Failed to build blist
> Cleaning up...
> 
> 
> PS 15:36 [00:02] C:\Work\Projects\buildwheel
> >.\ve-2.7\Scripts\pip.exe list
> pip (1.5.6)
> setuptools (6.0.1)
> wheel (0.24.0)
> 
> This looks suspiciously like http://bugs.python.org/issue7511, which is
> worrying. Is this not something I should have expected setuptools to have
> patched?

Always embarrassing to have to admit this, but there is a bug in my code... :(

distutils validates that four environment variables are set after the 
vcvarsall.bat script - PATH, INCLUDE, LIB and LIBPATH. I neglected to set 
LIBPATH for 64-bit targets (LIBPATH is used by the compiler when compiling with 
/clr, which probably no Python extension has done ever).

If you have a dirty machine like mine, then it's probably already set globally, 
which can really mess up your testing.

I'm putting up an updated installer for the compilers that will set this 
variable, so if you haven't grabbed a copy yet hold off for the next 12 hours 
or so. Otherwise, you can set your LIBPATH variable to any valid path (or maybe 
just any value - the compiler may not even look if /clr is not passed).

Sorry,
Steve

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

2014-10-05 Thread Steve Dower
If you update setuptools to 6.0 or later, it shouldn't have any trouble 
detecting it. No need to set any environment variables.

FWIW, I put my vcvarsall.bat where I did because it's not the original version. 
All the files in VC and WinSDK after unmodified from their original release.

Cheers,
Steve

Top-posted from my Windows Phone

From: Georg Brandl<mailto:[email protected]>
Sent: ‎10/‎5/‎2014 3:23
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Microsoft Visual C++ Compiler for Python 2.7

I just tried out the compiler and built wininst and wheel dists. Thanks!

distutils was *almost* fine using it, but for two snags:

* I had to set VS90COMNTOOLS

* distutils expects vcvarsall.bat in VC, while you have it in the parent dir

The first could be set by the installer of your package.  But if it is not
feasible to do so, setting an envvar is something that developers can surely
be expected to do with instruction.

The second is a little more inconvenient.  Wouldn't it be possible to put
the .bat file in the "right" folder, or if it has to be there, put *another*
one in "VC"?  (That is what I did.)

cheers,
Georg

On 09/27/2014 05:16 PM, Steve Dower wrote:
> Plain distutils won't detect it. It would be easy enough to fix 2.7.9, but
> "update Python" is a big/impossible ask for a lot of people, whereas "update
> setuptools" is easy and also covers Python 2.6 and <3.3.
>
> The compiler installer can't set the keys that distutils looks for without
> losing the per-user installation, and it may also corrupt actual installs of
> Visual Studio. A monkey patch via setuptools was the best way to handle this -
> covers pip and Cython and can be ported to other libraries that care but avoid
> setuptools.
>
> Now that we have a patch, there's very limited value in fixing 2.7.9, IMO. But
> I'm willing to be convinced - we can always add a version check to the
> setuptools patch.
>
> Cheers,
> Steve


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-10 Thread Steve Dower
 the ABI is so they can match it, than 
whether it's exactly the same as what their tools use by default. 

I don't think there's anything actionable in there, but here's a few things we 
could do (discussion points - I'm not necessarily +1 on all of them):

* Deprecate/remove support for compiling CPython itself with compilers other 
than MSVC on Windows
* Add preprocessor magic to pyconfig.h to fail extension builds with mismatched 
ABIs
* Improve distutils to automatically detect and support more compilers and 
cross-compilation where possible
* Help out on distutils-sig to finish the PEPs that are holding up improvements 
to binary distribution
* Reach out to companies to help specific projects (e.g. ask Company X if 
they're willing/able to produce official Y builds on Windows on behalf of the Y 
team)
* Help projects apply to the PSF for grants for Appveyor/similar services

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-11 Thread Steve Dower
Is there some reason the Fortran part can't be separated out into a DLL? That's 
the C ABI Antoine was referring to, and most compilers can generate import 
libraries from binaries, even if the original compiler produced then in a 
different format.

Top-posted from my Windows Phone

From: Sturla Molden
Sent: ‎10/‎11/‎2014 7:22
To: [email protected]
Subject: Re: [Python-Dev] Status of C compilers for Python on Windows

Antoine Pitrou  wrote:

> It sound like whatever MSVC produces should be the defacto standard
> under Windows.

Yes, and that is what Clang does on Windows. It is not as usable as MinGW
yet, but soon it will be. Clang also suffers fronthe lack of a Fortran
compiler, though.

Sturla

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-11 Thread Steve Dower
DLLs linked by import library at compile time (ie. not using LoadLibrary calls) 
and placed in the same directory as the .pyd should be exempt from DLL hell - 
Python already creates an activation context when importing pyds to let them 
load their own dependencies. Multiple CRTs are also okay as long as they don't 
try and share state (such as file descriptors) across boundaries.

I do understand the lack of knowledge and experience though. I've helped out in 
the past but I personally don't have the bandwidth to contribute more, nor the 
persuasiveness to get someone else to.

Top-posted from my Windows Phone

From: Sturla Molden<mailto:[email protected]>
Sent: ‎10/‎11/‎2014 9:59
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Status of C compilers for Python on Windows

Steve Dower  wrote:

> Is there some reason the Fortran part can't be separated out into a DLL?

DLL hell, I assume. Using the Python extension module loader makes it less
of a problem. If we stick with .pyd files where everything is statically
linked we can rely on the Python dev team to make sure that DLL hell does
not bite us. Most of the contributors to projects like NumPy and SciPy are
not computer scientists. So the KISS principle is important, which is why
scientific programmers often use Fortran in the first place. Making sure
DLLs are resolved and loaded correctly, or using stuff like COM or .NET to
mitigate DLL hell, is just in a different league. That is for computer
engineers to take care of, but we are trained as physicists, matematicians,
astronomers, chemists, biologists, or what ever... I am sure that engineers
at Microsoft could do this correctly, but we are not the kind of guys you
would hire :-)


OT: Contrary to common belief, there is no speed advantage of using Fortran
on a modern CPU, because the long pipeline and the hierarchical memory
alleviates the problems with pointer aliasing. C code tends to run faster
then Fortran, often 10 to 20 % faster, and C++ tends to be slightly faster
than C. In 2014, Fortran is only used because it is easier to program for
non-specialists. And besides, correctness is far more important than speed,
which is why we prefer Python or MATLAB in the first place. If you ever see
the argument that Fortran is used because of pointer aliasing, please feel
free to ignore it.


Sturla

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] XP buildbot problem cloning from hg.python.org

2014-10-25 Thread Steve Dower
I was seeing this recently and had to run recover on my repo (not sure what the 
command line is for that - TortoiseHg had a menu). YMMV, but the symptoms sound 
the same.

Cheers,
Steve

Top-posted from my Windows Phone

From: David Bolen<mailto:[email protected]>
Sent: ‎10/‎24/‎2014 22:01
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] XP buildbot problem cloning from hg.python.org

David Bolen  writes:

> which appears to die mid-stream while receiving the manifests.
>
> So I'm sort of hoping there might be some record server-side as to why
> things are falling apart mid-way.

Just to follow-up to myself, I get the same same error trying to do a
clone from my own personal XP machine rather than the buildbot (which
is a VM).  I've had the issue with hg 1.6.2, 2.5.2 and 3.1.2.

However, the same clones completely successfully under OSX and Linux.

So that's sort of strange.

-- David

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-25 Thread Steve Dower
(Apologies for the short reply, posting from my phone.)

"MSVC can continue
to be the default compiler used for Python on Windows, none of Roumen's
patches change that. They would merely open up the choice for packagers and
users to build CPython (and extension modules, thanks to separate patches)
with alternate compilers, in cross-compilation or otherwise."

Building CPython for Windows is not something that needs solving. The culture 
on Windows is to redistribute binaries, not source, and both the core team and 
a number of redistributors have this figured out (and it will only become 
easier with VC14 and Python 3.5).

I'd rather see this effort thrown behind compiling extensions, including cross 
compilation. The ABI is well defined enough that any compiler should be usable, 
especially once the new CRT is in use. However, there is work needed to update 
the various tool chains to link to VC14's CRT and we need to figure out the 
inconsistencies between tools so we can document and work through them.

Having different builds of CPython out there will only fragment the community 
and hurt extension authors far more than it may seem to help.

Cheers,
Steve

Top-posted from my Windows Phone

From: Tony Kelman<mailto:[email protected]>
Sent: ‎10/‎25/‎2014 9:06
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Status of C compilers for Python on Windows

I'm several weeks late to this discussion, but I'm glad to see that it
happened. I'm not a Python developer, and barely a user, but I have several
years of daily experience compiling complicated scientific software cross-
platform, particularly with MinGW-w64 for Windows. The Python community,
both core language and scientific package developers and users, needs to
act here. The problem is bad and getting worse. Luckily much of the work
to start solving it has already been done in bits and pieces, it needs
coordination and participation to come to a conclusion.

> Cross compilation is a valid issue, but I hope that build services like
> Appveyor also help out here. There is regular talk about the PSF/PyPI
> providing something similar

AppVeyor is better than nothing (I've been using it since beta), but it's
a far cry from build services and package management as the Linux world
knows them. Obtaining and setting up build dependencies quickly and
repeatably, and finishing the build of a complicated piece of software
such as CPython, or NumPy, SciPy, Julia (where most of my recent expertise
lies), etc. on a small single-core VM with limited memory and a restrictive
time limit is often not possible. These problems are solved within Linux
infrastructure like Koji, Open Build Service, buildd, etc.

MinGW-w64 is a mature, well-tested toolchain that is very capable of cross-
compiling a wide variety of libraries from Linux to Windows, in addition to
building conventionally on Windows for Windows. The MSYS2 collection of
MinGW-w64-compiled packages (https://github.com/Alexpux/MINGW-packages) has
been mentioned. Linux distributions including
- Fedora https://admin.fedoraproject.org/pkgdb/packages/mingw%2A/
- openSUSE https://build.opensuse.org/project/show/windows:mingw:win32
- Arch https://aur.archlinux.org/packages/?K=mingw
and others have projects for providing many hundreds of open-source
packages compiled for Windows. Debian has the cross-compilers available but
not many packages yet (https://packages.debian.org/search?keywords=mingw).

As a developer of a (compiled) open-source library or application, wouldn't
you love to be able to build binaries on Linux for Windows? With some work
and build system patches, you can. For many projects it's a simple matter of
./configure --host=x86_64-w64-mingw32. Not with CPython though. CPython is
only included in 2 of the above MinGW-w64 distribution projects, MSYS2 and
Arch. This is possible with a very, very long set of patches, many of which
have been submitted by Roumen Petrov to the Python bug tracker - see
http://bugs.python.org/issue17605 and other issues linked therein. Roumen
has done a huge amount of work, and he and others who consider the MinGW-w64
compiler important will continue to do so. (Thanks a million Roumen!)

> I could step in as maintainer for Cygwin and builds based on GCC using
> mingw* APIs.
>
> Regards,
> Roumen Petrov

A maintainer has volunteered. Others will help. Can any core developers
please begin reviewing some of his patches? Even if just to say they need
to be rebased. The lack of responses on the bug tracker is disheartening
from an outside perspective. The pile of patches accumulating in external
MinGW packaging projects is tantamount to a fork of CPython. It won't go
away since there are dedicated packagers working to keep their MinGW-w64
builds functional, even in the ad-hoc current state. The patches continue
piling 

Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-25 Thread Steve Dower
Ray Donnelly wrote:
> What is it that you
> are afraid of if CPython can be compiled out of the box using
> mingw/MinGW-w64? Why are you fighting so hard against having option.

I'm afraid of users having numpy crash because they're using an MSVC CPython 
instead of a mingw CPython. I'm afraid of users not being able to use library A 
and library B at the same time because A requires MSVC CPython and B requires 
mingw CPython. (I can produce more examples if you like, but the general 
concern is having a fragmented community, as I said in my previous post.)

I'm fighting against "having options" because it will suck up the precious 
volunteer time we have and direct it away from where it would be more useful, 
which is making it easier to build extensions with other compilers.

I would love to see extensions for Windows built on all platforms. I see no 
value in building Python itself for Windows from different platforms.

If other core developers agree with you that a more "pure" build of Python is 
worthwhile, then they can go ahead and merge the patches (though I suspect most 
would like to see some traction achieved on a fork first). I think it's 
important that I (as Windows build manager) make my own position clear, that's 
all.

(The rest of your email is purely unsubstantiated opinion, which is okay to 
have, but it doesn't demand any reply so I've omitted it.)

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-25 Thread Steve Dower
Ray Donnelly wrote:
> On Sun, Oct 26, 2014 at 1:45 AM, Steve Dower  
> wrote:
>> Ray Donnelly wrote:
>>> Also, where are the publicly accessible specifications and other technical
>>> descriptions that MinGW-w64 would need to implement strong binary
>>> compatibility with MSVC? As a random example, those for C++ name
>>> mangling and the PDB file format would be very helpful.
>>
>> C++ name mangling is always an implementation detail and it changes from
>> version to version. Luckily, CPython is entirely in C, so that doesn't 
>> matter.
>> PDBs are another red herring - you can build a loadable PE file without PDBs.
>
> Of course C++ can be called from C and that is done in some CPython
> extensions, so it's not a red herring. If we want to talk about strong
> binary compatibility I'd expect the aim would be to intermix freely
> between compilers. We'd like people to be able to debug MinGW-w64 code
> using CDB in Visual Studio if they want to, and on the flipside, to
> have GDB able to read PDB files built by MSVC (actually there's a long
> standing problem when debugging MinGW-w64 code in GDB that stack
> unwinding out of MS built dlls is flaky at best) - so again this is
> not really a red herring. I'm also led to believe that MSVC has a very
> good optimizer so if some project wanted to build certain libraries or
> objects with that for their performance critical paths then I can see
> that as being useful to those projects and their users'.

Binary compatibility that strong is very unlikely to ever happen, and certainly
not with versions of compilers that are being actively developed. It would be 
far
too restrictive to both development teams.

The weaker compatibility of C DLL boundaries is far more achievable - we already
mostly have it, as evidenced by some Python packages working correctly with
mismatched compilers. Soon the CRT will be isolated along the same boundaries,
which is short-term pain for long-term gain.

>>
>> The full source code for the MSVCRT is available with any version of Visual
>> Studio (including the free editions, last time I checked), so feel free to
check
>> whatever you need to ensure compatibility. I've suggested to the VC team that
>> they could get in touch with the MinGW projects and offer to help them 
>> improve
>> compatibility with MSVC, but unfortunately I don't think anyone will take me 
>> up
>> on that. I'm happy to research what I can to answer specific questions, but
>> there's very little that isn't already publicly available other than direct
>> access to the devs.
>
> Under what license? We'd rather have open specifications that
> copyrighted, strictly licensed code that we can't look at for various
> tainting reasons.

As far as I can tell, it's covered by the Visual Studio license, which basically
means you can't redistribute the files (I'm not a lawyer, but I've spent plenty 
of
time talking about licenses to lawyers... not sure how much that counts for :) 
).

Most closed-source Microsoft code is not released under open-source-like 
licenses,
so there's no concept of derivative work, attribution or reciprocation, and 
that's
what appears to cover the CRT sources. "Using" the sources probably counts as 
using
VS, which may trigger some non-commercial clauses if you've got the free version
(but probably not the 30 day trial of the paid version... licenses are weird), 
but
reading them is well within the granted permissions.

The intention of including the sources is to help people with debugging... I 
don't
think it's even possible to rebuild the CRT from them. I do understand the taint
concerns though - until recently, I was operating under rules that made even 
some
documentation "unsafe"...

>> Cheers,
>> Steve
>>
>>>> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-25 Thread Steve Dower
Ray Donnelly wrote:
> On Sat, Oct 25, 2014 at 11:44 PM, Paul Moore  wrote:
>> On 25 October 2014 23:22, Chris Angelico  wrote:
>>> On Sun, Oct 26, 2014 at 9:19 AM, Antoine Pitrou  wrote:
>>>> My point is that your "Windows build" would not have the same behaviour
>>>> as a MSVC-produced Windows build, and so testing it with it would not
>>>> certify that your code would actually be compatible with genuine
>>>> MSVC builds of CPython, which we will not stop supporting.
>>>>
>>>
>>> So you're saying it's impossible to support two compilers?
>>
>> No, rather that Windows currently only has a single supported compiler
>> (excluding cygwin, which is essentially a different OS). Adding a
>> second compiler doesn't just involve adding support for it - which is
>> all that the people offering mingw patches are doing - but also
>> involves going through the whole CPython ecosystem locating the places
>> where there is an implicit assumption that "all Windows builds use the
>> same compiler" and fixing them. I've already pointed out where this is
>> a question for pip and wheel. Whoever wants to add support for a
>> second compiler needs to be willing to do this part of the job as
>> well.
>>
>> Handwaving arguments that "it's binary compatible" aren't enough. Prove it.
> 
> The msvcrt.dlls that MinGW-w64 depends on are those dating back to
> Windows XP SP3 / XP64. Ironically, the official Windows CPython
> doesn't come with any such crt guarantees and you must ensure that the
> same msvcr??.dll is used for *all* extensions. This puts considerable
> strain on extension developers to use the correct (or any) version of
> Visual Studio to build their extensions for CPython on Windows.

We're well aware of this, and it's a big part of why I'm currently migrating 
CPython to build with VC14, which will not have the same binary compatibility 
issues. For VC14, the entire CRT has been cleaned up and mostly hidden behind 
calls into DLLs, so provided the calling conventions match (which they must or 
everything would crash very quickly), it should be relatively easy to build 
compatible extensions with MinGW-w64.

> Also, where are the publicly accessible specifications and other technical
> descriptions that MinGW-w64 would need to implement strong binary
> compatibility with MSVC? As a random example, those for C++ name
> mangling and the PDB file format would be very helpful.

C++ name mangling is always an implementation detail and it changes from 
version to version. Luckily, CPython is entirely in C, so that doesn't matter. 
PDBs are another red herring - you can build a loadable PE file without PDBs.

The full source code for the MSVCRT is available with any version of Visual 
Studio (including the free editions, last time I checked), so feel free to 
check whatever you need to ensure compatibility. I've suggested to the VC team 
that they could get in touch with the MinGW projects and offer to help them 
improve compatibility with MSVC, but unfortunately I don't think anyone will 
take me up on that. I'm happy to research what I can to answer specific 
questions, but there's very little that isn't already publicly available other 
than direct access to the devs.

Cheers,
Steve

>> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-27 Thread Steve Dower
Greg Ewing wrote:
> Nick Coghlan wrote:
>> That assumption will allow MinGW-w64 to link with the appropriate
>> MSVCRT versions for extention building without anything breaking.
>
> If that works, then the same technique should allow CPython itself to be built
> in a VS-compatible way with mingw, shouldn't it?
>
> Those objecting to a mingw-built python seem to be assuming that such a thing
> will necessarily be incompatible with VS builds, but I don't see why that has 
> to
> be the case.

That's true, and a good point that I missed. However, the main (practical) 
desire for building CPython with something other than VS seems to be to avoid 
having to be compatible with VS.

It's entirely possible that having two alternative builds of CPython would 
force everyone to be more compatible, but I think it's more likely to simply 
end up being two different worlds. Maybe I'm being unnecessarily cynical :)

Cheers,
Steve

> --
> Greg
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-27 Thread Steve Dower
> Paul Moore wrote:
> On 27 October 2014 20:45, Greg Ewing  wrote:
>> Nick Coghlan wrote:
>>>
>>> That assumption will allow MinGW-w64 to link with the appropriate
>>> MSVCRT versions for extention building without anything breaking.
>>
>>
>> If that works, then the same technique should allow CPython itself to
>> be built in a VS-compatible way with mingw, shouldn't it?
> 
> Yes.
> 
>> Those objecting to a mingw-built python seem to be assuming that such
>> a thing will necessarily be incompatible with VS builds, but I don't
>> see why that has to be the case.
> 
> No, we've been trying to establish whether the patches to build with mingw 
> were
> intended to produce such a compatible build. It's not clear, but so far it 
> seems
> that apparently that is *not* the intent (and worse, mingw-w64 may not even be
> able to build viable executables that link with msvcr100 without some heavy
> hacking, although that's still somewhat unclear).

Unless there is also opposition to moving to VC14, I'd rather see the mingw 
projects invest in linking to those libraries. I believe they'll have a much 
easier time of it than worrying about VC10, and the investment will be worth 
more in the future as the public API of the CRT stops changing.

Unfortunately, I'm not able to help out more than I've already offered 
(researching answers to specific questions). Largely because I have enough 
work-outside-work going on, but also because my employer won't like me getting 
involved with GPL'd software at all.

Cheers,
Steve

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-29 Thread Steve Dower
"You might want to interact with Steve Dower off-list"

FWIW, I'm happy to talk specifics off list, and have already been involved in a 
number of discussions with the numpy and Scipy guys wrt figuring out specific 
technical challenges or clarifying non obvious parts of dealing with Windows. 
(As far as coding goes, practically all my spare time is taken up already, 
which is why I haven't contributed directly to those projects, much as I'd like 
to.)

Cheers,
Steve

Top-posted from my Windows Phone

From: Stephen J. Turnbull<mailto:[email protected]>
Sent: ‎10/‎28/‎2014 20:59
To: Tony Kelman<mailto:[email protected]>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Status of C compilers for Python on Windows

Tony Kelman writes:

 > No, just hearing the words come out of my mouth they sound a little
 > nuts.  Maybe not, there are after all half a dozen or more
 > incompatible alternate Python implementations floating around. I
 > think most of them started as from-scratch rewrites rather than
 > source forks, but maybe that's irrelevant.

Well, they have different names and they clearly are not intended to
be ABI compatible, so noone expects that.  OTOH, there clearly is an
expectation among many (and not just in the Windows world, cf. all of
the distros that provide whole stacks of everything for each version
of Python) that downloaded packages will just work without
incompatibility.

 > > Well, for starters, most of python-dev would rather avoid any contact
 > > whatsoever with Windows.  I think part of the problem is that Windows
 > > developers *of* Python are *very* rare (fingers of one hand rare).
 >
 > In my opinion the MSVC toolchain makes that problem worse, as it's far
 > harder for unix developers to have any familiarity with how things
 > work.

I've used Cygwin, I've used MinGW, and I've used VC.  Sure, the former
two are GCC-based so I have a lot of muscle memory for command-line
switches.  But that's not very important; the pain of using Windows is
what drives me away from all of them.

 > But you do have involvement and core developers from Microsoft
 > which is obviously incredibly important. Maybe even mandatory for
 > Python on Windows to be viable in your eyes.

No, I don't think that's true.  What I think *is* true is that most
developers on Windows do have access to Microsoft tools, so we do need
to provide compatibility with them.  As you say, the VC toolchain is
not all things to all men, but what's visible to python-dev makes it
more important than Cygwin or MinGW.  See Paul Moore's post about
communications between the scientific Python community and python-dev
for what I mean by "visible".

 > > It should be evident by now that our belief is that the large
 > > majority of Windows users is well-served by the current model
 >
 > This is not the case at all in the scientific community. NumPy and
 > SciPy put in a lot of extra work to come up with something that is
 > compatible with the MSVC build of CPython because they have to, not
 > because they're "happy to" jump through the necessary hoops.

Agreed.  This is well-known to python-dev, and AFAICS it *is* a
concern for us.  However, as Paul points out, a bridge needs to be
built.  Your posts have been a contribution to building that bridge,
for sure, but more work on the bridge is needed.

 > Do python-dev and numpy-discussion not talk to one another?

Exactly the issue here.  To resolve this, we need to talk more.
Unfortunately, I'm not one to help build the bridge as I haven't
developed on Windows at all since about 2003.

 > I'm going to move the "extensions with MinGW-w64" part of this
 > conversation over to numpy-discussion,

As far as I can tell, that's a good idea right now.  They have the
need, they have the expertise, both of which are somewhat lacking
here.

 > Okay. I'll table the discussion with python-dev for now then.

I hope you'll be able to come pick it back up at some point.  You
might want to interact with Steve Dower off-list, as he's spearheading
the effort to move the official builds to the "stable ABI" version of
MSVC.  Once that's in place, the MinGW guys will have a stationary
target which is up to date to shoot at.



___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-29 Thread Steve Dower
Antoine Pitrou wrote:
> On Wed, 29 Oct 2014 11:07:53 -0400
> Tres Seaver  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>> 
>> On 10/29/2014 10:31 AM, R. David Murray wrote:
>> 
>> > If you are writing code targeted for Windows, I think you are very 
>> > likely to have an MSDN subscription of some sort if your package 
>> > includes C code.  I'm sure it's not 100%, though.
>> 
>> My experience with distributing distributions-with-extensions 
>> indicates that the vast majority of Windows developers who are 
>> "downstream" users for those distributions *cannot* build them from 
>> source:  if there is no MSI / bdist_win (maybe now wheel), they won't use 
>> the project.
>>
>> (Note that "having an MSDN subscription" is not the same as "knowing 
>> how to configure which compiler such that it can bulid extensions 
>> against an installed Python binary").
> 
> I don't think you have to configure anything. Just install the right Visual 
> Studio version and it's done.

The tricky part here is the *right* Visual Studio version. As many have noted, 
there were bugs/missing components in some of the older Express editions (like 
the 64-bit compiler integration), and even the compiler pack we released 
recently doesn't actually help building Python itself, though it's good for 
extensions. In general, VS 2008 Professional and VS 2010 Professional are 
easiest to set up if you can get them, the C++ Express editions are fairly easy 
to set up, and the Windows SDK is difficult but possible (and won't currently 
build CPython either, as the build depends on VS - I'm also fixing this for 
3.5).

My ideal target (Utopia refined to be achievable) is for python-dev to handle 
the Python binaries themselves (already done) and to make them easy to bundle 
with applications/etc (I'm working on this for 3.5), and for PyPI to include 
pre-built wheels for Windows where necessary.

Note that I don't require package developers to build their own wheels, though 
I think that they are generally the right people to be doing it. It would be 
nice to create a culture of delegation, so that "someone" could be a trusted 
builder for a range of packages (for example, I'd love it if 
Continuum/Enthought/similar could provide their builds of numpy/scipy as wheels 
and those projects would be willing to have them be the official PyPI 
downloads). This is roughly how the python.org installers are handled, and 
while it may cause some lag between source and binary releases, I think the 
release cycles are slow enough that most users would only notice that "pip 
install numpy" now works.

Cheers,
Steve

> Regards
> 
> Antoine.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-29 Thread Steve Dower
"For the paid versions, I'm going to assume that anyone who paid for a
compiler and doesn't know where their copy is, probably can't be
helped ;-)"

You could link to visualstudio.com for the trial versions, and maybe to a 
page/post about the PSF's grants process if such a page exists.

"And of course there's the awkward problem that VS 2010 Express is
unsupported and therefore no longer available from *any* official
location. I can't solve that, sadly"

These are still at 
http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_4,
 which is the main download page. Hopefully they don't go away before 3.5, but 
I have no control over that unfortunately.

The link I posted for 2.7 was aka.ms/vcpython27, which is a redirect that I own 
and can update if necessary.

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎10/‎29/‎2014 15:48
To: Ethan Furman<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] Status of C compilers for Python on Windows

On 29 October 2014 22:19, Ethan Furman  wrote:
>> Yeah, I wondered about that. I'll work up a patch for that. But the
>> more I think about it, it really is trivial:
>
> I am reminded of an interview question I was once asked which was prefaced
> with: "Here's an easy one..."
>
> My reply was, if you know the answer, it's easy!

Yeah, I know what you mean. My take on this is that I agree it's not
easy if you don't know and can't get access to the information, but if
you can, there's very little to it.

>> - For non-free MSVC, install the appropriate version, and everything just
>> works.
>> - For Python 2.7 (32 or 64 bit), install the compiler for Python 2.7
>> package and everything just works as long as you're using setuptools.
>> - For 32 bit Python 3.2-3.4, install Visual Studio Express and
>> everything just works.
>> - For 64 bit Python 3.2-3.4, install the SDK, set some environment
>> variables, and everything just works.
>> - For Python 3.5+, install the current Visual Studion Express and
>> everything just works.
>
>
> I would suggest
>   - where to get these packages

Conceded. Working out how to point people at stuff on MSDN is a
challenge, things seem to move around. Maybe Steve Dower could help
here with canonical URLs for some of them (IIRC, he provided one for
the VS compilers for Python 2.7 package when it was announced).

For the paid versions, I'm going to assume that anyone who paid for a
compiler and doesn't know where their copy is, probably can't be
helped ;-)

And of course there's the awkward problem that VS 2010 Express is
unsupported and therefore no longer available from *any* official
location. I can't solve that, sadly.

>   - where to get any dependencies

There are none. I could state that explicitly, I guess.

>   - any options to [not] specify during install

I'll have to go through the installs again just to be sure, but I'm
pretty certain "Select the default for everything" is correct.

>   - what environment variables to what value

None, except for the SDK which I did say I needed to test out and
cover in more detail.

>   - where one should be at when one starts the compile process

I don't understand this. It's just "pip wheel foo" to build a wheel
for foo (which will be downloaded), or "pip wheel ." or  "python
setup.py bdist_wheel" as you prefer for a local package. That's
standard distutils/setuptools/pip extension building. I don't propose
to cover that, just how to *set up* the environment.

With the sole exception of the SDK case, once installed, everything
just works everywhere, nothing to set up, no special environment to
configure. Start up a new cmd or powershell console (or use the one
you're already in) and go. Maybe Unix users expect more complexity
because it's not that simple on Unix? But I thought it was - install
the appropriate OS packages and that's it?

> and, of course, a gotchas section for uncommon but frustrating things that
> might go wrong.

Hmm, I see your point here, but I'm not sure what I might include. You
*can* get in a mess [1] but generally I don't as I'm an experienced
Windows user. I also don't want to offer to debug and fix everyone's
problems in getting things set up, so offering to collect and document
"common issues" that I've seen is impractical. Maybe a section
entitled "Common Issues and Their Solutions", with some placeholder
text saying "If you have any issues installing any of the compiler
packages mentioned, please document what

Re: [Python-Dev] Impact of Windows PowerShell OneGet ?

2014-10-30 Thread Steve Dower
>> Most likely, OneGet won't replace pip/PyPI, any more than apt or yum
>> does; but it may be worth having Python itself available that way.
>> That might simply mean having someone package up Python and put it on
>> an appropriate server, or maybe python.org could end up hosting a
>> repo.
> 
> Python is already available in Chocolatey:
> 
> https://chocolatey.org/packages/python
> 
> Given that OneGet intends to support Chocolatey as a repository, it might just
> work already. All python.org would have to guarantee is stable URLs for the
> Python msi files.

I'd like it if we guarantee stable URLs anyway. The 3.5 installer will have a 
single flag to switch between building a full bundle (~23MB) or a tiny 
downloader (<500KB), but the latter option is only viable if the URLs are 
stable. I can also include options in the downloader for 32/64-bit versions and 
debug symbols, which would really reduce the choices for a user (and yes - the 
entire installer is still automatable and I'll write up docs to go with it for 
sysadmin scenarios).

(I believe that OneGet does support dependencies, since one of the intended 
uses is setting up dev environments. If it gets backported, I'll see about 
setting up a Python build environment in there, unless someone else does it 
first.)

Cheers,
Steve

> Regards,
> Martin
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Who's using VS/Windows to work on Python?

2014-11-13 Thread Steve Dower
Just wondering who is regularly/occasionally using VS 2010 to work on Python?

Also, who currently owns the Windows buildbots and are you willing/able to add 
a VS 2015 Preview installation (or give me access so I can do it)? I can also 
set up a VS 2015 buildbot, but the old ones will break if the projects change 
(I should do this anyway to at least become familiar with how the buildbots 
work...)


I want to get a feel for who will be disrupted when I merge in the changes to 
build with VS 2015, which will help influence when that merge occurs. VS 2015 
Preview was just released yesterday, and while it's not perfect yet, it's 
isolated enough from VS 2010 that there won't be any issues installing them 
both (I can't say the same for VS 2013...). If people are okay with this, then 
we can consider merging the changes sooner. Once VS 2015 RC is released, I'll 
be looking to merge asap., but I don't see a strong need to do it before then 
other than a longer bake time.

(In any case, the old project files will still be there, but right now it's 
easier to handle when those change. Once they are in their own directory, 
changes to the VS 2010 projects will need to be duplicated by hand in the VS 
2015 projects, and while the converse is true, it's not as critical.)

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Who's using VS/Windows to work on Python?

2014-11-13 Thread Steve Dower
Tim Golden wrote:
> Are the changes for VS2015 likely to hamper a build against VS2010?

I hadn't tried it, but it looks like it works fine with VS2010 (with a few 
extra warnings, but nothing fatal as far as the build is concerned). I'm a 
little surprised, tbh, but not overly upset :)

Guess I can go ahead and start merging the changes (via issues w/patches) 
whenever I like then. The most painful change will probably be moving the x86 
outputs from PCBuild to PCBuild\win32, but I'll get that into the buildbot 
scripts and it should be fine.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Who's using VS/Windows to work on Python?

2014-11-13 Thread Steve Dower
David Bolen wrote:
> Steve Dower  writes:
> 
>> Also, who currently owns the Windows buildbots and are you
>> willing/able to add a VS 2015 Preview installation (or give me access
>> so I can do it)? (...)
> 
> I've got several of the Windows buildbots, and could add this. Is there 
> benefit
> to just starting with one (I've got XP, Win7 and Win8) first to save some 
> time?

Starting with just the Win7 or Win8 one would be fine. Python 3.5 won't support 
XP, and VS 2015 doesn't support XP (though I believe it will still be able to 
build for XP, just not *on* XP).

> My only real concern is to verify that this will co-exist properly with the
> existing VS installations and buildbot build process. I note that the download
> page says not to use on production computers. That's probably just a CYA, and 
> I
> don't mind if VS itself has issues, but if it risks compromising other aspects
> of the buildbot, then I think testing on a different machine would be 
> preferred.

VS 2010 should be fine. The most likely issues are with VS 2013 (for teams that 
haven't updated their setup authoring yet), but these should have been ironed 
out already.

> Is anything aside from VS 2015 itself (e.g., the Ultimate 2015 download on the
> preview page) needed? I'm assuming not.

Nope, that's it. I'll make sure there's a free version that will work 
eventually, but right now only Ultimate is available. I will make sure to let 
you know when the merge happens, but if VS 2015 is already there then that 
should be smooth anyway.

Thanks,
Steve

> -- David
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Windows Dedicated Mailing List

2014-11-14 Thread Steve Dower
I'd like to keep development *of* Python here, regardless of platform. 
Otherwise all the Linux and Mac people might forget about us :)

Top-posted from my Windows Phone

From: Tim Golden
Sent: ‎11/‎14/‎2014 7:11
To: Shorya Raj; Python 
Dev
Subject: Re: [Python-Dev] Windows Dedicated Mailing List


On 14/11/2014 08:34, Shorya Raj wrote:
> Hello
> I have been following the lists for a while, and have noticed that there
> do not seem to be any sort of specifics for Windows. Now, as someone
> developing python applications (and hoping to develop python itself on
> Windows), I think it may be prudent to consider adding a Windows
> specific mailing list regarding development on Windows, whether it is
> development of Python on windows, or developing Python applications on
> Windows. Please let me know what you guys think - if there is consensus,
> it would be great to get it up and running, and I would be more than
> willing to take steps from my side as required.

That would be this:

https://mail.python.org/mailman/listinfo/python-win32

TJG

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Who's using VS/Windows to work on Python?

2014-11-14 Thread Steve Dower
Nick Coghlan wrote:
> With the recent (excellent) announcements around switching from the current
> Visual Studio Express model to the far more full featured Visual Studio
> Community approach, what will the situation be in relation to using Visual
> Studio Community edition to work on CPython?

It "just works" :)

VS Community is indistinguishable from VS Pro apart from some of the branding 
and a few features so obscure that I hadn't heard of or used them until I was 
told they were missing. Also the license, which allows for free use on 
open-source projects regardless of the company where you work (the limits are 
for commercial use at companies that can afford the product).

> This thread, and Brian's post regarding renewing MSDN subscriptions made me
> realise we're going to need to be able to explain that to new Windows based
> contributors.

Replace "Express" with "Community" everywhere (once the project migrations go 
in, since VS Community *2013* isn't a lot of help right now).

I don't know exactly what the situation will be with VS 2015, but there will 
either be a free Community or a free Express for Desktop (without the 64-bit 
bug that was in VS 2010 Express), either of which will be fine for working on 
Python.

Cheers,
Steve

> Cheers,
> Nick.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Move selected documentation repos to PSF BitBucket account?

2014-11-21 Thread Steve Dower
> Antoine Pitrou wrote:
> On Fri, 21 Nov 2014 13:29:11 +
> Brett Cannon  wrote:
>>> If that "must be self-hosted" constraint is removed, then the
>>> obvious candidate for Mercurial hosting that supports online editing
>>> + pull requests is the PSF's BitBucket account.
>>>
>>
>> There's also CodePlex and (ironically) SourceForge for open-source hg
>> hosting.
> 
> I hope nobody's gonna suggest SourceForge seriously for anything. It's the
> SharePoint (or Lotus Notes) of software forges.

SourceForge can be Lotus Notes; CodePlex is SharePoint :-)

BitBucket is a much better option than either of those. Since I discovered 
hggit (and got it working), I'm less opposed to github than I have ever been, 
but I still prefer BitBucket. It just feels more pragmatic and less like a 
cattle market.

I'm not hugely for/against moving the repo, though I do like the general idea 
of reducing the amount of work committers have to do.

Cheers,
Steve

> Regards
> 
> Antoine.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PCBuild project updates

2014-11-22 Thread Steve Dower

​Hi all

Just attracting some attention to http://bugs.python.org/issue22919 for those 
of us who build Python out of the PCBuild folder. More details/patches there, 
but the tl;dr is

* Still works with VS 2010 (and now VS 2013 and VS 2015 too)
* Build time should be reduced
* Tools\buildbot\*.bat are also updated, so buildbots shouldn't notice any 
change

If you're concerned/interested, I'll be watching the tracker for comments. 
Ideally I'd like at least a couple of people to test build with whatever VS 
version they have, but if nobody can do that then I'll assume that nobody will 
notice anything break sooner than me :)

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Issue 22919: Update PCBuild for VS 2015

2014-12-12 Thread Steve Dower
FYI, I've just committed these changes (http://bugs.python.org/issue22919).

There shouldn't be any immediate failures, as the updated projects will still 
build with VS 2010, but our Windows developers/buildbots can migrate onto the 
later tools as they feel comfortable.

I know there are at least a few bugs coming out of the new compiler, so I'll be 
tracking those down and fixing things. Feel free to nosy me (or Windows) on the 
issue tracker if you find anything.

Cheers,
Steve

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-13 Thread Steve Dower
This is also my approach, and the one that I'm encouraging throughout Microsoft 
as we start putting out more Python packages for stuff.

Top-posted from my Windows Phone

From: Barry Warsaw
Sent: ‎12/‎13/‎2014 7:19
To: [email protected]
Subject: Re: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

On Dec 13, 2014, at 12:29 AM, Donald Stufft wrote:

>For what it’s worth, I almost exclusively write 2/3 compatible code (and
>that’s with the “easy” subset of 2.6+ and either 3.2+ or 3.3+) and doing so
>does make the language far less fun for me than when I was writing 2.x only
>code.

For myself, the way I'd put it is:

With the libraries I maintain, I generally write Python 2/3 compatible code,
targeting Python 2.7 and 3.4, with 2.6, 3.3, and 3.2 support as bonuses,
although I will not contort too much to support those older versions.  Doing
so does make the language far less fun for me than when I am writing 3.x only
code.  All applications I write in pure Python 3, targeting Python 3.4, unless
my dependencies are not all available in Python 3, or I haven't yet had the
cycles/resources to port to Python 3.  Writing and maintaining applications in
Python 2 is far less fun than doing so in Python 3.

Cheers,
-Barry
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] libffi embedded in CPython

2014-12-18 Thread Steve Dower
Maciej Fijalkowski wrote:
> After reading this http://bugs.python.org/issue23085 and remembering 
> struggling
> having our own patches into cpython's libffi (but not into libffi itself), I
> wonder, is there any reason any more for libffi being included in CPython?

We use it for ctypes, so there's certainly still a need. Are you asking whether 
we need a fork of it as opposed to treating it like an external (like OpenSSL)?

> Cheers,
> fijal
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] New Windows installer for Python 3.5

2015-01-03 Thread Steve Dower
I've put together a short post showing where I've been taking the Windows 
installer for Python 3.5, since I know there are interested people on this list 
who will have valuable feedback.

http://stevedower.id.au/blog/the-python-3-5-installer/

Nothing is merged in yet and everything can still change, so I'm keen to hear 
whatever feedback people have. I've tried to make improvements fairly for 
first-time users through to sysadmins, but if I've missed something big I'd 
like to hear about it before we get too close to alpha 1.

Cheers,
Steve 
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-04 Thread Steve Dower
"normal"
> development machine, and for that purpose will want a selected Python
> version as the default one.

You should see my dev machines :) Most have 2.5, 2.6, 2.7 32-bit and 64-bit, 
3.0, 3.1, 3.2, 3.3 32-bit and 64-bit, 3.4 32-bit and 64-bit, IronPython and 
often PyPy, Anaconda or Canopy. So I'm being fairly selfish when I try and make 
the multiple-versions scenario work better, but it will benefit everyone.

> Also, how does the launcher py.exe fit into the picture? Is it still
> installed into the Windows directory? What about for a user install?
> Are Python scripts associated with the launcher, and if so, how does
> it pick up the version you selected as default?

py.exe is more important than ever. It's still installed into the Windows 
directory for all-user installs, and into the Python directory for just-for-me. 
It's installed in a way that will make upgrades more reliable (so if you 
install 3.6 and then 3.5, you'll keep the newer launcher) and all the file 
associations go straight to the launcher.

The default Python for the launcher seems to be 2.7 if it's there and the 
latest version if not (though I could be wrong). Shebang lines are the best way 
to choose a specific version.

Incidentally, whoever came up with the py.exe launcher deserves a medal. It's 
made dealing with multiple versions amazingly easy.



Nick Coghlan wrote:
> The proposed installer changes look like a great improvement to me,
> but I think Paul's questions suggest that it will be useful to capture
> the many decisions involved in the redesign as a PEP.

I was afraid someone would suggest this :)

I certainly intend to document it thoroughly. One of my overarching goals is to 
make it really easy for the next person to take over producing builds, or for 
someone else to produce a signed release build if I'm unavailable.

My intent was just to drop a text file in Tools/msi and some of the user-facing 
docs (like command-line options, best practices and rationale) into the main 
docs. If there's added value in a PEP, then I can do that too, though I would 
prefer the documentation for this to be more living than most PEPs are.


Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-04 Thread Steve Dower
Chris Angelico wrote:
> On Mon, Jan 5, 2015 at 9:56 AM, Steve Dower  wrote:
>> (Windows will always put per-user PATH entries at the end). The py.exe
>> launcher handles this best, and the system version will always be found 
>> first.
>>
>> As for versions, 3.5 vs 3.6 should be distinguished explicitly ("py -3.5" vs
>> "py -3.6") and 3.5.0 vs 3.5.1 can only be installed at the same time if one 
>> is
>> system-wide and the other is per-user. In this case, the per-user one will be
>> used by py.exe, even if it is older than the system-wide one.
>>
> 
> Wait, what?
> 
> If I'm reading this correctly, PATH is set such that an all-users
> version trumps a self-only version, but when you use the py.exe
> launcher, it's the other way around? That seems extremely confusing.
> But if that's not a deliberate design decision and isn't enforced by
> external code, would it be possible to simply invert that for PATH,
> and have a per-user installation always be found ahead of a
> system-wide one? That would make reasonable sense, if it can be done.

Unfortunately, Windows enforces the PATH ordering. It constructs the PATH from 
two registry keys, one is the system-wide value (that requires administrative 
privileges to modify) and it is followed by the user's value (that does not 
require administrative privileges). This is probably for security reasons and 
can't be changed.

PATH also suffers from including the most-recently installed Python version 
first, rather than the most recent version. Basically, py.exe gives the 
behaviour we want and PATH simply can't do it.

I think this means the best way to make multiple versions work properly is to 
rename python.exe to python3.5.exe, then install the launcher as python.exe and 
python3.exe (with some logic to look at its own name) so it can resolve the 
right version. Maybe we can even extend the launcher to resolve launchers in 
Scripts (pip.exe, etc.) and have consistent rules there too?

Or perhaps this is more trouble than it's worth, and we should let "py.exe" 
have a fixed set of rules and let PATH work as people have come to expect. 
Thoughts?

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-05 Thread Steve Dower

Mark Lawrence wrote:
> If I'm reading this correctly it means that py.exe gets picked up from PATH so
> it could be 32 or 64 bit. Does this mean that the launcher could be or needs
> enhancing so 32 or 64 bit can be selected? I'm not sure if anything can be 
> done
> about pyw.exe, perhaps you (plural) can throw some light on this for me.

We only ever install a 32-bit launcher (including with the current installer, 
though it doesn't quite work properly), so this isn't really an issue. To 
explicitly request a 32-bit interpreter you can pass "-3.5-32" - without the 
"-32" suffix you'll get 64-bit if it's there and 32-bit otherwise.

Paul Moore wrote:
> Steve is in essence saying that it's not possible to sanely manage PATH as 
> part
> of the new installer, but that py.exe makes that unnecessary.

It's actually not possible to sanely manage PATH from any installer - it really 
needs to be handled by a user directly (though I can't ever bring myself to 
tell anyone to use the UI for it). The old installers were less susceptible 
because they didn't support per-user installs, but you'd still get the "last 
install Python wins" behaviour.

> My point is that while py handles the interpreter, it doesn't handle things 
> like
> pip (unless we change the standard usage instructions to say "py -m pip" is 
> the
> supported approach on Windows).

Or we make pip3.5.exe launch against 3.5 and pip.exe and pip3.exe behave like 
the launcher, regardless of where they run from.

For example, say I have Python 3.5 and Python 3.6 installed and 
PATH=C:\Python35;C:\Python35\Scripts;C:\Python36;C:\Python36\Scripts;... (yes, 
those are the 'wrong' way around). If I just type "pip" it will run 
C:\Python35\Scripts\pip.exe, which may or may not be what I expect.

If pip behaved like the launcher, it would find the latest installed version 
(3.6) and launch pip3.6.exe, which would always run against 
C:\Python36\python.exe. (How does it do this? No idea yet. Technical details...)

This might also mean you could write "pip -3.5 install ..." to run against a 
specific version, but that doesn't have to be supported if it's likely to break 
scripts by stealing an argument. Since we'll install "pip", "pip3" and 
"pip3.5", the options are already there.

Would we need "pip3.5-32" as well? This could get out of hand pretty quickly. 
Perhaps the launcher could include "usepy -3.5" to update the user's PATH for 
the current session? Would that get any more use? I don't know, but it feels 
unlikely. There have been multiple requests for the Add to PATH option to be 
enabled by default in the installer, but frankly it concerns me too much to do 
so. There are too many effects that most users won't expect.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-05 Thread Steve Dower
Ethan Furman:
> On 01/04/2015 02:56 PM, Steve Dower wrote:
> 
>> ChrisA wrote:
>>> You talk of installing by default into Program Files, and having a 
>>> separate per-user installation mode. How do these two installation 
>>> targets interact? Suppose someone installs 3.5 globally, then 
>>> installs
>>> 3.6 for self only? Or installs 3.5.1 for self only? I would normally 
>>> expect a per-user installation to trump a global one, but this could 
>>> make for a lovely dep-hell on a system that's used by one person, who 
>>> then isn't sure what was installed as admin and what wasn't.
>> 
>> Yeah, it gets a little messy, especially if you keep adding all the 
>> Python versions to PATH (Windows will always put per-user PATH entries 
>> at the end). The py.exe launcher handles this best, and the system 
>> version will always be found first.
> 
> py.exe should *not* follow this behavior. User installs should be searched
> first, then system installs -- otherwise, what's the point in having a
> user-install? Filling up the gobs of disk-space we now have available?

Typo on my part. The py.exe launcher will always find the *user* install first. 
Searching PATH will always find the system version first.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-05 Thread Steve Dower
Paul Moore wrote:
> tl;dr We should have "Add this Python to PATH" as a user choice on the initial
> installer screen, applicable to whichever install type the user chooses. 
> Details
> as to why are below.

I agree. I'll work this up before alpha 1. (FWIW, it defaults to unselected.)

Displaying a warning about other Pythons already being on the path at this 
point is trickier, but I can probably figure something out.

> For myself, I'll probably have to use the custom install to get the control I
> want. But that's suboptimal, as I probably *want* to use the new locations, 
> and
> having to override the "Custom" default of C:\Python35 to specify "Program
> Files" is a nuisance. And I bet I'll install a 32-bit Python in "C:\Program
> Files" rather than "C:\Program Files (x86)" at least once, and probably more
> than once...

Inclined to agree, and it is possible to make the default on the customise page 
switch with the Install as Administrator checkbox until it's been manually 
edited. My main concern is people who want it the old way, but they may not 
actually exist. Perhaps making the old way trickier is the best way to flush 
them out sooner...

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-09 Thread Steve Dower
David Anthoff wrote:
> It would be great if the new installer supported silent, portable installs.
> What I have in mind is a silent installation that drops all the necessary 
> files
> for a working python into a folder, but does not put ANY file anywhere else 
> and
> does not register anything anywhere on the system. So no PATH modification, no
> registering of this install as one of the available python interpreters, no
> uninstall entry or anything like that. By "all the necessary files" I mean 
> that
> it drops things like the MSVC runtime dlls etc into that folder into which I'm
> installing python, but again doesn't try to install things like that system or
> even user wide.
>
> I'll give you my very specific use-case, but I think this might be useful for
> others as well: we are trying to build an installer for some other product X
> that internally requires a python instance to work. This python instance 
> should
> NOT be visible to anything other than product X, i.e. no user should ever 
> start
> it directly or anything like that, it really is an implementation detail of
> product X. If we had an official python installer that supported silent,
> portable installs, I could just call that python installer inside the setup
> program for X, and it would drop a fully working python installation into a
> sub-directory of the install directory of product X. And we would be happy :)

I'll look into this, but it probably isn't going to work as part of the 
installer. I have previously looked into being able to install arbitrary 
side-by-side copies of Python, but that's near impossible as well. Windows 
Installer doesn't really let you just copy files - it isn't part of its 
intended functionality. It isn't too difficult to build custom MSIs with 
certain parts of Python (such as the DLLs and the standard library, but no 
docs, headers or EXEs) in a way that won't conflict with other installs, but 
you're still using an MSI here which is not necessarily ideal.

The easiest way is still going to be to install a copy of Python without 
administrative privileges, which *currently* will drop all the files you want 
into the main install path (wherever you customise that to be), and then copy 
them directly into your installer, but that may change depending on the 
redistribution requirements of the CRT. There are still limitations within 
Python itself that would be nice to fix, such as looking at the registry too 
soon when it could resolve directories relative to its own location, but these 
are independent from the installer. If you don't need python.exe, then it 
should be fine as long as you put pythonXY.dll alongside the executable loading 
it (otherwise a system version may take priority).

As you can see, this is a fairly deep hole with lots of caveats :)

We could release a ZIP file containing all the Python files. The only reason I 
hesitate on this is that it could cause significant confusion for someone who 
doesn't really understand the implications, while people like yourself who have 
thought about this are also capable of finding workarounds and don't really 
need the ZIP file apart from convenience. Making some of the fixes to make 
python.exe more portable would relieve my concerns here.

> The old MSI installer sort of had something like that with the MSI
> administrative install option. But it never really worked because the
> administrative install didn't drop the MSVC runtime dlls anywhere, as far as I
> could tell. At some point I hacked around that by modifying the MSI file in my
> setup program to also drop the MSVC runtime dlls, but that was VERY hacky...

I'm a little surprised that worked at all for what you were trying to do. You'd 
be better off installing it once and then copying the files yourself. 

But overall, this is the sort of thing I do want to enable. I firmly believe 
that Python from python.org is for *developers*, and those who just want to run 
a Python application should be able to get a complete package. This is very 
different from the *nix approach, but it makes far more sense to Windows users. 
A good example is TortoiseHg, which bundles everything so that users never even 
know they have Python 2.7 or Mercurial installed on their machine. Making it 
easier for people to bundle Python into their own applications is a good thing, 
as far as I'm concerned.

Cheers,
Steve

> Thanks,
> David
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-12 Thread Steve Dower
staller sort of had something like that with the MSI
>>> administrative install option. But it never really worked because
>>> the administrative install didn't drop the MSVC runtime dlls
>>> anywhere, as far as I could tell. At some point I hacked around that
>>> by modifying the MSI file in my setup program to also drop the MSVC
>>> runtime dlls, but
>>> that was VERY hacky...
>>
>> I'm a little surprised that worked at all for what you were trying to do.
>> You'd be better off installing it once and then copying the files yourself.
> 
> I got it to drop the msvcr100.dll, but haven't managed to get the msvcp100.dll
> out via an administrative install. The whole approach is a mess, I would MUCH
> prefer a zip file.
>
>> But overall, this is the sort of thing I do want to enable. I firmly
>> believe that Python from python.org is for *developers*, and those who
>> just want to run a Python application should be able to get a complete
>> package. This is very different from the *nix approach, but it makes far
>> more sense to Windows users. A good example is TortoiseHg, which bundles
>> everything so that users never even know they have Python 2.7 or
>> Mercurial installed on their machine. Making it easier for people to
>> bundle Python into their own applications is a good thing, as far as I'm
>> concerned.
> 
> Yes, those are good examples. Right now doing this in the way these guys do is
> too much work for our small project... Anything that makes this easier would 
> be
> appreciated.

I don't see how. All they've done is literally copy a Python installation into 
their install directory. Yes, they have their own launcher executables (py2exe 
generated, it looks like) and have precompiled the standard library and put it 
in a ZIP file, but you don't even need to go that far. Without knowing anything 
about your project I can't give specific suggestions, but simply dropping a 
Python installation in is not that difficult (and until the issues that Nick 
referred to are fixed, will have the same problems as TortoiseHg presumably 
has).

> Thanks! And the new installer looks great in general.

Thanks.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-12 Thread Steve Dower
> On Sat, Jan 10, 2015 at 3:28 AM, Nick Coghlan  wrote:
>> For the time being, things like PyInstaller, PyRun, Portable Python,
>> etc are going to offer a better solution than anything we provide in
>> the standard installers.
> 
> See also Anaconda and Enthought Canopy. I think miniconda, for instance, may
> give you just what you need, if you don't want to go the py2exe/PyInstaller
> approach (though you probably do want to go that way, as far as I can tell 
> from
> your description of your use-case.

Actually, both Anaconda and Canopy suffer from the initialization process 
issues. You can't really use virtualenv with either of them unless they set the 
registry PythonPath value (since they won't find the libraries they need to 
launch), and if you install both then they'll fight over the registry key and 
you'll get Canopy launching with Anaconda's path or vice-versa.

> I'm inclined to think that this does not belong as part of the standard
> installer.

The problems are inherent to the standard python.exe, and are likely part of 
the standard pythonXY.dll. Nick's scared of fixing it, so I'm absolutely 
petrified :)

Cheers,
Steve

> -Chris
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-13 Thread Steve Dower
Martin v. Löwis wrote:
> Am 04.01.15 00:34, schrieb Steve Dower:
>> so I'm keen to hear whatever feedback people have.
> 
> One issue that I always wanted to address is patch releases. There are two
> aspects I dislike about the current implementation
> 
> a) an upgrade install first uninstalls the previous installation (removing all
>files), and then reinstalls all "new" files. In many patch releases, a lot 
> of
>.py files remain unmodified, so it should speed up the upgrade if they 
> would not
>need to be replaced.
> b) Installer supports patch files (.msp); I always wanted to provide them in 
> the
>hope that this would reduce the download size. IIUC, it would require 
> stable
>component IDs for components to be upgraded, which I could not manage to
>provide.
> 
> So, do you have any plans on dealing with a or b?

So the stable component IDs is dealt with - WiX will auto-generate them based 
on the relative install path of each file and a user-provided ID (to 
distinguish between the 32-bit and 64-bit installs, for example. This ID is 
currently generated from the hash of a user provided URI, which is also used to 
generate upgrade codes and a few fixed component IDs).

Installing patches is something we can defer until 3.5.1, but I am interested 
in looking into it. My main concern is that it may hurt fresh installs (for 
example, 3.5.5 is actually 3.5.0.msi+.1.msp+.2.msp+.3.msp+.4.msp+.5.msp) and 
I'm not sure that true slipstreams are supported/recommended because it will 
affect future patches (different product codes, IIRC). So fresh installs of 
later versions may have a significantly increased download size.

Because of the split into multiple MSIs, it's also possible to independently 
version some parts of it. I suspect this will only apply to the py.exe 
launcher, but if that is unchanged between 3.5.0 and 3.5.1 then we can leave 
its version at 3.5.0 and it won't be redownloaded/installed. Not a huge saving, 
but it's a possibility. I expect most MSIs will change in some way between 
versions, so an MSP is the only good way to improve upgrades (the main benefit 
of the MSI split here is we will always install the latest 32-bit launcher, and 
if you install 3.5 32-bit and 64-bit and eventually 3.6 32-bit and 64-bit 
you'll only have one launcher installed).

Another possible problem is that MSI uses file version information to determine 
whether to update files. .py files don't have version information, so MSI to 
MSI updates are probably always going to replace everything - another reason 
why MSPs are the only good choice here.

I'll chat to some of the guys who work on the Visual Studio installer, since it 
uses the same technology and is far more complex than Python's one. They may 
have some suggestions about how to approach this.

> Other issues:
> - what MSI version do you require, and what is the minimum
>   Windows version supporting that MSI version?

I need to double-check the support still, but the aim is to support back to 
Windows Vista, so I think that's Windows Installer 3.0. Of more concern is the 
installer EXE, which is going to require a minimum level C runtime that may not 
be available before we've installed...

> - Since you are going to install into Program Files by default,
>   I think the library should be precompiled by default - there
>   is little chance that a regular user can save .pyc files when
>   running Python. It might be possible to even include the pyc
>   files in the distribution, if we can arrange to somehow support
>   relative paths in co_filename.

Agreed. The library will be precompiled by default if you choose the All Users 
button on the front page, and you can control this independently through the 
customize option (to precompile Just for Me or install without precompiling).

> Regards,
> Martin

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Compile Python on Windows (OpenSSL)

2015-01-13 Thread Steve Dower
Victor Stinner wrote:
> To compile Python on Windows, there are a few information in the Developer
> Guide:
> https://docs.python.org/devguide/setup.html#windows-compiling

I'm sorry, I've been slack and haven't updated this guide with the new changes. 
That said, there aren't that many changes to what is already in the guide - 
mostly new information that I'd like to add. I'll try and get something written 
up this week.

> Python 3.5 now requires Visual Studio 2010 *SP1*, or newer Visual Studio:
> http://bugs.python.org/issue22919#msg233637

Technically, Python 3.5 requires Visual Studio 2015, as the decision was made 
to move to the newer compiler for this release (and make whatever schedule 
changes were necessary to ensure everything will be available - it was on 
python-dev, though I don't have links handy).

It will still open and build with Visual Studio 2010 SP1 or later, however, 
buildbots should move to VS 2015 as they can, since that will be the official 
toolset. (I'm not pushing too hard until 2015 RC is released, since that's when 
Microsoft start supporting upgrades to newer versions. We do have one buildbot 
that's already using VS 2015 Preview though.)

> I found PCbuild\readme.txt which is not mentionned in the devguide :-/
> https://hg.python.org/cpython/file/56f717235c45/PCbuild/readme.txt
> (at least not on the Windows section of the setup page)

That should help, since I've updated that file. Though it's a little ahead of 
its time still, so a lot of the instructions do not yet have to be followed 
strictly, and I consider being able to build with VS 2010 SP1 a feature that we 
want to keep supporting for now while we transition.

> I found some clues to build OpenSSL to be able to build the Python ssl module,
> but I still have issues.
> 
> Is there a more complete documentation?
> 
> I found how to install svn.exe, perl.exe and nasm.exe, but not how to install
> nmake.exe. I don't know the command to build OpenSSL.

You don't require perl, you don't have to install nasm or build OpenSSL. 
Calling PCBuild/get_externals.bat will get nasm and the OpenSSL sources, and 
PCBuild/build.bat will rebuild OpenSSL as necessary.

nmake is part of Visual C++, so it should be available once you have your path 
configured (PCBuild/env.bat).

So a complete guide to check out and build Python on Windows should be:

1. Install SVN and put it on your path
2. Run PCBuild\get_externals.bat (this is the only step that requires SVN)
3. Install Visual Studio 2010 SP1 or later
4. Open PCBuild\pcbuild.sln in Visual Studio *or* run PCBuild\build.bat from 
the command line.

> I don't care of building OpenSSL, my goal is only to build the Python ssl
> module. Is there a way to install a development version of OpenSSL (.lib files
> if I remember correctly) from an installer/binary?

If you can find ssleay.lib and libeay.lib somewhere, they'll probably work. If 
not, those projects are in PCBuild and will be built automatically (if 
necessary) when you build _ssl.vcxproj or _hashlib.vcxproj.

Cheers,
Steve

> My draft notes:
> 
> +Compile CPython on Windows
> +==
> +
> +To build the Python ssl extension:
> +
> +Need:
> +
> +* Visual Studio 2010 SP1 or newer
> +* CPython source code (default branch: 3.5)
> +* perl binary: ActivePerl
> +* svn binary, ex: SilkSVN
> +* nasm and nmake binaries: compile NASM (install the binary doesn't
> install nmake)
> +
> +Read PCbuild/readme.txt.
> +
> +* Build Python (in debug mode)
> +* Type: PCbuild\get_externals.bat
> +* Type: PCbuild\win32\python_d.exe PCbuild\prepare_ssl.py
> externals\openssl-1.0.1j
> 
> Victor
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Compile Python on Windows (OpenSSL)

2015-01-13 Thread Steve Dower
Victor Stinner wrote:
> 2015-01-13 23:18 GMT+01:00 Steve Dower :
>> Technically, Python 3.5 requires Visual Studio 2015
> 
> For me, it's *very* difficult to find how to install Visual Studio.
> There are many different websites and web pages which mention Visual Studio 
> with
> a lot of versions and "flavors" (Express, Community, Ultimate, etc.).

http://www.visualstudio.com/ is the only website to look at, and it may 
redirect you to somewhere on microsoft.com. Anywhere else is sketchy.

> Visual Studio 2015 was not released yet :-/

Yes, the timing is a little bit awkward, which is why I'm keen to make sure VS 
2010 keeps working for now.

> My VM has only a disk of 40 GB. Only 12 GB are free. I already have VS
> 2008 Express and VS 2010 Express installed. I understood that "Ultimate"
> includes a *lot* of things, not only a C compiler.

I appreciate this, and I'm constantly trying to get a version released that is 
just the compiler and nothing else. Unfortunately, I'm one lone low-level 
engineer, and releasing a different package like this is a high-level decision 
that I have no control over. Because VS 2015 is in preview, the only available 
version is Ultimate, but when the RC is released I'd expect to be able to 
choose the more specific versions.

> I found a "free" Visual Studio which is in fact Visual Studio 2013 Community 
> and
> I read that it's not free.

Community Edition is certainly free (as in $0 - if you want to get ideological 
about "free" then you'll make it very hard for yourself to use any software 
produced by a business). The only requirement is that you log in with a 
Microsoft (a.k.a Live.com/Hotmail) account. It's a dumb requirement, but again, 
this is a high-level decision that I get no say in.

> I sent an email to Brian Curtin to ask to renew my MSDN account. He didn't 
> reply
> yet.

Give him a chance, I'm sure he's just busy :)

> Victor

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Compile Python on Windows (OpenSSL)

2015-01-13 Thread Steve Dower
Victor Stinner wrote:
> 2015-01-13 23:46 GMT+01:00 M.-A. Lemburg :
>> Just a note of caution: for older preview releases of VS the only way 
>> to get back to a clean system was to reinstall Windows.
>
> Does it mean that it's not possible to have VS 2008 and VS 2015 installed at 
> the same time?

It's possible, and that configuration will be fine.

Until VS 2015 RC is released, there's no guarantee that it will uninstall or 
upgrade cleanly. The testing so far looks like it'll be fine, but there's no 
guarantee.

There's also a chance that it will interfere with VS 2013, but any earlier 
versions will be fine.

Cheers,
Steve

> VS 2008 is required to build Python 2.7.
>
> Victor
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Compile Python on Windows (OpenSSL)

2015-01-15 Thread Steve Dower
Victor Stinner wrote:
> 2015-01-15 22:39 GMT+01:00 Ryan Gonzalez :
> > http://www.microsoft.com/en-us/download/details.aspx?id=8279
> 
> "Microsoft Windows SDK for Windows 7 and .NET Framework 4"
> 
> Are you sure that it is SDK 7.1, and not 7.0?

The naming is horrible, and the bugs between VS and the SDK are also horrible. 
I'm sorry.

SDK 7.0 == "Windows SDK for Windows 7 and .NET Framework 3.5"
SDK 7.1 == "Windows SDK for Windows 7 and .NET Framework 4"

So this is the correct link for building Python 3.3 and 3.4. It's also the one 
you want to keep building the latest code with the old compiler.

> --
> 
> The SDK 7.0 works for Python 2.7 which is compiled with Visual Studio 2008.
> 
> I used the SDK 7.1 for Python 3.3 and 3.4 which are compiled with Visual 
> Studio
> 2010.
> 
> It looks likt SDK 8 is more for Visual Studio 2012.
> 
> If you use the wrong SDK, you will depend on a "MSVCRxxx.dll" which is not
> provided by Python x.x (ex: MSVCR100.dll for SDK 7.1/Python 3.3 & 3.4).

This information is all entirely correct. Worse, if you depend on the wrong 
runtime version, you'll get unexpected crashes and other errors.

Cheers,
Steve

> Victor
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Azure event hub network access

2015-02-05 Thread Steve Dower
This would be much better posted on the github page for the project. I don't 
have the URL handy, but if you search github for "Python Azure SDK" you'll find 
it.

Cheers,
Steve

Sent from my Windows Phone

From: syed khalid<mailto:[email protected]>
Sent: ‎2/‎5/‎2015 21:27
To: [email protected]<mailto:[email protected]>
Cc: [email protected]<mailto:[email protected]>
Subject: [Python-Dev] Azure event hub network access

I am getting http error 404. I am able to access the site via telnet which 
eliminates network issues. Here is the code and subsequent errors



user/bin/python
import sys
import azure
import socket

from azure.servicebus import (
  _service_bus_error_handler
  )

from azure.servicebus.servicebusservice import (
  ServiceBusService,
  ServiceBusSASAuthentication
  )

from azure.http import (
  HTTPRequest,
  HTTPError
  )

from azure.http.httpclient import _HTTPClient

class EventHubClient(object):

def sendMessage(self,body,partition):
eventHubHost = 
"pac-ns.servicebus.windows.net<http://pac-ns.servicebus.windows.net>"

httpclient = _HTTPClient(service_instance=self)

sasKeyName = "pac-pl"
sasKeyValue = "IhkEepQPLfSy9jo6H2Y="

authentication = ServiceBusSASAuthentication(sasKeyName,sasKeyValue)

request = HTTPRequest()
request.method = "POST"
request.host = eventHubHost
request.protocol_override = "https"
#request.path = "/myhub/publishers/" + partition + "/messages?api-version=20
14-05"
request.body = body
request.headers.append(('Content-Type', 'application/atom+xml;type=entry;cha
rset=utf-8'))

authentication.sign_request(request, httpclient)

request.headers.append(('Content-Length', str(len(request.body
status = 0

try:
resp = httpclient.perform_request(request)
status = resp.status
except HTTPError as ex:
status = ex.status

return status

class EventDataParser(object):

  def getMessage(self,payload,sensorId):
host = socket.gethostname()
body = "{ \"DeviceId\" : \"" + host + "\",\"SensorData\": [ "

msgs = payload.split(",")
first = True

for msg in msgs:
# print msg
  sensorType = msg.split(":")[0]
sensorValue = msg.split(":")[1]
  if first == True:
first = False
  else:
body += ","

  body += "{ \"SensorId\" : \"" + sensorId + "\", \"SensorType\" : \"" + sen
sorType + "\", \"SensorValue\" : " + sensorValue + " }"
body += "]}"

return body

hubClient = EventHubClient()
parser = EventDataParser()
hostname = socket.gethostname()
sensor = sys.argv[2]

body = parser.getMessage(sys.argv[1],sensor)
hubStatus = hubClient.sendMessage(body,hostname)
# return the HTTP status to the caller
print hubStatus
print hostname
print sensor




~/IOT/AZURE$ python send.py temperature:22,humidity:20 deviceid

404
ubuntu
deviceid
{ "DeviceId" : "ubuntu","SensorData": [ { "SensorId" : "deviceid", "SensorType" 
: "temperature", "SensorValue" : 22 },{ "SensorId" : "deviceid", "SensorType" : 
"humidity", "SensorValue" : 20 }]}




--
Syed Khalid

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-10 Thread Steve Dower
I was also surprised as I was working on the installer, so +1 on changing it.

The installer will also need some changes to add it to PATH, which should be 
fairly straightforward, but ping me if you need/want pointers. (It's checked in 
now, so I consider it fair game for anyone who wants to change it.)

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎2/‎10/‎2015 5:40
To: Nick Coghlan<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

On 10 February 2015 at 13:34, Nick Coghlan  wrote:
> I was actually surprised it didn't already work that way, given that almost
> everything else on Windows is version specific.

That's actually a point I missed making. While I wouldn't class myself
as "typical", when I went looking for the user-scripts directory on my
machine, I automatically looked in %APPDATA%\PythonXY. I suspect that
many people would assume this was how it worked anyway, and be
surprised by the current behaviour.

Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-10 Thread Steve Dower
One of my main engineering concerns is lack of shared knowledge a.k.a. the 
truck factor (not CPython specific, btw, just every project I work on). So I'm 
always keen to get multiple people working on new code asap. I also prefer 
installers to be treated as part of the product and updated with whatever 
changes affect it, though that basically never happens in my experience :)

I assume the PEP will need updating if it specifies the exact path, and the 
installer readme may have a reference too. Presumably it'll only affect 3.5, as 
previous versions wouldn't use the directory for anything other than installing 
scripts.

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎2/‎10/‎2015 6:41
To: Steve Dower<mailto:[email protected]>
Cc: Nick Coghlan<mailto:[email protected]>; Python 
Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

On 10 February 2015 at 14:13, Steve Dower  wrote:
> The installer will also need some changes to add it to PATH, which should be
> fairly straightforward, but ping me if you need/want pointers. (It's checked
> in now, so I consider it fair game for anyone who wants to change it.)

I was sort of hoping you'd be doing that independently, but never mind
:-) I'll give it a go and shout if I get stuck.

Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-10 Thread Steve Dower
Martin v. Löwis wrote:
> Am 10.02.15 um 16:41 schrieb Steve Dower:
>> One of my main engineering concerns is lack of shared knowledge a.k.a. the
>> truck factor (not CPython specific, btw, just every project I work on).
> 
> Wrt. the installer, I think this is a lost cause. IIUC, you aren't really
> getting familiar with msi.py, and you are the one who has the highest chances 
> -
> so I was the only real maintainer of it.
> Likewise, the Wise installer was only maintained by Tim Peters.
> 
> So chances are really high that you will be the only one making substantial
> changes to the WiX files, although some people might learn how to build the
> installer.

Aww, come on. Let me have a little bit of hope ;)

> Regards,
> Martin
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-10 Thread Steve Dower
So I've enumerated the problems with PATH on Windows before (and my subsequent 
dislike for modifying it through the installer), but here's the dot-point 
summary for those who haven't seen it.

* System-wide values always precede per-user values
* Most-recently-installed values always precede existing values (within the 
system/user separation above)
* It's impossible to specify per-user values from a system-wide installer
* The system-wide value has a length limit that silently breaks PATH if you 
exceed it
* It's difficult for users to modify PATH themselves (mostly due to bad UI in 
Windows)

The py.exe launcher solves many of these problems, but does not help with 
installed scripts. It's trivially easy to end up in a place where this would 
fail:

pip install --user spam
spam

The *only* case where this will work reliably (without manual user 
configuration) is where Python 3.5 is the only installed version on the 
machine, and it was installed by the current user just for them.

As we've seen from earlier discussions, the main beneficiaries of having Python 
on PATH are those using the command-line. Most scripts are going to make 
assumptions or work unnecessarily hard to find the actual location of the 
Python version they need.

My best idea for dealing with this is to add another script alongside the 
py.exe launcher called `activate-py`.[1] This script would take the same 
command-line version argument as py.exe and use it to update the current 
prompt's PATH correctly. Specifically, I expect the script would actually use 
py.exe to invoke the requested Python and get the paths directly from 
sysconfig, which will ensure that the order of precedence always matches.

Users would need to run `activate-py`, `activate-py -2` or `activate-py -3.5` 
(etc.) when they start their session.[2] This parallels venv's `activate` 
command, though because this would be a global command I believe the `-py` 
suffix is necessary. The example above becomes:

activate-py -3.5
pip install --user spam
spam

A `deactivate-py` command would also be added to revert the changes, though I 
don't expect that to be part of most workflows.

Another benefit is that shell scripts could call `activate-py` rather than 
trying to detect whether Python is already on the path or requiring a PYTHON 
variable to be set. (I seem to write these scripts all the time and know that 
I'd benefit from it.)

This is yet another attempt to try and change user behaviour, which I'm not 
thrilled about, but I'm really starting to feel that this is the best way out 
of a bad situation. It differs from the solutions used on Linux, though there 
may be some value in this approach there too. Thought/votes/suggestions?

Cheers,
Steve


[1]: Actually multiple scripts to handle cmd.exe/PowerShell, but this is an 
implementation detail. Users would simply type `activate-py` and the shells 
know which one to use.

[2]: We can easily add Start Menu shortcuts (e.g. "Python 3.5 (32-bit) Command 
Prompt") and run it for them, though that is not a critical part of this 
proposal.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-10 Thread Steve Dower
Paul Moore wrote:
> On 10 February 2015 at 20:50, Paul Moore  wrote:
>> On 10 February 2015 at 17:45, Steve Dower  wrote:
>>> This is yet another attempt to try and change user behaviour, which I'm not 
>>> thrilled
>>> about, but I'm really starting to feel that this is the best way out of a 
>>> bad situation.
>>> It differs from the solutions used on Linux, though there may be some value 
>>> in this
>>> approach there too. Thought/votes/suggestions?
>>
>> I have to admit, I agree with you. But before the "Add Python to PATH"
>> option was added to the installer, we repeatedly got requests for it
>> and it was apparently a constant source of confusion for beginners. If
>> we're going to revert that change, we'll need to be very careful how
>> we present it.
> 
> Drat - hit "Send" too soon.
> 
> Also, the proposed scripts won't be on PATH, so users will have to run
> them using explicit paths, which is both inconvenient and poses a
> discoverability issue (Tools/scripts/win_add2path.py has been round
> for ages, but AFAIK hardly anyone uses it). I wonder if there's a way
> to get the launcher (py.exe) to help? For powershell, we could have
> "py --setpath" write the appropriate path setting command to stdout,
> and users could use "Invoke-Expression $(py --setpath)", for example.
> That's a bit clumsy, and doesn't work for cmd.exe, but maybe there's
> possibilities... Essentially, py.exe is the only command guaranteed to
> be on PATH for any install (or is it? for a user install, is it stuck
> somewhere in the user's APPDATA?)

(For a user install, I've guaranteed that the launcher will be added to the
user's PATH. But a system-wide launcher will win.)

win_add2path.py does the same thing as the installer, so it isn't a useful
solution.

The `py --setpath` is basically my idea with `activate-py`, though with the
"Invoke-Expression" part handled in the script (and not actually using
Invoke-Expression, but that's implementation details). If these are part of the
launcher, then they'll always be on PATH, and if they're just thin wrappers
around py.exe then they can support all the same versions of Python (in effect,
all of them, though with the 32/64-bit per-user collisions that existed
pre-3.5).

> It's fair enough to say that installers shouldn't be in the business
> of messing with PATH, but nevertheless, people expect to run an
> installer and have the installed programs available for use. Command
> line utilities like Mercurial do it, so people will expect Python to.
> Unfortunately.

And Python does, as long as that installed program is "py". The problem is that
people expect "python" to be there and be the correct one (for a totally
arbitrary definition of "correct") as well as pip, easy_install and anything
installed by those two tools, whether they were installed for all users or just
the current one. It's far more complex than a single app (especially when you
realise that a system-wide install is effectively trying to make Python look
like part of the OS - we only get that about 50% right now...).

> Sorry, all problems, no real answers here.
> Paul

Yeah, same. `activate-py` is the best I've got.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-12 Thread Steve Dower
You're not alone, that's exactly how I do it too.

I'm writing up a PEP for the activate-py command I suggested earlier that will 
temporarily set your PATH. If that goes well then we'll be able to ship that 
with the py.exe launcher (I'm particularly excited for batch files to be able 
to use it).

Cheers,
Steve

Top-posted from my Windows Phone

From: Thomas Heller<mailto:[email protected]>
Sent: ‎2/‎12/‎2015 0:03
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

Am 10.02.2015 um 18:45 schrieb Steve Dower:
> As we've seen from earlier discussions, the main beneficiaries of
> having Python on PATH are those using the command-line. Most scripts
> are going to make assumptions or work unnecessarily hard to find the
> actual location of the Python version they need.

Maybe I'm more or less alone with the way I work, but I don't like
python.exe on my PATH (and py.exe alloes me to do this).
I start python scripts from the command line either with 'script.py'
or 'py -3.4 script.py' or 'py -2.7 script.py'.

I even like running scripts in this way:
'py -2.7 -m pip install whatever'.  However, this only works when the
script also can be started as package.  Some packages allow this,
some don't.

Could not py.exe be extended so that it allows starting scripts in a
somewhat similar way?  'py-script -2.7 myscript foo bar baz' ???
Which would execute the script myscript.exe, myscript.bat, myscript.py,
myscript.cmd or whatever is in the Scripts directory on the Python 2.7
installation, without changing PATH presistently?

Thanks,
Thomas

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-12 Thread Steve Dower
If venv's activate script sets it, I say go ahead and write it up. If it's just 
virtualenv, I'd rather not explicitly depend on it, especially since PEP 397's 
stated aim is file associations and not command line.

I've been making changes to py.exe in hg.p.o, so I hope the standalone one is 
tracking. The msi for it as part of the official build can also standalone, so 
maybe we should merge the two?

Top-posted from my Windows Phone

From: Paul Moore
Sent: ‎2/‎12/‎2015 6:48
To: Thomas Heller
Cc: Python Dev
Subject: Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

On 12 February 2015 at 08:05, Thomas Heller  wrote:
> Maybe I'm more or less alone with the way I work, but I don't like
> python.exe on my PATH (and py.exe alloes me to do this).
> I start python scripts from the command line either with 'script.py'
> or 'py -3.4 script.py' or 'py -2.7 script.py'.

This is how I worked for a long time after py.exe became available.
But then I discovered virtualenv, and started using that, and needing
to use 2 completely different command sets for "when I'm in a
virtualenv" vs "when I'm not" became completely unusable.

If py.exe detected when the environment variable VIRTUAL_ENV was set,
and used that virtualenv as the default Python rather than the
"system" python it normally used, this would be perfect.

I think I'll write a PEP for this. Do people think it's a reasonable idea?

(On that note, is there any relationship between the py.exe shipped
with Python and the standalone version Vinay used to maintain but
which now appears to be hosted at
https://bitbucket.org/pypa/pylauncher? The two seem to be different,
for example the pypa version registers pyz/pyzw extensions).

Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-12 Thread Steve Dower
Paul Moore wrote:
> 
> On 12 February 2015 at 15:37, Steve Dower  wrote:
>> If venv's activate script sets it, I say go ahead and write it up. If
>> it's just virtualenv, I'd rather not explicitly depend on it,
>> especially since PEP 397's stated aim is file associations and not command
> line.
> 
> Yep, venv uses it too (see
> https://hg.python.org/cpython/file/9e10c4255277/Lib/venv/scripts/nt/activate.bat).
> 
> As people like Thomas (and me, until this issue stopped me :-)) are using the
> launcher for command line use, I think it's fair to broaden the scope to make
> command line usage more convenient. I agree that PEP
> 397 was originally focused mainly on file associations, but I think it's worth
> looking beyond that now.

That's roughly the premise behind my activate-py proposal. Use `activate` to 
make a virtualenv/venv the default, and `activate-py [-x[.y[-32]]]` to make a 
non-venv the default. I have proof of concept implementations already for 
cmd.exe and PowerShell and it's fairly simple, but writing up the rationale is 
time consuming (and also the main point - it's worth having all the problems 
with PATH documented in one place).

>> I've been making changes to py.exe in hg.p.o, so I hope the standalone
>> one is tracking. The msi for it as part of the official build can also
>> standalone, so maybe we should merge the two?
> 
> Hmm, sadly I don't think it is. Originally the standalone one was (I
> believe) provided by Vinay for people using Pythons that didn't have it 
> bundled,
> and to add features (such as the new file extensions) on a quicker timescale
> than Python releases. But since he passed it to the pypa umbrella I don't 
> think
> he's been keeping the two in sync. I've copied him in case I'm completely 
> wrong
> on this.
> 
> Personally if we now have a standalone launcher MSI, I'd like to discontinue 
> the
> external one completely, and officially publish the standalone launcher MSI on
> python.org as a service for users of older Pythons. There seems little reason 
> to
> maintain 2 repos if we don't have to. We could merge in changes from the
> external repo before discontinuing it, but I'm not sure how controversial that
> would be (for example, would it need a PEP to include the 2 new extensions?)

None of my installer changes so far have had a PEP, and only a few people have 
complained about that :) (it does have more documentation than I've ever 
written for an installer before though)

IIRC, there was a PEP for executing ZIP files directly (2.6-era?), which I 
believe are the purpose of those extensions. If "py.exe spam.pyz" already 
works, I don't see any need for a PEP to add the association in the installer.

Cheers,
Steve

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-12 Thread Steve Dower
Vinay Sajip wrote:
> By the way, although I turned over the standalone launcher to pypa, I forked
> that repo, and do development on my fork [1]. I remembered that I added a
> feature (with the help of Pawel Jasinski) to allow e.g. py -ipy to pick a
> command 'ipy' configured in the .ini file (this is used to launch IronPython,
> but it could be used for other things too). In addition, my version has some
> bugfixes (e.g. use of iswspace instead of isspace, which is wrong). Steve's
> changes seem to just be related to adding IP_VERSION - I'm not sure what 
> that's
> about and I haven't looked into it yet; I just skimmed the differences, and
> didn't see anything major in launcher.c (I compared with the version in the
> default branch of cpython).

I thought I did more than that, but maybe that was attempting to make things 
work :) The default branch is the most up to date.

The big change is that the registry key for 32-bit Python now includes the 
"-32" suffix, so that you can install 32-bit and 64-bit versions per-user at 
the same time and we don't have a collision. The launcher needed some updates 
to handle that, since it was assuming that registry key names would never be 
more than three characters long. Probably everything else I did was elsewhere 
in Python or in the installer. (Btw, it sounds like your installer will work 
better as a standalone tool, though my MSI has the advantage that it won't 
collide with a Python 3.5+ installation. I'm not fussed about whose 'wins' 
though.)

Cheers,
Steve

> Regards,
> 
> Vinay Sajip
> 
> [1] https://bitbucket.org/vinay.sajip/pylauncher
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 471 (scandir): Poll to choose the implementation (full C or C+Python)

2015-02-13 Thread Steve Dower
I think posixmodule is a great candidate for splitting up by platform rather 
than function, as the whole file is packed with ifdef. It's really only lacking 
a volunteer to do it, but we could start here (ie. make posixmodule_nt.c for 
the Windows impl, etc.) and progressively move function implementations out 
over time? All the module setup and probably most of the Python layer can stay 
where it is.

More likely we're going to get bogged down discussing it again though, so if 
that happens my vote is to just make posixmodule.c 800 lines longer.

Cheers,
Steve

Top-posted from my Windows Phone

From: Antoine Pitrou<mailto:[email protected]>
Sent: ‎2/‎13/‎2015 5:44
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 471 (scandir): Poll to choose the implementation 
(full C or C+Python)

On Fri, 13 Feb 2015 08:35:00 -0500
Ben Hoyt  wrote:
>
> If we go ahead with the all C approach, I'd be in favour of
> refactoring a little and putting the new scandir code into a separate
> C file. There are two ways to do this: a) sticking with a single
> Python module and just referencing the non-static functions in
> scandir.c from posixmodule.c, or b) sharing some functions but making
> _scandir.c its own importable module. Option (a) is somewhat simpler
> as there's not module setup stuff twice, but I don't know if there's a
> precedent for that way of doing things.

The _io module already does things that way (the (a) option, I mean).

Regards

Antoine.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-13 Thread Steve Dower
Launching non-Python scripts from py.exe is not going to work as well as you 
may hope. There will be numerous subtle bugs due to the cmd->py.exe->cmd 
wrapping (Powershell users would have seen this with some console apps or batch 
files). I think having a global command to add a particular Python to PATH for 
the current session will work best here, and yes, I'm working on it.

If py.exe starts defaulting to whatever is on PATH then I don't see the point 
of it. Knowing that you'll get the latest 2.x version by default is quite handy 
(I'd be quite okay changing that to 3.x, though it is specified in the original 
PEP). For me, the point of py.exe is to be able to ignore PATH completely.

Adding more commands to the launcher args (eg. -ipy) will make the parsing far 
more complex, especially when deciding which args to consume and which to 
forward. I think you can make a copy of the launcher called ipy.exe and add 
ipy.ini with the path to IronPython in it as default.

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎2/‎13/‎2015 3:20
To: Glenn Linderman<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

On 13 February 2015 at 10:15, Glenn Linderman  wrote:
> Maybe restricting it to running ".py" files or ".exe" files would be
> reasonable. That covers entry points (which should be the norm for
> newer projects) and Python scripts (which are the most likely things
> to be portable).
>
> The WINDOWS py launcher hardly needs to be portable.  Batch/CMD files also
> seem useful on WINDOWS. And Powershell?
>
> If a launcher is developed for or enhanced for other systems, shell scripts
> may be useful, and Batch/CMD not.

By "portable" in this sense I meant "not written by a Unix developer
who hadn't thought about Windows much". I was comparing Python files
with a .py extension and extensionless Python files, specifically (my
wording didn't make that clear, sorry). Yes, files with extensions of
.bat or .cmd or .ps1 are probably written for Windows only. But I
think it's getting out of scope of the launcher to decide to use
cmd.exe to launch .bat and .cmd files, and powershell to launch .ps1
files.

Regardless, my real point was that there can be all sorts of stuff in
the Scripts directory, and I'm not convinced that this is a direction
the launcher should be going in. Someone *could* make a case for
launching certain types of file that might be in there, but I'm not
going to be that person.

One thought - it's not hard using pkg_resources to enumerate all
available console_script entry points, pick one and run it. So you
could pretty simply write a script (that itself could be run with the
launcher) to run anything in Scripts that's built via entry points
(which is the recommended way these days).

# launch.py
import sys
import pkg_resources

# Get the script name
script = sys.argv[1]
# Remove our name from sys.argv
del sys.argv[0]

# There's probably a better API you can use
for ep in pkg_resources.working_set.iter_entry_points('console_scripts'):
if ep.name == script:
fn = ep.load()
sys.exit(fn())

# Couldn't find the entry point
print("No entry point called {} available".format(script), file=sys.stderr)
sys.exit(1)

Now you can do "py launch.py pip --help" and it will run pip for you.

If a project isn't exposing its scripts as entry points, ask them to :-)

Paul

Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] subclassing builtin data structures

2015-02-14 Thread Steve Dower
"Instead of requiring *every* subclass to override all the methods,
couldn't we require the base classes (like int) to assume that the
signature is unchanged and call type(self), and leave it up to the
subclass to override all the methods *only* if the signature has
changed?"

I assumed everyone was just saying this point over and over, so I haven't been 
following the thread closely. This is precisely how inheritance works: 
subclasses are constrained by the base class. If you want to play, you *must* 
play by its rules. (Else, use composition.)

It's fine for base classes to assume a compatible constructor, and if builtins 
can do it without hurting performance for the non-subclassed case, I don't see 
why not.

Cheers,
Steve

Top-posted from my Windows Phone

From: Steven D'Aprano<mailto:[email protected]>
Sent: ‎2/‎14/‎2015 4:24
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] subclassing builtin data structures

On Fri, Feb 13, 2015 at 06:03:35PM -0500, Neil Girdhar wrote:
> I personally don't think this is a big enough issue to warrant any changes,
> but I think Serhiy's solution would be the ideal best with one additional
> parameter: the caller's type.  Something like
>
> def __make_me__(self, cls, *args, **kwargs)
>
> and the idea is that any time you want to construct a type, instead of
>
> self.__class__(assumed arguments…)
>
> where you are not sure that the derived class' constructor knows the right
> argument types, you do
>
> def SomeCls:
>  def some_method(self, ...):
>return self.__make_me__(SomeCls, assumed arguments…)
>
> Now the derived class knows who is asking for a copy.

What if you wish to return an instance from a classmethod? You don't
have a `self` available.

class SomeCls:
def __init__(self, x, y, z):
...
@classmethod
def from_spam(cls, spam):
x, y, z = process(spam)
return cls.__make_me__(self, cls, x, y, z)  # oops, no self


Even if you are calling from an instance method, and self is available,
you cannot assume that the information needed for the subclass
constructor is still available. Perhaps that information is used in the
constructor and then discarded.

The problem we wish to solve is that when subclassing, methods of some
base class blindly return instances of itself, instead of self's type:


py> class MyInt(int):
... pass
...
py> n = MyInt(23)
py> assert isinstance(n, MyInt)
py> assert isinstance(n+1, MyInt)
Traceback (most recent call last):
  File "", line 1, in ?
AssertionError


The means that subclasses often have to override all the parent's
methods, just to ensure the type is correct:

class MyInt(int):
def __add__(self, other):
o = super().__add__(other)
if o is not NotImplemented:
o = type(self)(o)
return o


Something like that, repeated for all the int methods, should work:

py> n = MyInt(23)
py> type(n+1)



This is tedious and error prone, but at least once it is done,
subclasses of MyInt will Just Work:


py> class MyOtherInt(MyInt):
... pass
...
py> a = MyOtherInt(42)
py> type(a + 1000)



(At least, *in general* they will work. See below.)

So, why not have int's methods use type(self) instead of hard coding
int? The answer is that *some* subclasses might override the
constructor, which would cause the __add__ method to fail:

# this will fail if the constructor has a different signature
o = type(self)(o)


Okay, but changing the constructor signature is quite unusual. Mostly,
people subclass to add new methods or attributes, or to override a
specific method. The dict/defaultdict situation is relatively uncommon.

Instead of requiring *every* subclass to override all the methods,
couldn't we require the base classes (like int) to assume that the
signature is unchanged and call type(self), and leave it up to the
subclass to override all the methods *only* if the signature has
changed? (Which they probably would have to do anyway.)

As the MyInt example above shows, or datetime in the standard library,
this actually works fine in practice:

py> from datetime import datetime
py> class MySpecialDateTime(datetime):
... pass
...
py> t = MySpecialDateTime.today()
py> type(t)



Why can't int, str, list, tuple etc. be more like datetime?



--
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Can I replace distutils.msvccompiler?

2015-02-14 Thread Steve Dower
I'm about to start doing a rework on distutils.msvc[9]compiler.MSVCCompiler for 
Python 3.5 to be able to handle forward-compatibility better. Right now I've 
tweaked msvc9compiler enough for VS 2015, but it won't handle later VS versions 
automatically.


Is there any reason to keep the old msvccompiler and msvc9compiler modules 
around? If possible I'd like to drop them completely and just have one 
implementation (probably distutils.msvccompiler.MSVCCompiler again).


Obviously it will be behaviourally compatible with 3.4 and compatible with the 
CCompiler interface, but it may not be function-for-function compatible with 
distutils.msvc9compiler (e.g. get_build_version is not useful). Do we need a 
deprecation period? msvccompiler is mentioned in the docs, but not documented, 
and msvc9compiler is not even mentioned.


Thanks,

Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 441 - Improving Python ZIP Application Support

2015-02-15 Thread Steve Dower
"Go ahead, make my pep."

We should make a python-dev t-shirt with this on it :)

Top-posted from my Windows Phone

From: Daniel Holth<mailto:[email protected]>
Sent: ‎2/‎15/‎2015 9:46
To: Nick Coghlan<mailto:[email protected]>
Cc: Paul Moore<mailto:[email protected]>; Steve 
Dower<mailto:[email protected]>; Python 
Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 441 - Improving Python ZIP Application Support


Go ahead, make my pep.

I will appreciate seeing it happen.

On Feb 15, 2015 8:47 AM, "Nick Coghlan" 
mailto:[email protected]>> wrote:
On 15 February 2015 at 23:21, Paul Moore 
mailto:[email protected]>> wrote:
> On 15 February 2015 at 08:59, Nick Coghlan 
> mailto:[email protected]>> wrote:
>> The other option would to cut PEP 441 way back to *just* be about
>> standardising and registering the file associations, and recommending
>> the use of pip to obtain the build machinery with (whether pyzaa,
>> pyzzer or Twitter's more comprehensive pex). It would be a short PEP,
>> but potentially still worth it for the improved visibility of the
>> decision when folks are trying to figure out what "pyz" and "pyzw"
>> files are later.
>
> Ok, thinking about this a little more.
>
> Getting the extension support is the key thing on Windows - at the
> moment, people are faced with adding their own file associations or
> putting binary data in a .py file, neither of which is a nice choice.
> Tooling is important, though - sure, you can zip the data up and put a
> header on, but it's fiddly.
>
> Which brings us full circle. A simple module, executable as "python -m
> zipapp" (see below re name) which exports a single function, pack()
> that creates the archive. If we want to provide a script to wrap the
> module, like pyvenv.py does for venv, I've no objection to that -
> presumably it would go in Tools/Scripts? If people (like me) want to
> experiment with a more programmatic API for building pyz files, they
> can do so on PyPI, and if such a thing becomes sufficiently mature we
> can look then at proposing it for inclusion in the stdlib, as an
> extension to the zipapp module.
>
> Regarding naming, I'm happy to go with zipapp if it's your preference.
> Presumably the wrapper in Tools/Scripts would be pyzipapp.py?

Or we just skip the wrapper and make "python -m zipapp" the
recommended invocation style. Adding a wrapper later is fairly easy,
but removing it would be difficult.

>
> So the usage would be something like
>
> python -m zipapp [options] dir_to_zip
>
> Options:
> -p The interpreter to use on the shebang line
> (defaulting to /usr/bin/env python)
> -o archive_name The name of the output file (defaulting to the
> source directory name with a .pyz extension)
> If the argument has no extension, add '.pyz'
> -m module:function  The entry point to call (written to __main__.py)
> Using this is an error if there is a
> __main__.py, and mandatory if there isn't
>
> If you want anything more complex, it's easy enough to write your own
> script based on zipfile, or use one of the modules on PyPI.
>
> Does this sound reasonable? If it's OK, I'll go ahead and prepare an
> update to the PEP and an implementation. (Steve, looks like I may be
> learning how to maintain the wix files after all - wish me luck :-))
> If I hear no objections in the next couple of days, I'll assume
> everyone's OK with it and I'll prepare a PEP update and a patch.

Sounds good to me.

Daniel, do you mind if Paul becomes a co-author on PEP 441 and updates
it as described? It seems a bit tidier than allocating a new PEP
number and rejecting PEP 441, when the revised proposal is essentially
just a simplified and renamed version of your original idea.

Cheers,
Nick.

--
Nick Coghlan   |   [email protected]<mailto:[email protected]>   |   
Brisbane, Australia
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 441 - Improving Python ZIP Application Support

2015-02-16 Thread Steve Dower
Paul Moore wrote:
> On 15 February 2015 at 18:25, Petr Viktorin  wrote:
>> On POSIXy systems the "python3" symlink is created in all venvs. I
>> thought (perhaps naïvely) that Windows doesn't do shebangs natively,
>> so there's some Python-specific mechanism around them, which should
>> handle "python3".
> 
> Windows doesn't have "python2" or "python3" commands, just "python".
> To choose which version you use, set PATH or use an explicit path to the
> executable.
> 
> The launcher offers shebang handling for scripts, and special-cases the
> following values for Unix compatibility:
> 
> #!/usr/bin/env python
> #!/usr/bin/python
> #!/usr/local/bin/python
> 
> They default to the "default Python" which is normally the latest Python 2
> version available, but which can be configured by the user.
> They also support adding an explicit version (python2, python3, python2.7,
> python3.4, ...)
> 
> As far as I know, this is *identical* behaviour to Unix - even to the 
> incredibly
> annoying (to me) choice of Python 2 as a default. So I reconfigure the default
> in my personal settings to Python 3. Unix users can do this too (although it 
> may
> involve a symlink in a ~/bin directory rather than an ini file change).

We could also add special-cases for "#!/usr/...python3" in the launcher on 
Windows.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] cpython: Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on

2015-02-21 Thread Steve Dower
Agreed. I've made both of these changes.

Thanks for the suggestions

Cheers,
Steve

Top-posted from my Windows Phone

From: Brett Cannon<mailto:[email protected]>
Sent: ‎2/‎21/‎2015 14:13
To: Ben Hoyt<mailto:[email protected]>; Python-Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] [Python-checkins] cpython: Issue #23152: Implement 
_Py_fstat() to support files larger than 2 GB on



On Sat Feb 21 2015 at 4:23:16 PM Ben Hoyt 
mailto:[email protected]>> wrote:
When merging some changes while working on scandir, I noticed a minor issue 
with this commit:

https://hg.python.org/cpython/rev/4f6f4aa0d80f

The definition of "struct win32_stat" has been moved to fileutils.h and renamed 
to "struct _Py_stat_struct", which is fine -- however, the old "struct 
win32_stat" definition is still present (but unused) in posixmodule.c.

So I think the old "struct win32_stat { ... }" definition can simply be removed 
from posixmodule.c now.

I don't think win32_stat is part of the stable ABI so as long as everything 
keeps working then I don't see why it needs to stick around.


Also, unrelated to this commit, I notice the _Py_attribute_data_to_stat 
function (was attribute_data_to_stat) can't fail and always returns 0, and all 
callers ignore its return value anyway. Can it be changed to return void?

Don't see why not since it's a private API.
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_stat

2015-02-21 Thread Steve Dower
Thanks! Fixed now.

Cheers,
Steve

Top-posted from my Windows Phone

From: Serhiy Storchaka<mailto:[email protected]>
Sent: ‎2/‎21/‎2015 14:14
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat 
to _Py_attribute_data_to_stat

On 21.02.15 20:04, steve.dower wrote:
> https://hg.python.org/cpython/rev/307713759a62
> changeset:   94720:307713759a62
> parent:  94718:4f6f4aa0d80f
> user:Steve Dower 
> date:Sat Feb 21 10:04:10 2015 -0800
> summary:
>Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_stat

What about time_t_to_FILE_TIME?


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_stat

2015-02-22 Thread Steve Dower
Why does it do that?

Top-posted from my Windows Phone

From: Serhiy Storchaka<mailto:[email protected]>
Sent: ‎2/‎21/‎2015 22:57
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat 
to _Py_attribute_data_to_stat

On 22.02.15 01:26, Steve Dower wrote:
> Thanks! Fixed now.

Clinic removes the declaration of _Py_time_t_to_FILE_TIME.


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat to _Py_attribute_data_to_stat

2015-02-22 Thread Steve Dower
Ah, that makes sense. Feel free to move it up a few lines (or into a header if 
that's preferred) if it's bothering you. Otherwise I can do it in about 6-8 
hours.

Cheers,
Steve

Top-posted from my Windows Phone

From: Serhiy Storchaka<mailto:[email protected]>
Sent: ‎2/‎22/‎2015 7:29
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] cpython: Issue #23152: Renames attribute_data_to_stat 
to _Py_attribute_data_to_stat

On 22.02.15 16:12, Steve Dower wrote:
> Why does it do that?

Because it is in the section of generated code.


___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [RELEASED] Python 3.5.0a2 is now available

2015-03-09 Thread Steve Dower
Thanks for finding this. I'm following up on the issue of anyone else is having 
the same issue.

As an aside, it'd be great to hear if it's worked for anyone at all :)

Cheers,
Steve

Top-posted from my Windows Phone

From: Ben Hoyt<mailto:[email protected]>
Sent: ‎3/‎9/‎2015 5:29
To: Paul Moore<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] [RELEASED] Python 3.5.0a2 is now available

I'm seeing the same issue (though I also get the missing-DLL error dialog when 
I run python.exe). -Ben

On Mon, Mar 9, 2015 at 6:20 AM, Paul Moore 
mailto:[email protected]>> wrote:
On 9 March 2015 at 09:34, Larry Hastings 
mailto:[email protected]>> wrote:
> On behalf of the Python development community and the Python 3.5 release
> team, I'm thrilled to announce the availability of Python 3.5.0a2.   Python
> 3.5.0a2 is the second alpha release of Python 3.5, which will be the next
> major release of Python.  Python 3.5 is still under heavy development, and
> is far from complete.

Hmm, I just tried to install the 64-bit "full installer" version, for
all users with the default options. This is on a PC that hasn't had
3.5 installed before, and doesn't have Visual Studio 2015 installed.
When it got to the step "precompiling standard library" I got an error
window pop up saying "python.exe - system error. The program can't
start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your
computer. Try reinstalling the program to fix this problem." All there
was was an "OK" button. Pressing that told me "Setup was successful"
but then "py -3.5 -V" gives me nothing (no error, no version, just
returns me to the command prompt). Same result if I do "& 'C:\Program
Files\Python 3.5\python.exe' -V".

Python 3.5.0a2 (64-bit) is showing in my "Add/Remove Programs".

This is Windows 7, 64-bit.

Paul
___
Python-Dev mailing list
[email protected]<mailto:[email protected]>
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/benhoyt%40gmail.com

___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Thoughts on running Python 3.5 on Windows (path, pip install --user, etc)

2015-03-09 Thread Steve Dower
Paul Moore wrote:
> I just thought I'd give installing Python 3.5 a go on my PC, now that
> 3.5a2 has come out. I didn't get very far (see earlier message) but it 
> prompted
> me to think about how I'd use it, and what habits I'd need to change.
> 
> I'd suggest that the "what's new in 3.5" document probably needs a section on
> the new installer that explains this stuff...

This is true. Right now I'm in experimentation mode, and being more aggressive 
about changing things than is probably a good idea (because it solicits 
feedback like this :) ). When things settle down I expect to end up closer to 
where we started, so there's not a huge amount of value in writing it all up 
right now. I'll get there.

> First of all, I always use "all users" installs, so I have Python in "Program
> Files" now. As a result, doing "pip install foo" requires elevation. As 
> that's a
> PITA, I probably need to switch to using "pip install --user". All that's 
> fine,
> and from there "py -3.5" works fine, as does "py -3.5 -m foo". But even if it
> is, not every entry point has a corresponding "-m" invocation (pygments'
> pygmentize command doesn't seem to, for example)

I know you're already involved in this Paul, but for everyone else there's a 
big discussion going on at https://github.com/pypa/pip/issues/1668 about 
changing pip's default behaviour to handle falling back to --user automatically.

> But suppose I want to put Python 3.5 on my PATH. The installer has an "add
> Python to PATH" checkbox, but (if I'm reading the WiX source right, I didn't
> select that on install) that doesn't add the user directory. So I need to add
> that to my PATH. Is that right? And of course, that means I need to *know* the
> user site directory ($env:LOCALAPPDATA\Python\Python35\Scripts), correct?

Correct. There's no way to add a per-user directory to PATH from an all-users 
installation (except for a few approaches that I expect/hope would trigger 
malware detectors...)

> Maybe the answer is that we simply start recommending that everyone on Windows
> uses per-user installs. It makes little difference to me (beyond the fact that
> when I want to look at the source of something in the stdlib, the location of
> the file is a lot harder to remember than C:\Apps\Python34\Lib\whatever.py) 
> but
> I doubt it's what most people will expect.

I'm okay with this. Installing for all users is really something that could be 
considered an advanced option rather than the default, especially since the aim 
(AIUI) of the all-users install is to pretend that Python was shipped with the 
OS. (I'd kind of like to take that further by splitting things more sensibly 
between Program Files, Common Files and System32, but there's very little gain 
from that and much MUCH pain as long as people are still expecting C:\PythonXY 
installs...)

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Windows installer - File associations in "per user" installs

2015-03-10 Thread Steve Dower
It's a bug. File and assign to me please.

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎3/‎10/‎2015 3:35
To: Steve Dower<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Windows installer - File associations in "per user" installs

On 9 March 2015 at 15:37, Steve Dower  wrote:
>> Maybe the answer is that we simply start recommending that everyone on 
>> Windows
>> uses per-user installs. It makes little difference to me (beyond the fact 
>> that
>> when I want to look at the source of something in the stdlib, the location of
>> the file is a lot harder to remember than C:\Apps\Python34\Lib\whatever.py) 
>> but
>> I doubt it's what most people will expect.
>
> I'm okay with this. Installing for all users is really something that could 
> be considered an advanced option rather than the default, especially since 
> the aim (AIUI) of the all-users install is to pretend that Python was shipped 
> with the OS. (I'd kind of like to take that further by splitting things more 
> sensibly between Program Files, Common Files and System32, but there's very 
> little gain from that and much MUCH pain as long as people are still 
> expecting C:\PythonXY installs...)

I've just tried a per-user install of Python 3.5a2. The machine in
question previously had (and still has) a system install of 3.4, with
"Make this Python the default" selected (so the .py extension is
associated with that version and specifically the 3.4 launcher).

I didn't get the option to associate .py files with 3.5 (there's *no
way* I'd consider that to be advanced usage - if I'm installing
Python, why wouldn't I want to associate it with .py files [1]) and I
still seem to have .py associated with the 3.4 launcher, not the 3.5
one that's in my %APPDATA% folder.

>cmd /c assoc .py
.py=Python.File
>cmd /c ftype python.file
python.file="C:\WINDOWS\py.exe" "%1" %*

I'm happy if a per-user install of 3.5 makes a per-user filetype
association (assuming such a thing is possible, I've never tried it
before) but it's absolutely not OK if we're planning on recommending
an install type that doesn't create the right association.

Paul

[1] Given that I have 3.4 and am installing an experimental 3.5
version, it's not actually at all clear cut which version I want as my
default. In all honesty, I don't think this decision is actually
something that should be defaulted. Maybe the "don't make the user
make any choices in the default selection" approach has gone a little
too far here?
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] libffi embedded in CPython

2015-03-25 Thread Steve Dower
Zachary Ware wrote:
> On Mar 25, 2015 4:22 AM, "Paul Moore"  wrote:
>> On a related note, is there any information available on how the
>> "externals" repo is maintained? In particular, should things in there
>> be exact copies of upstream, or is it OK to include extra data (in
>> this case, the results of running "configure" for the Windows build)?
>> It works for me either way, it's just a matter of how the build
>> process would be structured and maintained.
> 
> Its not extremely clear how it's "supposed to be" done; look at the 
> differences
> between how we handle OpenSSL and Tcl/Tk, for example. One way or the other,
> though, we will store the configure output so that our build doesn't depend on
> any more than it absolutely has to.

It would be nice for at least one other person to know how to do it. I can't 
see the SVN logs, but I feel like you're the only person who's touched it in a 
while :)

As well as the configure output, we sometimes include very light patching (for 
example, Tcl/Tk currently has a patch to their makefile to work around a VC14 
bug). I'm not sure whether that's considered good practice or not, but I prefer 
only needing to do it once vs. building it into the build system.

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Buildbot x86 XP-4 3.x doesn't compile anymore: drop it?

2015-03-28 Thread Steve Dower
We discussed that a while back and decided the PEP was sufficient, but I'm not 
entirely opposed to a reminder.

Probably best to repurpose this buildbot for 2.7. David has a Windows 8.1 one 
that should be marked as stable for 3.x (though it's not quite stable yet... 
AFAIK it's the only machine with VS 2015 other than mine).

Cheers,
Steve

Top-posted from my Windows Phone

From: Victor Stinner<mailto:[email protected]>
Sent: ‎3/‎28/‎2015 16:14
To: David Bolen<mailto:[email protected]>
Cc: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] Buildbot x86 XP-4 3.x doesn't compile anymore: drop 
it?


Le 28 mars 2015 21:15, "David Bolen" 
mailto:[email protected]>> a écrit :

> I'm assuming you aren't suggesting turning off the XP buildbot
> entirely, correct?

I'm talking about the 3.x slave, so only python 3.5.

Would it be possible to specify in What's New In Python 3.5 which Windows 
versions are no more supported?

Victor
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Do we need to sign Windows files with GnuPG?

2015-04-03 Thread Steve Dower
Larry Hastings wrote:
> Steve's also changed the authentication process. His new installers rely on a
> Windows digital signature technology called Authenticode where the signature 
> is
> built right into the .exe file. Windows platforms will automatically
> authenticate executables signed with Authenticode, so this is both secure and
> convenient.
> 
> Martin's build process also digitally signed the files he built, but not using
> Authenticode (or at least I don't think so). Like the Mac and source code
> releases, his automation used GnuPG to produce separate ".asc" files 
> containing
> digital signatures. This meant authentication was a manual process.

Martin previously only signed the installer with Authenticode, and generated a 
signature with GnuPG for the installer. My change now signs every binary and 
MSI in the entire installation with Authenticode, and for now I've stopped 
creating a GPG signature for the installers. I'm still providing sizes and MD5 
hashes for the user-visible downloads (except for the last alpha release, 
thanks Larry for covering for me).

With the installer also being a downloader, there are now actually 30+ files 
uploaded for each Windows release. Most of these are never seen by users unless 
they run the installer with /layout (sorry for not having changed this to 
/download yet... it's not as easily customizable as I'd hoped, but /layout is 
the standard name for this command), and if they're being downloaded by the 
installer then both hashes (embedded in the installer) and Authenticode 
signatures (embedded in each file) are being checked and will be blocked if 
they don't match. So verifying the EXE installer should always be sufficient to 
trust the rest of the installable files.

> The Authenticode approach sounds great. But there are advantages to the GnuPG
> approach too:

For reference, the main advantage of Authenticode signing is shown at 
https://technet.microsoft.com/en-us/library/dd835561(v=ws.10).aspx - about 
halfway down there are screenshots of the various dialogs that are displayed 
when you run signed vs. unsigned vs. blocked applications.

It also helps bypass SmartScreen, which will block downloaded files until 
they've developed a minimum level of trust. Simply having an Authenticode 
signature on the initial download meets this level.

(The summary of my opinion is that these two checks are sufficient for the 
initial EXE download, and the embedded hashes and signatures are sufficient for 
the rest. Having python.exe et al signed is a bonus that we've never done in 
the past.)

> * Using GnuPG means we can authenticate the files from any platform, not just
> Windows. If there were a security breach on the Python content delivery 
> network,
> any developer could get GnuPG for their platform and authenticate that the
> installers are unmodified. If we use Authenitcode,

There are tools out there for validating Authenticode on Linux, though none of 
them seem to be as complete as on Windows (it really needs the OS certificate 
store to be completely reliable), so I can certainly see the value in being 
able to verify these against a signature. My only question is whether/how this 
is better with GPG compared to say a SHA hash? I don't currently have a GPG key 
(to my knowledge), so it's not like there's any preexisting trust to build from 
- or am I misunderstanding how GPG works here?

> * GnuPG is agnostic about the data it digitally signs. So, for example, 
> Martin's
> build process digitally signs the Windows help file--the ".chm" file--produced
> by his build process. The help file Steve builds is currently completely
> unsigned; Steve says he can try signing it but he's not sure it'll work. Note
> that .chm files actually can contain live code, so this is at least a 
> plausible
> vector for attack.

Authenticode is not supported for CHM files, unfortunately. If this is the only 
file that we decide needs GPG, I'd vote to stop offering the download apart 
from the interpreter :) (Among other things, I'm not supposed to use GPG 
without specific permission from the lawyers at work because of the license...)

> My Windows development days are firmly behind me. So I don't really have an
> opinion here. So I put it to you, Windows Python developers: do you care about
> GnuPG signatures on Windows-specific files? Or do you not care?

The later replies seem to suggest that they are general goodness that nobody on 
Windows will use. If someone convinces me (or steamrolls me, that's fine too) 
that the goodness of GPG is better than a hash then I'll look into adding it 
into the process. Otherwise I'll happily add hash generation into the upload 
process (which I'm going to do anyway for the ones displayed on the d

Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-03 Thread Steve Dower
The thing is, that's exactly the same goodness as Authenticode gives, except 
everyone gets that for free and meanwhile you're the only one who has admitted 
to using GPG on Windows :)

Basically, what I want to hear is that GPG sigs provide significantly better 
protection than hashes (and I can provide better than MD5 for all files if it's 
useful), taking into consideration that (I assume) I'd have to obtain a signing 
key for GPG and unless there's a CA involved like there is for Authenticode, 
there's no existing trust in that key.

Cheers,
Steve

Top-posted from my Windows Phone

From: M.-A. Lemburg<mailto:[email protected]>
Sent: ‎4/‎3/‎2015 10:55
To: Steve Dower<mailto:[email protected]>; Larry 
Hastings<mailto:[email protected]>; Python Dev<mailto:[email protected]>; 
python-committers<mailto:[email protected]>
Subject: Re: [python-committers] [Python-Dev] Do we need to sign Windows files 
with GnuPG?

On 03.04.2015 19:35, Steve Dower wrote:
>> My Windows development days are firmly behind me. So I don't really have an
>> opinion here. So I put it to you, Windows Python developers: do you care 
>> about
>> GnuPG signatures on Windows-specific files? Or do you not care?
>
> The later replies seem to suggest that they are general goodness that nobody 
> on Windows will use. If someone convinces me (or steamrolls me, that's fine 
> too) that the goodness of GPG is better than a hash then I'll look into 
> adding it into the process. Otherwise I'll happily add hash generation into 
> the upload process (which I'm going to do anyway for the ones displayed on 
> the download page).

FWIW: I regularly check the GPG sigs on all important downloaded
files, regardless of which platform they target, including the
Windows installers for Python or any other Windows installers
I use which provide such sigs.

The reason is simple:
The signature is a proof of authenticity which is not bound to
a particular file format or platform and before running .exes
it's good to know that they were built by the right people and
not manipulated by trojans, viruses or malicious proxies.

Is that a good enough reason to continue providing the GPG
sigs or do you need more proof of goodness ? ;-)

--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try our new mxODBC.Connect Python Database Interface for free ! 


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-04 Thread Steve Dower
"Authenticode does not have a PKI"

If you got that from this discussion, I need everyone to at least skim read 
this:  https://msdn.microsoft.com/en-us/library/ie/ms537361(v=vs.85).aspx

Authenticode uses the same certificate infrastructure as SSL (note: not the 
same certificates). As I see it, anyone running on Windows has access to 
verification that is at least as good as GPG, and the only people who would 
benefit from GPG sigs are those checking Windows files on another OS or those 
with an existing GPG workflow on Windows (before this thread, I knew nobody who 
used GPG on Windows for anything, so forgive me for thinking this is very rare).

Cheers,
Steve

Top-posted from my Windows Phone

From: Wes Turner<mailto:[email protected]>
Sent: ‎4/‎4/‎2015 6:42
To: M. -A. Lemburg<mailto:[email protected]>
Cc: Python-Dev<mailto:[email protected]>; 
python-committers<mailto:[email protected]>; Larry 
Hastings<mailto:[email protected]>; Steve 
Dower<mailto:[email protected]>
Subject: Re: [Python-Dev] [python-committers] Do we need to sign Windows files 
with GnuPG?


So, AFAIU from this discussion:

* Authenticode does not have a PKI
* GPG does have PKI
* ASC signatures are signed checksums

As far as downstream packaging on Windows (people who should/could be 
subscribed to release ANNs):

For Choclatey NuGet:

* https://chocolatey.org/packages/python
* https://chocolatey.org/packages/python.x86
* https://chocolatey.org/packages/python2
* https://chocolatey.org/packages/python-x86_32
* https://chocolatey.org/packages/python3

Python(x,y):

* https://code.google.com/p/pythonxy/

For Anaconda (the MS Azure chosen python distribution):

* http://docs.continuum.io/anaconda/install.html#windows-install

...

These should/could/are checking GPG signatures for Windows packages downstream.

http://www.scipy.org/install.html

On Apr 3, 2015 5:38 PM, "M.-A. Lemburg" 
mailto:[email protected]>> wrote:
On 04.04.2015 00:14, Steve Dower wrote:
> The thing is, that's exactly the same goodness as Authenticode gives, except 
> everyone gets that for free and meanwhile you're the only one who has 
> admitted to using GPG on Windows :)
>
> Basically, what I want to hear is that GPG sigs provide significantly better 
> protection than hashes (and I can provide better than MD5 for all files if 
> it's useful), taking into consideration that (I assume) I'd have to obtain a 
> signing key for GPG and unless there's a CA involved like there is for 
> Authenticode, there's no existing trust in that key.

Hashes only provide checks against file corruption (and then
only if you can trust the hash values). GPG provides all the
benefits of public key encryption on arbitrary files (not just
code).

The main benefit in case of downloadable installers is to
be able to make sure that the files are authentic, meaning that
they were created and signed by the people listed as packagers.

There is no CA infrastructure involved as for SSL certificates
or Authenticode, but it's easy to get the keys from key servers
given the key signatures available from python.org<http://python.org>'s download
pages.

If you want to sign a package file using GPG, you will need
to create your own key, upload it to the key servers and then
place the signature up on the download page.

Relying only on Authenticode for Windows installers would
result in a break in technology w/r to the downloads we
make available for Python, since all other files are (usually)
GPG signed:

https://www.python.org/ftp/python/3.4.3/

Cheers,
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try our new mxODBC.Connect Python Database Interface for free ! 


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/


> Cheers,
> Steve
>
> Top-posted from my Windows Phone
> 
> From: M.-A. Lemburg<mailto:[email protected]<mailto:[email protected]>>
> Sent: ‎4/‎3/‎2015 10:55
> To: Steve 
> Dower<mailto:[email protected]<mailto:[email protected]>>; 
> Larry Hastings<mailto:[email protected]<mailto:[email protected]>>; Python 
> Dev<mailto:[email protected]<mailto:[email protected]>>; 
> python-committers<mailto:

Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-04 Thread Steve Dower
"Relying only on Authenticode for Windows installers would result in a break in 
technology w/r to the downloads we make available for Python, since all other 
files are (usually) GPG signed"

This is the point of this discussion. I'm willing to make such a break because 
I believe Authenticode is so much more convenient for end users that it isn't 
worth producing GPG signatures. So far, the responses seem to be:

"I'd use them on Windows" x1
"I'd consider using them on another OS" x2-3
"Please don't change" everyone else

At least that's the impression I'm getting, so I hope that helps clarify why 
I'm still not convinced it's that critical.

Cheers,
Steve

Top-posted from my Windows Phone
____
From: M.-A. Lemburg<mailto:[email protected]>
Sent: ‎4/‎3/‎2015 15:38
To: Steve Dower<mailto:[email protected]>; Larry 
Hastings<mailto:[email protected]>; Python Dev<mailto:[email protected]>; 
python-committers<mailto:[email protected]>
Subject: Re: [python-committers] [Python-Dev] Do we need to sign Windows files 
with GnuPG?

On 04.04.2015 00:14, Steve Dower wrote:
> The thing is, that's exactly the same goodness as Authenticode gives, except 
> everyone gets that for free and meanwhile you're the only one who has 
> admitted to using GPG on Windows :)
>
> Basically, what I want to hear is that GPG sigs provide significantly better 
> protection than hashes (and I can provide better than MD5 for all files if 
> it's useful), taking into consideration that (I assume) I'd have to obtain a 
> signing key for GPG and unless there's a CA involved like there is for 
> Authenticode, there's no existing trust in that key.

Hashes only provide checks against file corruption (and then
only if you can trust the hash values). GPG provides all the
benefits of public key encryption on arbitrary files (not just
code).

The main benefit in case of downloadable installers is to
be able to make sure that the files are authentic, meaning that
they were created and signed by the people listed as packagers.

There is no CA infrastructure involved as for SSL certificates
or Authenticode, but it's easy to get the keys from key servers
given the key signatures available from python.org's download
pages.

If you want to sign a package file using GPG, you will need
to create your own key, upload it to the key servers and then
place the signature up on the download page.

Relying only on Authenticode for Windows installers would
result in a break in technology w/r to the downloads we
make available for Python, since all other files are (usually)
GPG signed:

https://www.python.org/ftp/python/3.4.3/

Cheers,
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/


::: Try our new mxODBC.Connect Python Database Interface for free ! 


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/


> Cheers,
> Steve
>
> Top-posted from my Windows Phone
> 
> From: M.-A. Lemburg<mailto:[email protected]>
> Sent: ‎4/‎3/‎2015 10:55
> To: Steve Dower<mailto:[email protected]>; Larry 
> Hastings<mailto:[email protected]>; Python 
> Dev<mailto:[email protected]>; 
> python-committers<mailto:[email protected]>
> Subject: Re: [python-committers] [Python-Dev] Do we need to sign Windows 
> files with GnuPG?
>
> On 03.04.2015 19:35, Steve Dower wrote:
>>> My Windows development days are firmly behind me. So I don't really have an
>>> opinion here. So I put it to you, Windows Python developers: do you care 
>>> about
>>> GnuPG signatures on Windows-specific files? Or do you not care?
>>
>> The later replies seem to suggest that they are general goodness that nobody 
>> on Windows will use. If someone convinces me (or steamrolls me, that's fine 
>> too) that the goodness of GPG is better than a hash then I'll look into 
>> adding it into the process. Otherwise I'll happily add hash generation into 
>> the upload process (which I'm going to do anyway for the ones displayed on 
>> the download page).
>
> FWIW: I regularly check the GPG sigs on all important

Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-04 Thread Steve Dower
Small clarification: there certificates *are* the same format as for SSL, and 
OpenSSL it's able to validate them in the same way as well as generate them 
(but not extract embedded ones, AFAICT). But generally SSL certificates are not 
marked as suitable for code signing so you need to buy a separate one.

Both Martin and I have the PSF's code signing cert private key, which is how we 
can sign with the "Python Software Foundation" name. The public key is embedded 
into every signed file, just like an SSL cert is attached to a site or an 
S/MIME cert is embedded in a signed email.

Cheers,
Steve

Top-posted from my Windows Phone
____
From: Steve Dower<mailto:[email protected]>
Sent: ‎4/‎4/‎2015 7:25
To: Wes Turner<mailto:[email protected]>; M. -A. 
Lemburg<mailto:[email protected]>
Cc: python-committers<mailto:[email protected]>; 
Python-Dev<mailto:[email protected]>
Subject: Re: [python-committers] [Python-Dev] Do we need to sign Windows files 
with GnuPG?

"Authenticode does not have a PKI"

If you got that from this discussion, I need everyone to at least skim read 
this:  https://msdn.microsoft.com/en-us/library/ie/ms537361(v=vs.85).aspx

Authenticode uses the same certificate infrastructure as SSL (note: not the 
same certificates). As I see it, anyone running on Windows has access to 
verification that is at least as good as GPG, and the only people who would 
benefit from GPG sigs are those checking Windows files on another OS or those 
with an existing GPG workflow on Windows (before this thread, I knew nobody who 
used GPG on Windows for anything, so forgive me for thinking this is very rare).

Cheers,
Steve

Top-posted from my Windows Phone

From: Wes Turner<mailto:[email protected]>
Sent: ‎4/‎4/‎2015 6:42
To: M. -A. Lemburg<mailto:[email protected]>
Cc: Python-Dev<mailto:[email protected]>; 
python-committers<mailto:[email protected]>; Larry 
Hastings<mailto:[email protected]>; Steve 
Dower<mailto:[email protected]>
Subject: Re: [Python-Dev] [python-committers] Do we need to sign Windows files 
with GnuPG?


So, AFAIU from this discussion:

* Authenticode does not have a PKI
* GPG does have PKI
* ASC signatures are signed checksums

As far as downstream packaging on Windows (people who should/could be 
subscribed to release ANNs):

For Choclatey NuGet:

* https://chocolatey.org/packages/python
* https://chocolatey.org/packages/python.x86
* https://chocolatey.org/packages/python2
* https://chocolatey.org/packages/python-x86_32
* https://chocolatey.org/packages/python3

Python(x,y):

* https://code.google.com/p/pythonxy/

For Anaconda (the MS Azure chosen python distribution):

* http://docs.continuum.io/anaconda/install.html#windows-install

...

These should/could/are checking GPG signatures for Windows packages downstream.

http://www.scipy.org/install.html

On Apr 3, 2015 5:38 PM, "M.-A. Lemburg" 
mailto:[email protected]>> wrote:
On 04.04.2015 00:14, Steve Dower wrote:
> The thing is, that's exactly the same goodness as Authenticode gives, except 
> everyone gets that for free and meanwhile you're the only one who has 
> admitted to using GPG on Windows :)
>
> Basically, what I want to hear is that GPG sigs provide significantly better 
> protection than hashes (and I can provide better than MD5 for all files if 
> it's useful), taking into consideration that (I assume) I'd have to obtain a 
> signing key for GPG and unless there's a CA involved like there is for 
> Authenticode, there's no existing trust in that key.

Hashes only provide checks against file corruption (and then
only if you can trust the hash values). GPG provides all the
benefits of public key encryption on arbitrary files (not just
code).

The main benefit in case of downloadable installers is to
be able to make sure that the files are authentic, meaning that
they were created and signed by the people listed as packagers.

There is no CA infrastructure involved as for SSL certificates
or Authenticode, but it's easy to get the keys from key servers
given the key signatures available from python.org<http://python.org>'s download
pages.

If you want to sign a package file using GPG, you will need
to create your own key, upload it to the key servers and then
place the signature up on the download page.

Relying only on Authenticode for Windows installers would
result in a break in technology w/r to the downloads we
make available for Python, since all other files are (usually)
GPG signed:

https://www.python.org/ftp/python/3.4.3/

Cheers,
--
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database

Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-04 Thread Steve Dower
There's no problem, per se, but initially it was less trouble to use the 
trusted PSF certificate and native support than to add an extra step using a 
program I don't already use and trust, am restricted in use by my employer 
(because of the license and the fact there are alternatives), and developing 
the trust in a brand new certificate.

Eventually the people saying "do it" will win through sheer persistence, since 
I'll get sick of trying to get a more detailed response and just concede. Not 
sure if that's how we want to be running the project though...

Top-posted from my Windows Phone

From: Barry Warsaw<mailto:[email protected]>
Sent: ‎4/‎4/‎2015 9:11
To: [email protected]<mailto:[email protected]>
Subject: Re: [Python-Dev] [python-committers] Do we need to sign Windows files 
with GnuPG?

On Apr 04, 2015, at 02:41 PM, Steve Dower wrote:

>"Relying only on Authenticode for Windows installers would result in a break
>in technology w/r to the downloads we make available for Python, since all
>other files are (usually) GPG signed"

It's the "only" part I have a question about.

Does the use of Authenticode preclude detached GPG signatures of the exe file?
I can't see how it would, but maybe there's something (well, a lot of
somethings ;) I don't know about Windows.

If not, then what's the problem with also providing a GPG signature?

Cheers,
-Barry
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-05 Thread Steve Dower
Nathaniel Smith wrote:
> And I suspect python-dev generally doesn't put much weight on the 
> extra effort required (release managers have all been using gpg for
> decades, it's pretty trivial)

I'm aware of this, but still don't see it as a reason to unnecessarily 
duplicate process.

> or see any reason why Microsoft's internal GPL-hate should have any
> effect on the PSF's behaviour.

Seems the "internal GPL-hate" has softened even more than I was aware. The 
history for GPG was spotty, but my request was automatically approved, so I 
guess the line has been moved far enough away that I've lost that excuse :)

Now I just have to find the time to learn how to use it...

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [python-committers] Do we need to sign Windows files with GnuPG?

2015-04-05 Thread Steve Dower
"One question, if you will - I don't think this was asked so far - is
authenticode verifiable from Linux, without Windows? And does it work
for users of WINE ?"

I've seen some info suggesting that it's verifiable, but you do need to extract 
the cert and calculate the hash against less than the signed file. Seemed like 
Mono had a tool for it, but OpenSSL can handle the cert.

Currently the new installer doesn't run on Wine because of missing APIs (since 
I want to discuss alternate distribution ideas I haven't treated this as a 
priority), and I've heard they haven't implemented enough crypto yet to handle 
it, but that could be outdated.

"GPG sigs will provide protection against replay attacks"

How does this work?

Cheers,
Steve

Top-posted from my Windows Phone

From: Robert Collins<mailto:[email protected]>
Sent: ‎4/‎4/‎2015 21:59
To: Steve Dower<mailto:[email protected]>
Cc: M.-A. Lemburg<mailto:[email protected]>; Larry 
Hastings<mailto:[email protected]>; Python Dev<mailto:[email protected]>; 
python-committers<mailto:[email protected]>
Subject: Re: [Python-Dev] [python-committers] Do we need to sign Windows files 
with GnuPG?

On 4 April 2015 at 11:14, Steve Dower  wrote:
> The thing is, that's exactly the same goodness as Authenticode gives, except
> everyone gets that for free and meanwhile you're the only one who has
> admitted to using GPG on Windows :)
>
> Basically, what I want to hear is that GPG sigs provide significantly better
> protection than hashes (and I can provide better than MD5 for all files if
> it's useful), taking into consideration that (I assume) I'd have to obtain a
> signing key for GPG and unless there's a CA involved like there is for
> Authenticode, there's no existing trust in that key.

GPG sigs will provide protection against replay attacks [unless we're
proposing to revoke signatures on old point releases with known
security vulnerabilities - something that Window software vendors tend
not to do because of the dramatic and immediate effect on the deployed
base...]

This is not relevant for things we're hosting on SSL, but is if anyone
is mirroring our installers around. They dont' seem to be so perhaps
its a bit 'meh'.

OTOH I also think there is value in consistency: signing all our
artifacts makes checking back on them later easier, should we need to.

One question, if you will - I don't think this was asked so far - is
authenticode verifiable from Linux, without Windows? And does it work
for users of WINE ?

-Rob


--
Robert Collins 
Distinguished Technologist
HP Converged Cloud
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PyCon Survivor's breakfast

2015-04-12 Thread Steve Holden
Hi everybody,

This year sees the third PyCon Survivors' Breakfast at Suite 701, a restaurant 
attached to the Place d'Armes hotel just up the road from the Palais de Congres 
(map on Eventbrite page).

All Python developers, PSF members and PyCon delegates are cordially invited to 
attend. The event starts at 7:30 but you can roll in whenever you feel like 
breakfast (I start early so that those who wish to start sprinting promptly can 
still join us).

The places cost about $45 a head (I've been asked about costs, I don't really 
know why) and you have a choice of prices, including free. I don't want anyone 
to feel that inability to pay need stop them coming along to join us. Last 
year's event was a relaxing change from the Palais de Congres. I hope I see you 
there.

Sign up at http://bit.ly/PyConSurvivor2015.

Numbers are limited, but last year there was a place for everyone who wanted to 
attend. If you are at PyCon, or know someone who is, please let them know that 
this invitation extends to everyone who attended.

regards
 Steve
-- 
Steve Holden [email protected] / +1 571 484 6266 / +44 113 320 2335 / 
@holdenweb




___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [PSF-Members] PyCon Survivor's breakfast

2015-04-12 Thread Steve Holden
Indeed. I believe that the date is on the Eventbrite page, but sorry for 
omitting obviously necessary information. It's tomorrow. Hope to see you there.

S

On Apr 12, 2015, at 4:49 PM, Stephane Wirtel  wrote:

> 7h30 morning ? Tomorrow 
> 
> On 12 avr. 2015, at 4:13 PM, Steve Holden  wrote:
> 
>> Hi everybody,
>> 
>> This year sees the third PyCon Survivors' Breakfast at Suite 701, a 
>> restaurant attached to the Place d'Armes hotel just up the road from the 
>> Palais de Congres (map on Eventbrite page).
>> 
>> All Python developers, PSF members and PyCon delegates are cordially invited 
>> to attend. The event starts at 7:30 but you can roll in whenever you feel 
>> like breakfast (I start early so that those who wish to start sprinting 
>> promptly can still join us).
>> 
>> The places cost about $45 a head (I've been asked about costs, I don't 
>> really know why) and you have a choice of prices, including free. I don't 
>> want anyone to feel that inability to pay need stop them coming along to 
>> join us. Last year's event was a relaxing change from the Palais de Congres. 
>> I hope I see you there.
>> 
>> Sign up at http://bit.ly/PyConSurvivor2015.
>> 
>> Numbers are limited, but last year there was a place for everyone who wanted 
>> to attend. If you are at PyCon, or know someone who is, please let them know 
>> that this invitation extends to everyone who attended.
>> 
>> regards
>>  Steve
>> -- 
>> Steve Holden [email protected] / +1 571 484 6266 / +44 113 320 2335 / 
>> @holdenweb
>> 
>> 
>> 
>> 
>> ___
>> PSF-Members mailing list
>> [email protected]
>> https://mail.python.org/mailman/listinfo/psf-members
>> PSF home page (http://www.python.org/psf/)
>> PSF membership FAQ (http://www.python.org/psf/membership/)
>> PSF members' wiki (http://wiki.python.org/psf/)

-- 
Steve Holden [email protected] / +1 571 484 6266 / +44 113 320 2335 / 
@holdenweb




___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python3 Stable ABI

2015-04-15 Thread Steve Dower
I don't see any obvious issues, but there may be some that don't need to be 
marked stable.

Given that a mismatch here will cause build errors for users, I'm +1 on 
checking this in.

Cheers,
Steve

Top-posted from my Windows Phone

From: Zachary Ware<mailto:[email protected]>
Sent: ‎4/‎13/‎2015 17:29
To: Python-Dev<mailto:[email protected]>
Subject: [Python-Dev] Python3 Stable ABI

In issue23903, I've created a script that will produce PC/python3.def
by scraping the header files in Include.  There are are many many
discrepencies between what my script generates and what is currently
in the repository (diff below), but in every case I've checked the
script has been right: what the script finds is actually exported as
part of the limited API, but due to not being in the .def file it's
not actually exported from python3.dll.  Almost all of the differences
are things that the script found that weren't present, but there are a
couple things going the other way.

The point of this message is to ask everybody who maintains anything
in C to take a look through and make sure everything in their area is
properly guarded (or not) by Py_LIMITED_API.  Alternately, if somebody
can find a bug in my script and brain that's finding too much stuff,
that would be great too.

Ideally, after this is all settled I'd like to add the script to both
the Makefile and the Windows build system, such that PC/python3.def is
always kept up to date and flags changes that weren't meant to be
made.

Regards,
--
Zach

(I'm afraid Gmail might mangle this beyond recognition, you can find the diff at
http://bugs.python.org/review/23903/diff/14549/PC/python3.def
if it does.)

diff -r 24f2c0279120 PC/python3.def
--- a/PC/python3.defMon Apr 13 15:51:59 2015 -0500
+++ b/PC/python3.defMon Apr 13 16:10:34 2015 -0500
@@ -1,13 +1,15 @@
 ; This file specifies the import forwarding for python3.dll
 ; It is used when building python3dll.vcxproj
+; Generated by python3defgen.py, DO NOT modify directly!
 LIBRARY"python3"
 EXPORTS
+  PyAST_FromNode=python35.PyAST_FromNode
+  PyAST_FromNodeObject=python35.PyAST_FromNodeObject
+  PyAST_Validate=python35.PyAST_Validate
   PyArg_Parse=python35.PyArg_Parse
   PyArg_ParseTuple=python35.PyArg_ParseTuple
   PyArg_ParseTupleAndKeywords=python35.PyArg_ParseTupleAndKeywords
   PyArg_UnpackTuple=python35.PyArg_UnpackTuple
-  PyArg_VaParse=python35.PyArg_VaParse
-  PyArg_VaParseTupleAndKeywords=python35.PyArg_VaParseTupleAndKeywords
   PyArg_ValidateKeywordArguments=python35.PyArg_ValidateKeywordArguments
   PyBaseObject_Type=python35.PyBaseObject_Type DATA
   PyBool_FromLong=python35.PyBool_FromLong
@@ -39,7 +41,6 @@
   PyCFunction_GetFlags=python35.PyCFunction_GetFlags
   PyCFunction_GetFunction=python35.PyCFunction_GetFunction
   PyCFunction_GetSelf=python35.PyCFunction_GetSelf
-  PyCFunction_New=python35.PyCFunction_New
   PyCFunction_NewEx=python35.PyCFunction_NewEx
   PyCFunction_Type=python35.PyCFunction_Type DATA
   PyCallIter_New=python35.PyCallIter_New
@@ -58,6 +59,7 @@
   PyCapsule_SetPointer=python35.PyCapsule_SetPointer
   PyCapsule_Type=python35.PyCapsule_Type DATA
   PyClassMethodDescr_Type=python35.PyClassMethodDescr_Type DATA
+  PyCmpWrapper_Type=python35.PyCmpWrapper_Type DATA
   PyCodec_BackslashReplaceErrors=python35.PyCodec_BackslashReplaceErrors
   PyCodec_Decode=python35.PyCodec_Decode
   PyCodec_Decoder=python35.PyCodec_Decoder
@@ -68,6 +70,7 @@
   PyCodec_IncrementalEncoder=python35.PyCodec_IncrementalEncoder
   PyCodec_KnownEncoding=python35.PyCodec_KnownEncoding
   PyCodec_LookupError=python35.PyCodec_LookupError
+  PyCodec_NameReplaceErrors=python35.PyCodec_NameReplaceErrors
   PyCodec_Register=python35.PyCodec_Register
   PyCodec_RegisterError=python35.PyCodec_RegisterError
   PyCodec_ReplaceErrors=python35.PyCodec_ReplaceErrors
@@ -122,6 +125,7 @@
   PyErr_Fetch=python35.PyErr_Fetch
   PyErr_Format=python35.PyErr_Format
   PyErr_FormatV=python35.PyErr_FormatV
+  PyErr_GetExcInfo=python35.PyErr_GetExcInfo
   PyErr_GivenExceptionMatches=python35.PyErr_GivenExceptionMatches
   PyErr_NewException=python35.PyErr_NewException
   PyErr_NewExceptionWithDoc=python35.PyErr_NewExceptionWithDoc
@@ -132,14 +136,25 @@
   PyErr_PrintEx=python35.PyErr_PrintEx
   PyErr_ProgramText=python35.PyErr_ProgramText
   PyErr_Restore=python35.PyErr_Restore
+  PyErr_SetExcFromWindowsErr=python35.PyErr_SetExcFromWindowsErr
+  
PyErr_SetExcFromWindowsErrWithFilename=python35.PyErr_SetExcFromWindowsErrWithFilename
+  
PyErr_SetExcFromWindowsErrWithFilenameObject=python35.PyErr_SetExcFromWindowsErrWithFilenameObject
+  
PyErr_SetExcFromWindowsErrWithFilenameObjects=python35.PyErr_SetExcFromWindowsErrWithFilenameObjects
+  PyErr_SetExcInfo=python35.PyErr_SetExcInfo
+  PyErr_SetExcWithArgsKwargs=python35.PyErr_SetExcWithArgsKwargs
   PyErr_SetFromErrno=python35.PyErr_SetFromEr

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Steve Dower
Paul Moore wrote:
> On 20 April 2015 at 09:16, Larry Hastings  wrote:
>> There is now a third type of Windows installer for Python 3.5.  In addition
>> to the conventional installer and the web-based installer, Python 3.5 now
>> has an embeddable installer designed to be run as part of a larger
>> application's installer for apps using or extending Python.
> 
> Probably a question for Steve mostly, but how does this work, exactly?
> I see it's an exe - I was sort of expecting a zip file.

I made it a self-extracting RAR file so it could be signed, but I've already 
had multiple people query it so the next release will probably just be a plain 
ZIP file. I just need to figure out some reliable way of validating the 
download other than GPG, since I'd like installers to be able to do the 
download transparently and ideally without hard-coding hash values. I might add 
a CSV of SHA hashes to the zip too.

> Specifically, I was considering using this to make a build of Vim,
> with Python support, using a copy of Python included with Vim (so no
> reliance on there being a "system" install of Python). As Vim is open
> source, "build it yourself", I typically just compile vim and then zip
> up the application directory. So I'm not clear how an exe "embeddable"
> installer fits into that scheme. Apologies if the exe is just a
> self-extracting archive, and the answer is just "run it and tell it
> where to dump the files". I've not even had a chance to get to
> somewhere I can download the installer to try it yet :-)

It is indeed just a run-and-dump extractor. I haven't had a chance to write up 
any docs for it yet, but there are some open bugs I want to fix first 
(specifically http://bugs.python.org/issue23955) before this becomes too 
formalized.

Cheers,
Steve

> Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-21 Thread Steve Dower
Donald Stufft wrote:
> Is this version statically linked by any chance?

No, there's no change to the compilation process, so you can get exactly the 
same result by using the regular installer and copying the files around.

Not sure if this is what you're referring to, but on Windows DLLs are always 
loaded from alongside the executable before searching in other locations. I 
learned at PyCon that some platforms embed full paths for .so's (I'd always 
just assumed that there was a similar resolution process), but this is not the 
case here. Dropping all the DLLs and PYDs in the same location is sufficient to 
make sure you always load the right files, unless sys.path has been filled in 
with incorrect registry values (the bug I referenced).

Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [python-committers] [RELEASED] Python 3.5.0a4 is now available

2015-04-22 Thread Steve Dower
Whoops, sorry. Yeah, I knew about that behavior, but in hindsight it's 
obviously going to be a surprise for others :)

One plain zip file coming up for the next release. All the binaries will be 
signed and paranoid people can check the GPG sig and embed their own hashes if 
not the files themselves.

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎4/‎22/‎2015 5:48
To: Steve Dower<mailto:[email protected]>
Cc: Larry Hastings<mailto:[email protected]>; Python 
Dev<mailto:[email protected]>
Subject: Re: [python-committers] [RELEASED] Python 3.5.0a4 is now available

On 22 April 2015 at 13:45, Paul Moore  wrote:
> On 21 April 2015 at 23:05, Steve Dower  wrote:
>> I made it a self-extracting RAR file so it could be signed, but I've already 
>> had multiple people query it so the next release will probably just be a 
>> plain ZIP file. I just need to figure out some reliable way of validating 
>> the download other than GPG, since I'd like installers to be able to do the 
>> download transparently and ideally without hard-coding hash values. I might 
>> add a CSV of SHA hashes to the zip too.
>
> You could probably just leave it as is (or make it a self-extracting
> zip file) and just describe it on the web page as "Windows amd64
> embeddable self-extracting archive". People are (I think) pretty used
> to the idea that they can open a self-extracting archive in tools like
> 7-zip, so those who didn't want to run the exe could do that (and
> would know they could). Obviously extracting that way you don't get
> the signature check, but that's to be expected.

Whoops, no - I changed my mind. If you double click on the downloaded
file (which I just did) it unpacks it into the directory you
downloaded the exe to, with no option to put it anywhere else, and no
UI telling you what it's doing. That's going to annoy people badly.
Better make it a simple zipfile in that case.

Paul (off to tidy up his download directory :-()
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 492 quibble and request

2015-05-01 Thread Steve Dower
The high-level answer to this is, like yield, the function temporarily returns 
all the way up the stack to the caller who intends to advance the 
iterator/async function. This is typically the event loop, and the main 
confusion here comes when the loop is implicit.

If you explicitly define an event loop it's roughly equivalent to the for loop 
that is calling next on a generator. For pip, I expect that's what you'd have - 
a blocking function ("do_work()"?, "execute_plan()"?) that creates a loop and 
starts it's tasks running within it. Each task inside that call with be 
asynchronous with respect to each other (think about passing generators to 
zip() ) but the loop will block the rest of your code until they're all 
finished.

Cheers,
Steve

Top-posted from my Windows Phone

From: Paul Moore<mailto:[email protected]>
Sent: ‎4/‎30/‎2015 2:07
To: Greg Ewing<mailto:[email protected]>
Cc: Python Dev<mailto:[email protected]>
Subject: Re: [Python-Dev] PEP 492 quibble and request

On 30 April 2015 at 09:58, Greg Ewing  wrote:
> Ethan Furman wrote:
>>
>> Having gone through the PEP again, I am still no closer to understanding
>> what happens here:
>>
>>   data = await reader.read(8192)
>>
>> What does the flow of control look like at the interpreter level?
>
>
> Are you sure you *really* want to know? For the sake
> of sanity, I recommend ignoring the actual control
> flow and pretending that it's just like
>
>data = reader.read(8192)
>
> with the reader.read() method somehow able to be
> magically suspended.

Well, if I don't know, I get confused as to where I invoke the event
loop, how my non-async code runs alongside this etc.
Paul
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 557: Data Classes

2017-09-16 Thread Steve Holden
​I make this suggestion in trepidation, given that Guido called a halt on
the Great Naming Debate, but it seems that a short, neutral name with data
connotations previously not a part of many popular subsystems is required.

I therefore propose "row", which is sufficiently neutral to avoid most
current opposition and yet a common field-oriented mechanism for accessing
units of retrieved data by name.

regards
 Steve​

Steve Holden

On Sat, Sep 16, 2017 at 3:44 PM, Sven R. Kunze  wrote:

> Thanks for the PEP! :)
>
> I like the naming. ;) Though, I would like to add to Michel's argument in
> favor of a base class.
>
>
> On 11.09.2017 08:38, Michel Desmoulin wrote:
>
>> - I read Guido talking about some base class as alternative to the
>>>> generator version, but don't see it in the PEP. Is it still considered ?
>>>>
>>> I'm going to put some words in explaining why I don't want to use base
>>> classes (I don't think it buys you anything). Do you have a reason for
>>> preferring base classes?
>>>
>> Not preferring, but having it as an alternative. Mainly for 2 reasons:
>>
>> 1 - data classes allow one to type in classes very quickly, let's
>> harvest the benefit from that.
>>
>> Typing a decorator in a shell is much less comfortable than using
>> inheritance. Same thing about IDE: all current ones have snippet with
>> auto-switch to the class parents on tab.
>>
>> All in all, if you are doing exploratory programming, and thus
>> disposable code, which data classes are fantastic for, inheritance will
>> keep you in the flow.
>>
>> 2 - it will help sell the data classes
>>
>> I train a lot of people to Python each year. I never have to explain
>> classes to people with any kind of programming background. I _always_
>> have to explain decorators.
>>
>> People are not used to it, and even kind fear it for quite some time.
>>
>> Inheritance however, is familiar, and will not only push people to use
>> data classes more, but also will let them do less mistakes: they know
>> the danger of parent ordering, but not the ones of decorators ordering.
>>
>
> 3)  - the order of base classes can arranged appropriately
>
> In our day-to-day work, we use mixins and cooperative multiple inheritance
> a lot.
> So, having dataclasses as a base class or a mixin would be great! :)
>
> Combined with 1) and 2), I am much in favor of having dataclasses as base
> class/mixin than as a decorator.
> What are the benefits of the decorator? Maybe both is possible?
>
> Cheers,
> Sven
>
>
> PS: @Michel good observation 1). Typing decorators in shell is annoying.
>
> ___
> Python-Dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve%
> 40holdenweb.com
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 554 v3 (new interpreters module)

2017-10-03 Thread Steve Dower

On 03Oct2017 0755, Antoine Pitrou wrote:

On Tue, 3 Oct 2017 08:36:55 -0600
Eric Snow  wrote:

On Tue, Oct 3, 2017 at 5:00 AM, Antoine Pitrou  wrote:

On Mon, 2 Oct 2017 22:15:01 -0400
Eric Snow  wrote:


I'm still not convinced that sharing synchronization primitives is
important enough to be worth including it in the PEP.  It can be added
later, or via an extension module in the meantime.  To that end, I'll
add a mechanism to the PEP for third-party types to indicate that they
can be passed through channels.  Something like
"obj.__channel_support__ = True".


How would that work?  If it's simply a matter of flipping a bit, why
don't we do it for all objects?


The type would also have to be safe to share between interpreters. :)


But what does it mean to be safe to share, while the exact degree
and nature of the isolation between interpreters (and also their
concurrent execution) is unspecified?

I think we need a sharing protocol, not just a flag.


The easiest such protocol is essentially:

* an object can represent itself as bytes (e.g. generate a bytes object 
representing some global token, such as a kernel handle or memory address)

* those bytes are sent over the standard channel
* the object can instantiate itself from those bytes (e.g. wrap the 
existing handle, create a memoryview over the same block of memory, etc.)
* cross-interpreter refcounting is either ignored (because the kernel is 
refcounting the resource) or manual (by including more shared info in 
the token)


Since this is trivial to implement over the basic bytes channel, and 
doesn't even require a standard protocol except for convenience, Eric 
decided to avoid blocking the core functionality on this. I'm inclined 
to agree - get the basic functionality supported and let people build on 
it before we try to lock down something we don't fully understand yet.


About the only thing that seems to be worth doing up-front is some sort 
of pending-call callback mechanism between interpreters, but even that 
doesn't need to block the core functionality (you can do it trivially 
with threads and another channel right now, and there's always room to 
make something more efficient later).


There are plenty of smart people out there who can and will figure out 
the best way to design this. By giving them the tools and the ability to 
design something awesome, we're more likely to get something awesome 
than by committing to a complete design now. Right now, they're all 
blocked on the fact that subinterpreters are incredibly hard to start 
running, let alone experiment with. Eric's PEP will fix that part and 
enable others to take it from building blocks to powerful libraries.


Cheers,
Steve
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PEP 557: Data Classes

2017-10-12 Thread Steve Holden
On Thu, Oct 12, 2017 at 9:20 AM, Mike Miller 
wrote:

>
> On 2017-10-12 00:36, Stéfane Fermigier wrote:
>
>> "An object that is not defined by its attributes, but rather by a thread
>> of continuity and its identity." (from https://en.wikipedia.org/wiki/
>> Domain-driven_design#Building_blocks)
>>
>
> Not sure I follow all this, but Python objects do have identities once
> instantiated.  e.g. >>> id('')
>
> ​It seems to me that the quoted document is attempting to make a
distinction ​similar to the one between classes (entities) and instances
(value objects). The reason I liked "row" as a name is because it
resembles  "vector" and hence is loosely assocaited with the concept of a
tuple as well as being familiar to database users. In fact the answer to a
relational query was, I believe, originally formally defined as a set of
tuples.

​Sometimes one can simply be too hifalutin' [
http://www.dictionary.com/browse/hifalutin]​, and language that attempts to
be precise obscures meaning to the less specialised reader.

See also the more general Wikipedia definition "An entity is something that
>> exists as itself, as a subject or as an object, actually or potentially,
>> concretely or abstractly, physically or not." (
>> https://en.wikipedia.org/wiki/Entity).
>>
>> In the context of DDD, entities are usually opposed to value objects: "An
>> object that contains attributes but has no conceptual identity. They should
>> be treated as immutable.". (https://en.wikipedia.org/wiki
>> /Domain-driven_design#Building_blocks)
>>
>> Attrs, and by extension the dataclass proposal (I guess), provide some
>> support for both:
>>
>> - Providing support for quickly constructing immutable objects from a bag
>> of attributes, and providing equality based on those attributes, it helps
>> implement Value Objects (not sure much more is needed actually)
>>
>> - By supporting equality based on some "primary key", it will also help
>> with maintaining the concept of "equality" in entities.
>>
>
> I don't believe either module particularly supports or restricts
> immutability?
>
> -Mike
>
>
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] [OT] Early PyCon Pictures, anyone?

2017-10-23 Thread Steve Holden
Hi all,

I've giving a talk on the history of PyCon at PyCon UK this weekend. I'd
love to include some photos from the early conferences but alas most of the
links I've found on the web are stale and broken.

If anyone has pictures, or valid links to such pictures, I'd be delighted
to hear about them.

Thanks
Steve Holden
___
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


  1   2   3   4   5   6   7   8   9   10   >