[Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Victor Stinner
Hi,

I'm working on surrogates in filenames on Linux (more generally on BSD and 
UNIX OS) to support undecodable filenames, see PEP 383. Amaury told me that I 
only fixed the non-Windows versions (I fixed subprocess about the current 
directory and _ctypes.dlopen()), but it doesn't work on Windows.

It's a choice, I didn't want to patch Windows because I know that Windows use 
unicode internally. I consider that developers using Python3 should use 
unicode on Windows, and byte or unicode+surrogates on other OS.

I don't know well Windows API, and so I would like your opinion about that ;-)

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


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Victor Stinner
Le lundi 19 avril 2010 11:33:58, Victor Stinner a écrit :
> I'm working on surrogates in filenames on Linux (...)

Related issues:

#8391: os.execvpe() doesn't support surrogates in env
#8393: subprocess: support undecodable current working directory on POSIX OS
#8394: ctypes.dlopen() doesn't support surrogates
#8412: os.system() doesn't support surrogates nor bytes

I fixed the 3 last issues (#8393, #8394, #8412) for non-Windows OS.

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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Antoine Pitrou
Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
> 
> The recent threads on builds/installers for Mac and Windows reminded me
> of Steve Holden's push to get the python-dev team equipped via a
> connection with the Microsoft Open Source Technology Center. The OSTC
> team provides Microsoft Developer Network licenses to open source
> projects to assist them in better supporting Windows.
> 
> I've talked with Steve (who passed the task to me) and the Microsoft
> folks, and they are happy to provide more licenses if needed. If you are
> interested in getting a copy of MSDN, please contact me off-list.

Does it include a license for Windows itself?
Does it allow me to install and run it in a VM?
If so, I'm interested.

Regards

Antoine.


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


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Antoine Pitrou
Victor Stinner  haypocalc.com> writes:
> 
> It's a choice, I didn't want to patch Windows because I know that Windows use 
> unicode internally. I consider that developers using Python3 should use 
> unicode on Windows, and byte or unicode+surrogates on other OS.

I think both possibilities should be available on all OSes, so as to make it
easier to write cross-platform code. Having to switch being bytes and unicode
depending on the OS means developers will have to deal with encoding issues
themselves, which is suboptimal from a language usability's point of view.

Regards

Antoine.


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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Steve Holden
Antoine Pitrou wrote:
> Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
>> The recent threads on builds/installers for Mac and Windows reminded me
>> of Steve Holden's push to get the python-dev team equipped via a
>> connection with the Microsoft Open Source Technology Center. The OSTC
>> team provides Microsoft Developer Network licenses to open source
>> projects to assist them in better supporting Windows.
>>
>> I've talked with Steve (who passed the task to me) and the Microsoft
>> folks, and they are happy to provide more licenses if needed. If you are
>> interested in getting a copy of MSDN, please contact me off-list.
> 
> Does it include a license for Windows itself?
> Does it allow me to install and run it in a VM?
> If so, I'm interested.
> 
Yes to both. MSDN offers a very broad license, with activation keys for
many products generated on demand.

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
See PyCon Talks from Atlanta 2010  http://pycon.blip.tv/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS:http://holdenweb.eventbrite.com/

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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Michael Foord

On 19/04/2010 12:47, Antoine Pitrou wrote:

Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
   

The recent threads on builds/installers for Mac and Windows reminded me
of Steve Holden's push to get the python-dev team equipped via a
connection with the Microsoft Open Source Technology Center. The OSTC
team provides Microsoft Developer Network licenses to open source
projects to assist them in better supporting Windows.

I've talked with Steve (who passed the task to me) and the Microsoft
folks, and they are happy to provide more licenses if needed. If you are
interested in getting a copy of MSDN, please contact me off-list.
 

Does it include a license for Windows itself?
Does it allow me to install and run it in a VM?
If so, I'm interested.
   


Yes, MSDN licenses give you access to several versions of Windows plus 
the Visual Studio tools for compiling Python (amongst other things).


Michael


Regards

Antoine.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk
   



--
http://www.ironpythoninaction.com/

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


Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-19 Thread Paul Moore
On 19 April 2010 04:44, Ron Adam  wrote:
> Note that the python interpreter uses -V and --version.
>
> r...@gutsy:~$ python3.1 -V
> Python 3.1.2
> r...@gutsy:~$ python3.1 --version
> Python 3.1.2
>
> And -v is used as follows:
>
> -v     : verbose (trace import statements); also PYTHONVERBOSE=x
>         can be supplied multiple times to increase verbosity

Ironically, I'm forever mistakenly typing "python -v" to get the
version. I'm not arguing that this is the "right" behaviour, just
pointing out that it's neither unknown, nor entirely surprising to at
least one user... As others have pointed out, there's a lot of
hyperbole in this thread (not in Ron's post that I quoted, though).

If I were using argparse, which I almost certainly will in the future,
I'd use the explicit
parser.add_argument('--version', action='version', version='')
form, so I have no interest in the default version argument - it can
be deprecated, removed, kept the same or changed, it makes no
difference to me.

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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Paul Moore
On 19 April 2010 11:47, Antoine Pitrou  wrote:
> Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
>>
>> The recent threads on builds/installers for Mac and Windows reminded me
>> of Steve Holden's push to get the python-dev team equipped via a
>> connection with the Microsoft Open Source Technology Center. The OSTC
>> team provides Microsoft Developer Network licenses to open source
>> projects to assist them in better supporting Windows.
>>
>> I've talked with Steve (who passed the task to me) and the Microsoft
>> folks, and they are happy to provide more licenses if needed. If you are
>> interested in getting a copy of MSDN, please contact me off-list.
>
> Does it include a license for Windows itself?
> Does it allow me to install and run it in a VM?
> If so, I'm interested.

Yes. Arguably that's the best thing about the MSDN licenses
(particularly for non-Windows users, but even for us Windows users to
set up "clean" VM environments).

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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Tim Golden

On 19/04/2010 13:33, Paul Moore wrote:

On 19 April 2010 11:47, Antoine Pitrou  wrote:

Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :


The recent threads on builds/installers for Mac and Windows reminded me
of Steve Holden's push to get the python-dev team equipped via a
connection with the Microsoft Open Source Technology Center. The OSTC
team provides Microsoft Developer Network licenses to open source
projects to assist them in better supporting Windows.

I've talked with Steve (who passed the task to me) and the Microsoft
folks, and they are happy to provide more licenses if needed. If you are
interested in getting a copy of MSDN, please contact me off-list.


Does it include a license for Windows itself?
Does it allow me to install and run it in a VM?
If so, I'm interested.


Yes. Arguably that's the best thing about the MSDN licenses
(particularly for non-Windows users, but even for us Windows users to
set up "clean" VM environments).


For some reason I hadn't appreciated that this was the case. I'm in
the process of negotiating [*] to repurpose an out-of-work server here
as a buildbot and being able to install an O/S will smooth the
negotiations considerably. I'm especially keen to get a buildbot
running a Windows server OS rather than desktop.

TJG

[*] May come to nothing; don't hold your breath
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Brian Curtin
On Mon, Apr 19, 2010 at 06:48, Steve Holden  wrote:

> Antoine Pitrou wrote:
> > Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
> >> The recent threads on builds/installers for Mac and Windows reminded me
> >> of Steve Holden's push to get the python-dev team equipped via a
> >> connection with the Microsoft Open Source Technology Center. The OSTC
> >> team provides Microsoft Developer Network licenses to open source
> >> projects to assist them in better supporting Windows.
> >>
> >> I've talked with Steve (who passed the task to me) and the Microsoft
> >> folks, and they are happy to provide more licenses if needed. If you are
> >> interested in getting a copy of MSDN, please contact me off-list.
> >
> > Does it include a license for Windows itself?
> > Does it allow me to install and run it in a VM?
> > If so, I'm interested.
> >
> Yes to both. MSDN offers a very broad license, with activation keys for
> many products generated on demand.
>

The left panel on
http://msdn.microsoft.com/en-us/subscriptions/cc137115.aspx has the full
list of currently available products if anyone wants to know what's all
involved here.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Barry Warsaw
On Apr 19, 2010, at 08:14 AM, Brian Curtin wrote:

>On Mon, Apr 19, 2010 at 06:48, Steve Holden  wrote:
>
>> Antoine Pitrou wrote:
>> > Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
>> >> The recent threads on builds/installers for Mac and Windows reminded me
>> >> of Steve Holden's push to get the python-dev team equipped via a
>> >> connection with the Microsoft Open Source Technology Center. The OSTC
>> >> team provides Microsoft Developer Network licenses to open source
>> >> projects to assist them in better supporting Windows.
>> >>
>> >> I've talked with Steve (who passed the task to me) and the Microsoft
>> >> folks, and they are happy to provide more licenses if needed. If you are
>> >> interested in getting a copy of MSDN, please contact me off-list.
>> >
>> > Does it include a license for Windows itself?
>> > Does it allow me to install and run it in a VM?
>> > If so, I'm interested.
>> >
>> Yes to both. MSDN offers a very broad license, with activation keys for
>> many products generated on demand.
>>
>
>The left panel on
>http://msdn.microsoft.com/en-us/subscriptions/cc137115.aspx has the full
>list of currently available products if anyone wants to know what's all
>involved here.

This is really awesome.  I have an OEM license for Windows 7 but because I
dual boot that on my primary Ubuntu development machine, I rarely use it.
Being able to run Windows in a VM will mean I'll actually do it regularly.

-Barry


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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread Steve Holden
Barry Warsaw wrote:
> On Apr 19, 2010, at 08:14 AM, Brian Curtin wrote:
> 
>> On Mon, Apr 19, 2010 at 06:48, Steve Holden  wrote:
>>
>>> Antoine Pitrou wrote:
 Le Fri, 16 Apr 2010 08:01:54 -0500, Brian Curtin a écrit :
> The recent threads on builds/installers for Mac and Windows reminded me
> of Steve Holden's push to get the python-dev team equipped via a
> connection with the Microsoft Open Source Technology Center. The OSTC
> team provides Microsoft Developer Network licenses to open source
> projects to assist them in better supporting Windows.
>
> I've talked with Steve (who passed the task to me) and the Microsoft
> folks, and they are happy to provide more licenses if needed. If you are
> interested in getting a copy of MSDN, please contact me off-list.
 Does it include a license for Windows itself?
 Does it allow me to install and run it in a VM?
 If so, I'm interested.

>>> Yes to both. MSDN offers a very broad license, with activation keys for
>>> many products generated on demand.
>>>
>> The left panel on
>> http://msdn.microsoft.com/en-us/subscriptions/cc137115.aspx has the full
>> list of currently available products if anyone wants to know what's all
>> involved here.
> 
> This is really awesome.  I have an OEM license for Windows 7 but because I
> dual boot that on my primary Ubuntu development machine, I rarely use it.
> Being able to run Windows in a VM will mean I'll actually do it regularly.
> 
Well, the whole point from both sides is to ensure better support for
Python on Microsoft platforms. So go to it!

regards
 Steve
-- 
Steve Holden   +1 571 484 6266   +1 800 494 3119
See PyCon Talks from Atlanta 2010  http://pycon.blip.tv/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS:http://holdenweb.eventbrite.com/

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


Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-19 Thread Brett Cannon
I'm with Martin; just let it be explicit and stick an example in the docs.

-Brett (from his phone with hopefully only one copy sent of this email)

On Apr 18, 2010 9:22 PM, Martin v. Löwis  wrote:

> - many optparse programs use the version argument
> - many other programmers find this feature ver...
You actually brought up a good reason yourself:


In the face of ambiguity, refuse the temptation to guess.
If you ask "give me a version argument", the question is "how is it
spelled?". IIUC, you originally complained that the spelling of argparse
(i.e. -v/--version) is not good, and that a different spelling should be
used. So it's ambiguous, in which case the feature shouldn't be provided
in the first place.

Regards,
Martin

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


Re: [Python-Dev] MSDN licenses available for python-dev

2010-04-19 Thread David Bolen
Antoine Pitrou  writes:

> Does it include a license for Windows itself?
> Does it allow me to install and run it in a VM?
> If so, I'm interested.

Yes, in fact, it's due to the availability of this license that I was
able to set up the Win7 buildbot.

-- David

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


Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-19 Thread Scott Dial
On 4/18/2010 9:44 PM, Steve Holden wrote:
> Tobias Herp wrote:
>> Steven Bethard schrieb:
>>> On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herp  wrote:
 Steven Bethard schrieb:
> But I'd really like a consensus about the correct behavior, and so far
> I have not seen that.
>>
>> Do you take your own poll seriously?
>>
> When was this ever a democracy?

Is consensus superficial?

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


Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-19 Thread Michael Foord

On 19/04/2010 21:19, Scott Dial wrote:

On 4/18/2010 9:44 PM, Steve Holden wrote:
   

Tobias Herp wrote:
 

Steven Bethard schrieb:
   

On Sun, Apr 18, 2010 at 2:35 PM, Tobias Herp  wrote:
 

Steven Bethard schrieb:
   

But I'd really like a consensus about the correct behavior, and so far
I have not seen that.
 

Do you take your own poll seriously?

   

When was this ever a democracy?
 

Is consensus superficial?

   
No, but it isn't always possible or necessary. In general the maintainer 
of a module should make the best decision, not the one with the most 
backing. :-)


All the best,

Michael

--
http://www.ironpythoninaction.com/

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


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Martin v. Löwis
Antoine Pitrou wrote:
> Victor Stinner  haypocalc.com> writes:
>> It's a choice, I didn't want to patch Windows because I know that Windows 
>> use 
>> unicode internally. I consider that developers using Python3 should use 
>> unicode on Windows, and byte or unicode+surrogates on other OS.
> 
> I think both possibilities should be available on all OSes, so as to make it
> easier to write cross-platform code. Having to switch being bytes and unicode
> depending on the OS means developers will have to deal with encoding issues
> themselves, which is suboptimal from a language usability's point of view.

Indeed, you shouldn't be switching. Instead, you should be using Unicode
strings all the time.

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


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Martin v. Löwis
> I'm working on surrogates in filenames on Linux (more generally on BSD and 
> UNIX OS) to support undecodable filenames, see PEP 383. Amaury told me that I 
> only fixed the non-Windows versions (I fixed subprocess about the current 
> directory and _ctypes.dlopen()), but it doesn't work on Windows.
> 
> It's a choice, I didn't want to patch Windows because I know that Windows use 
> unicode internally. I consider that developers using Python3 should use 
> unicode on Windows, and byte or unicode+surrogates on other OS.
> 
> I don't know well Windows API, and so I would like your opinion about that ;-)

Can you please elaborate what the specific issue is? I completely fail
to see what byte strings have to do with surrogate codes. AFAICT, on
Windows, you can just use surrogate codes at the APIs, and be done.

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


Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-19 Thread Steven Bethard
On Mon, Apr 19, 2010 at 12:51 PM, Michael Foord
 wrote:
> On 19/04/2010 21:19, Scott Dial wrote:
>> Is consensus superficial?
>
> No, but it isn't always possible or necessary. In general the maintainer of
> a module should make the best decision, not the one with the most backing.
> :-)

Yep, that was my logic. With 42% vs. 47% I decided there really wasn't
consensus, and I should make the decision that I felt was best for
argparse. If it had been e.g., 20% vs 80%, I would have bent to the
will of the masses regardless of what I thought.

Steve
-- 
Where did you get that preposterous hypothesis?
Did Steve tell you that?
--- The Hiphopopotamus
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Neil Hodgson
Victor Stinner:

> It's a choice, I didn't want to patch Windows because I know that Windows use
> unicode internally. I consider that developers using Python3 should use
> unicode on Windows, and byte or unicode+surrogates on other OS.

   The Win32 byte string APIs convert their inputs to Unicode and then
run Unicode code. You don't get additional capabilities by calling the
byte string APIs and should avoid them completely.

   Including an easy way to invoke them on Windows will just lead to
failures. People may think that Unix code that uses the byte string
APIs for better platform fidelity can just run this code on Windows
and get equivalent benefits. They won't and instead will see an
inverted form of the problems they are trying to avoid on Unix.

   If there is ever a reason to use a byte string API on Windows (and
I can't think of any) then ctypes can be used to explicitly call the
API desired.

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


Re: [Python-Dev] Support byte string API of Windows in Python3?

2010-04-19 Thread Victor Stinner
Le lundi 19 avril 2010 22:55:39, vous avez écrit :
> Can you please elaborate what the specific issue is?

Amaury reopened my issue #8393 "subprocess: support undecodable current 
working directory on POSIX OS" because "It does not work on Windows" (bytes 
are rejected).

> I completely fail to see what byte strings have to do with surrogate 
> codes. AFAICT, on Windows, you can just use surrogate codes at the APIs,
> and be done.

Before my patch, subprocess used PyArg_ParseTuple(args, "...z...", ...) to 
parse the current working directory: surrogates were rejected. But I specified 
in my issue title that the issue is specific to "POSIX OS". I should replace 
it by "non-Windows".

--

Amaury also reopened #8394 "ctypes.dlopen() doesn't support surrogates", 
because ctypes.CDLL() rejects byte string.

On Windows, Python3 uses LoadLibraryW() to load a library, and the Python API 
rejects byte string.

--

The question was: should we change python3 to accept byte strings on Windows?

I think that I can re-close these two issues because it's a good thing to 
avoid the evil, locale dependent, mbcs encoding ;-) Unicode is a superset of 
mbcs.

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