Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread martin
Zitat von Antoine Pitrou : > When you say MoveFile is absent, is MoveFileEx supported instead? WinRT strongly prefers asynchronous methods for all lengthy operations. The most likely call to use for moving files is StorageFile.MoveAsync. http://msdn.microsoft.com/en-us/library/windows/apps/

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread martin
Perhaps this is better for another topic, but is anyone using the PGO stuff? I know we have PGInstrument and PGUpdate build configurations but I've never seen them mentioned anywhere. I'm using them in the 32-bit builds. I don't use them for the 64-bit builds, as the build machine was a 32-bit

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread martin
When you say MoveFile is absent, is MoveFileEx supported instead? Or is moving files just totally impossible? I can't check the SDK headers right now, but according to the online documentation, MoveFileExW is indeed available. I'm not sure whether you are allowed to pass arbitrary file names in

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread martin
Zitat von Eli Bendersky : A then-related question is whether Python 3.3 should be compiled with Visual Studio 11. I'd still be in favor of that, provided Microsoft manages to release that soon enough. Martin, I assume you mean the Express version of Visual Studio 11 here, right? *Here*,

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Mike Meyer
On Sun, 8 Jan 2012 02:06:33 + (UTC) Vinay Sajip wrote: > Mike Meyer mired.org> writes: > > > Since the only reason they exist is so you can access your end of a > > pipe, setting them to anything would seem to be a bug. I'd argue that > > their existence is more a pola violation than them h

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Phil Vandry
On 2012-01-08 10:48 , Vinay Sajip wrote: Terry Reedy udel.edu> writes: The behavior matches the doc: Popen.stdin If the stdin argument was PIPE, this attribute is a file object that provides input to the child process. Otherwise, it is None. Right, but it's not very helpful, nor especially i

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Daniel Neuhäuser
That's documented behaviour nonetheless. I would agree that the behaviour is a stupid one (not knowing the reason for it); even so it cannot be changed in a backwards compatible way. Am 07.01.2012 um 22:25 schrieb Vinay Sajip : > The subprocess.Popen constructor takes stdin, stdout and stderr k

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Vinay Sajip
Mike Meyer mired.org> writes: > Since the only reason they exist is so you can access your end of a > pipe, setting them to anything would seem to be a bug. I'd argue that > their existence is more a pola violation than them having the value > None. But None is easier than a call to hasattr. I d

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Vinay Sajip
Terry Reedy udel.edu> writes: > The behavior matches the doc: Popen.stdin > If the stdin argument was PIPE, this attribute is a file object that > provides input to the child process. Otherwise, it is None. Right, but it's not very helpful, nor especially intuitive. Why does it have to be None

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Xavier Morel
On 2012-01-08, at 01:27 , Antoine Pitrou wrote: >>> When you say MoveFile is absent, is MoveFileEx supported instead? >> WinRT strongly prefers asynchronous methods for all lengthy >> operations. The most likely call to use for moving files is >> StorageFile.MoveAsync. >> http://msdn.microsoft.co

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Neil Hodgson
Antoine Pitrou: > How does it translate to C? The simplest technique would be to use C++ code to bridge from C to the API. If you really wanted to you could explicitly call the function pointer in the COM vtable but doing COM in C is more effort than calling through C++. > I'm not sure why "r

Re: [Python-Dev] [Python-checkins] cpython: Issue #9993: When the source and destination are on different filesystems,

2012-01-07 Thread Nick Coghlan
On Sun, Jan 8, 2012 at 4:00 AM, Antoine Pitrou wrote: > I'm not sure it was *well* defined (or even defined at all). It seems > more of a by-product of the implementation. It's not only different > from mv, but it's inconsistent with itself (the semantics are different > depending on whether the p

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Antoine Pitrou
> > When you say MoveFile is absent, is MoveFileEx supported instead? > >WinRT strongly prefers asynchronous methods for all lengthy > operations. The most likely call to use for moving files is > StorageFile.MoveAsync. > http://msdn.microsoft.com/en-us/library/windows/apps/br227219.aspx How

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Mike Meyer
On Sat, 7 Jan 2012 21:25:37 + (UTC) Vinay Sajip wrote: > The subprocess.Popen constructor takes stdin, stdout and stderr keyword > arguments which are supposed to represent the file handles of the child > process. > The object also has stdin, stdout and stderr attributes, which one would >

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Neil Hodgson
Antoine Pitrou: > When you say MoveFile is absent, is MoveFileEx supported instead? WinRT strongly prefers asynchronous methods for all lengthy operations. The most likely call to use for moving files is StorageFile.MoveAsync. http://msdn.microsoft.com/en-us/library/windows/apps/br227219.aspx

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Brian Curtin
On Sat, Jan 7, 2012 at 18:04, Paul Moore wrote: > On 7 January 2012 22:56, Eli Bendersky wrote: >> >>> A then-related question is whether Python 3.3 should be compiled with >>> Visual >>> Studio 11. I'd still be in favor of that, provided Microsoft manages to >>> release >>> that soon enough. >>

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Paul Moore
On 7 January 2012 22:56, Eli Bendersky wrote: > >> A then-related question is whether Python 3.3 should be compiled with >> Visual >> Studio 11. I'd still be in favor of that, provided Microsoft manages to >> release >> that soon enough. > > > Martin, I assume you mean the Express version of Visua

Re: [Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Terry Reedy
On 1/7/2012 4:25 PM, Vinay Sajip wrote: The subprocess.Popen constructor takes stdin, stdout and stderr keyword arguments which are supposed to represent the file handles of the child process. The object also has stdin, stdout and stderr attributes, which one would naively expect to correspond to

Re: [Python-Dev] Compiling 2.7.2 on OS/2

2012-01-07 Thread Paul Smedley
Hi Terry, On 07/01/12 19:47, Terry Reedy wrote: On 1/7/2012 3:48 AM, Paul Smedley wrote: using _init_posix() for 'os2' instead of _init_non_posix is the fix for this. sysconfig.py also needs the following changes: --- \dev\Python-2.7.2-o\Lib\sysconfig.py 2012-01-06 19:27:14.0 +1030 ++

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Terry Reedy
On 1/7/2012 4:47 PM, Benjamin Peterson wrote: 2012/1/7 "Martin v. Löwis": I just tried porting Python as a Metro (Windows 8) App, and failed. Is this required for Python to run on Windows 8? No, normal 'desktop' programs will still run in desktop mode. Sorry if that's a dumb question. I'm

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Antoine Pitrou
On Sat, 07 Jan 2012 18:57:41 +0100 "Martin v. Löwis" wrote: > For example, everything > related to subprocess creation would not work; none of the > byte-oriented file API seems to be present, and a number of file > operation functions are absent as well (such as MoveFile). When you say MoveFile

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Eli Bendersky
> A then-related question is whether Python 3.3 should be compiled with > Visual > Studio 11. I'd still be in favor of that, provided Microsoft manages to > release > that soon enough. > Martin, I assume you mean the Express version of Visual Studio 11 here, right? Eli ___

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Brian Curtin
On Sat, Jan 7, 2012 at 16:07, wrote: > A then-related question is whether Python 3.3 should be compiled with Visual > Studio 11. I'd still be in favor of that, provided Microsoft manages to > release that soon enough. I'm guessing the change would have to be done before the first beta? It would

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread martin
Zitat von Benjamin Peterson : 2012/1/7 "Martin v. Löwis" : I just tried porting Python as a Metro (Windows 8) App, and failed. Is this required for Python to run on Windows 8? No. Existing applications ("desktop applications") will continue to work unmodified. Metro-style apps are primaril

Re: [Python-Dev] Python as a Metro-style App

2012-01-07 Thread Benjamin Peterson
2012/1/7 "Martin v. Löwis" : > I just tried porting Python as a Metro (Windows 8) App, and failed. Is this required for Python to run on Windows 8? Sorry if that's a dumb question. I'm not sure if "Metro App" is a special class of application. -- Regards, Benjamin

[Python-Dev] A question about the subprocess implementation

2012-01-07 Thread Vinay Sajip
The subprocess.Popen constructor takes stdin, stdout and stderr keyword arguments which are supposed to represent the file handles of the child process. The object also has stdin, stdout and stderr attributes, which one would naively expect to correspond to the passed in values, except where you pa

Re: [Python-Dev] Hash collision security issue (now public)

2012-01-07 Thread Terry Reedy
On 1/7/2012 12:57 PM, Christian Heimes wrote: Am 07.01.2012 12:02, schrieb Stefan Behnel: Admittedly, this may require some adaptation for the PEP393 unicode memory layout in order to produce identical hashes for all three representations if they represent the same content. So it's not a drop-

[Python-Dev] Python as a Metro-style App

2012-01-07 Thread Martin v. Löwis
I just tried porting Python as a Metro (Windows 8) App, and failed. Metro Apps use a variant of the Windows API called WinRT that still allows to write native applications in C++, but restricts various APIs to a subset of the full Win32 functionality. For example, everything related to subprocess

Re: [Python-Dev] Hash collision security issue (now public)

2012-01-07 Thread Christian Heimes
Am 07.01.2012 12:02, schrieb Stefan Behnel: > Wouldn't Bob Jenkins' "lookup3" hash function fit in here? After all, it's > portable, known to provide a very good distribution for different string > values and is generally fast on both 32 and 64 bit architectures. > > http://burtleburtle.net/bob/c/

Re: [Python-Dev] [Python-checkins] cpython: Issue #9993: When the source and destination are on different filesystems,

2012-01-07 Thread Hynek Schlawack
Hi Nick, Am Samstag, 7. Januar 2012 um 14:22 schrieb Nick Coghlan: > > http://hg.python.org/cpython/rev/1ea8b7233fd7 > > changeset: 74288:1ea8b7233fd7 > > user: Antoine Pitrou mailto:solip...@pitrou.net)> > > date: Fri Jan 06 20:16:19 2012 +0100 > > summary: > > Issue #9993: When the source an

Re: [Python-Dev] usefulness of Python version of threading.RLock

2012-01-07 Thread Nick Coghlan
2012/1/8 Matt Joiner : > Nick did you mean to say "wrap python code around a reentrant lock to create > a non-reentrant lock"? Isn't that what PyRLock is doing? Actually, I should have said recursive, not reentrant. > FWIW having now read issues 13697 and 13550, I'm +1 for dropping Python > RLock

Re: [Python-Dev] usefulness of Python version of threading.RLock

2012-01-07 Thread Matt Joiner
Nick did you mean to say "wrap python code around a reentrant lock to create a non-reentrant lock"? Isn't that what PyRLock is doing? FWIW having now read issues 13697 and 13550, I'm +1 for dropping Python RLock, and all the logging machinery in threading. 2012/1/8 Nick Coghlan > 2012/1/7 Charl

Re: [Python-Dev] [Python-checkins] cpython: Issue #9993: When the source and destination are on different filesystems,

2012-01-07 Thread Nick Coghlan
On Sat, Jan 7, 2012 at 5:17 AM, antoine.pitrou wrote: > http://hg.python.org/cpython/rev/1ea8b7233fd7 > changeset:   74288:1ea8b7233fd7 > user:        Antoine Pitrou > date:        Fri Jan 06 20:16:19 2012 +0100 > summary: >  Issue #9993: When the source and destination are on different filesyste

Re: [Python-Dev] usefulness of Python version of threading.RLock

2012-01-07 Thread Nick Coghlan
2012/1/7 Charles-François Natali : > Thanks for those precisions, but I must admit it doesn't help me much... > Can we drop it? A yes/no answer will do it ;-) The yes/no answer is "No, we can't drop it". Even though CPython no longer uses the Python version of RLock in normal operation, it's stil

Re: [Python-Dev] Hash collision security issue (now public)

2012-01-07 Thread Stefan Behnel
Christian Heimes, 31.12.2011 04:59: > Am 31.12.2011 03:22, schrieb Victor Stinner: > The unique structure of CPython's dict implementation makes it harder to > get the number of values with equal hash. The academic hash map (the one > I learnt about at university) uses a bucket to store all element

Re: [Python-Dev] Compiling 2.7.2 on OS/2

2012-01-07 Thread Terry Reedy
On 1/7/2012 3:48 AM, Paul Smedley wrote: using _init_posix() for 'os2' instead of _init_non_posix is the fix for this. sysconfig.py also needs the following changes: --- \dev\Python-2.7.2-o\Lib\sysconfig.py 2012-01-06 19:27:14.0 +1030 +++ sysconfig.py 2012-01-07 19:03:00.0 +1030

Re: [Python-Dev] Compiling 2.7.2 on OS/2

2012-01-07 Thread Paul Smedley
Hi All, On 06/01/12 10:25, Terry Reedy wrote: On 1/5/2012 3:01 PM, Paul Smedley wrote: File "./setup.py", line 1154, in detect_modules for arg in sysconfig.get_config_var("__CONFIG_ARGS").split()] AttributeError: 'NoneType' object has no attribute 'split' make: *** [sharedmods] Error 1 File