Re: [Python-Dev] very bad network performance

2008-04-21 Thread Ralf Schmitt
On Mon, Apr 21, 2008 at 8:10 PM, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > > > > The 64K hunch is wrong. The system limit can be found using > getsockopt(...SO_RCVBUF...). It can easily be (and often is) set to many > megabytes either at a system default level or on a per socket level by the

Re: [Python-Dev] r62342 - python/branches/py3k/Objects/bytesobject.c

2008-04-21 Thread Neal Norwitz
On Tue, Apr 15, 2008 at 2:21 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > Iteration with the dict methods (e.g., keys -> iterkeys()), > > map/zip/filter returning iterator rather than list. > > That's only an optimisation, it's not functionally required. A list behaves

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Martin v. Löwis
> IMO, encoding estimation is something that many web programs will have > to deal with Can you please explain why that is? Web programs should not normally have the need to detect the encoding; instead, it should be specified always - unless you are talking about browsers specifically, which need

[Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Jim Jewett
David Wolever wrote: > IMO, encoding estimation is something that > many web programs will have to deal with, > so it might as well be built in; I would prefer > the option to run `text=input.encode('guess')` > (or something similar) than relying on an external > dependency or worse yet using a ha

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread David Wolever
On 21-Apr-08, at 5:31 PM, Martin v. Löwis wrote: This is useful when you get a hunk of data which _should_ be some sort of intelligible text from the Big Scary Internet (say, a posted web form or email message), and you want to do something useful with it (say, search the content). I don't think

Re: [Python-Dev] A smarter shutil.copytree ?

2008-04-21 Thread Greg Ewing
Steven Bethard wrote: I'm not a big fan of the sequence-or-callable argument. Why not just make it a callable argument, and supply a utility function Or have two different keyword arguments, one for a sequence and one for a callable. -- Greg ___ Pyth

Re: [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

2008-04-21 Thread Greg Ewing
Steven wrote: It might help if you explain what sort of actual things that the user does wrong that you are talking about. Usually it's some kind of parsing error. Or it might be a network connection getting closed unexpectedly. Essentially it's anything due to factors outside the program's co

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Oleg Broytmann
On Mon, Apr 21, 2008 at 06:37:20PM -0300, Rodrigo Bernardo Pimentel wrote: > On Mon, Apr 21 2008 at 06:31:06PM BRT, "\"Martin v. L??wis\"" <[EMAIL > PROTECTED]> wrote: > > > This is useful when you get a hunk of data which _should_ be some > > > sort of intelligible text from the Big Scary Inter

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Rodrigo Bernardo Pimentel
On Mon, Apr 21 2008 at 06:31:06PM BRT, "\"Martin v. Löwis\"" <[EMAIL PROTECTED]> wrote: > > This is useful when you get a hunk of data which _should_ be some > > sort of intelligible text from the Big Scary Internet (say, a posted > > web form or email message), and you want to do something us

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Martin v. Löwis
> This is useful when you get a hunk of data which _should_ be some > sort of intelligible text from the Big Scary Internet (say, a posted > web form or email message), and you want to do something useful with > it (say, search the content). I don't think that should be part of the standard

Re: [Python-Dev] BSDDB3

2008-04-21 Thread Martin v. Löwis
> | This problem has now been worked-around, by reformulating the test cases > | so that the situation doesn't occur anymore, but IMO, it should not be > | possible for an extension module to cause an interpreter abort. > > Agreed. But I can't test Windows builds myself. Could anybody help me in >

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Tony Nelson
At 1:14 PM -0400 4/21/08, David Wolever wrote: >On 21-Apr-08, at 12:44 PM, [EMAIL PROTECTED] wrote: >> >> David> Is there some sort of text encoding detection module is the >> David> standard library? And, if not, is there any reason not >> to add >> David> one? >> No, there's not. I

Re: [Python-Dev] very bad network performance

2008-04-21 Thread Gregory P. Smith
On Mon, Apr 14, 2008 at 4:41 PM, Curt Hagenlocher <[EMAIL PROTECTED]> wrote: > On Mon, Apr 14, 2008 at 4:19 PM, Guido van Rossum <[EMAIL PROTECTED]> > wrote: > > > > But why was imaplib apparently specifying 10MB? Did it know there was > > that much data? Or did it just not want to bother looping

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread skip
Guido> Note that the locale settings might figure in the guess. Alas, locale settings in a web server have little or nothing to do with the locale settings in the client submitting the form. Skip ___ Python-Dev mailing list Python-Dev@python.org ht

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread skip
Michael> The only approach I know of is a heuristic based approach. e.g. Michael> http://www.voidspace.org.uk/python/articles/guessing_encoding.shtml Michael> (Which was 'borrowed' from docutils in the first place.) Yes, I implemented a heuristic approach for the Musi-Cal web server

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Guido van Rossum
To the contrary, an encoding-guessing module is often needed, and guessing can be done with a pretty high success rate. Other Unicode libraries (e.g. ICU) contain guessing modules. I suppose the API could return two values: the guessed encoding and a confidence indicator. Note that the locale setti

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Georg Brandl
Christian Heimes schrieb: > David Wolever schrieb: >> Is there some sort of text encoding detection module is the standard >> library? >> And, if not, is there any reason not to add one? > > You cannot detect the encoding unless it's explicitly defined through a > header (e.g. the UTF BOM). It's

Re: [Python-Dev] A smarter shutil.copytree ?

2008-04-21 Thread Guido van Rossum
On Sun, Apr 20, 2008 at 5:25 PM, Steven Bethard <[EMAIL PROTECTED]> wrote: > > On Sun, Apr 20, 2008 at 4:15 PM, Tarek Ziadé <[EMAIL PROTECTED]> wrote: > > I have submitted a patch for review here: http://bugs.python.org/issue2663 > > > > glob-style patterns or a callable (for complex cases) can

Re: [Python-Dev] unscriptable?

2008-04-21 Thread Georg Brandl
Alexander Belopolsky schrieb: >> ruby: undefined method `[]=' for 1:Fixnum (NoMethodError) > > I think it will be natural to unify [] error message with > the other binary ops: > > Now: 1+"" > Traceback (most recent call last): > File "", line 1, in > TypeError: unsupported operand type(s

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread David Wolever
On 21-Apr-08, at 12:44 PM, [EMAIL PROTECTED] wrote: > > David> Is there some sort of text encoding detection module is the > David> standard library? And, if not, is there any reason not > to add > David> one? > No, there's not. I suspect the fact that you can't correctly > determ

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Jean-Paul Calderone
On Mon, 21 Apr 2008 17:50:43 +0100, Michael Foord <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> David> Is there some sort of text encoding detection module is the >> David> standard library? And, if not, is there any reason not to add >> David> one? >> >> No, there's not. I

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Christian Heimes
David Wolever schrieb: > Is there some sort of text encoding detection module is the standard > library? > And, if not, is there any reason not to add one? You cannot detect the encoding unless it's explicitly defined through a header (e.g. the UTF BOM). It's technically impossible. The best you

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread Michael Foord
[EMAIL PROTECTED] wrote: > David> Is there some sort of text encoding detection module is the > David> standard library? And, if not, is there any reason not to add > David> one? > > No, there's not. I suspect the fact that you can't correctly determine the > encoding of a chunk of te

Re: [Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread skip
David> Is there some sort of text encoding detection module is the David> standard library? And, if not, is there any reason not to add David> one? No, there's not. I suspect the fact that you can't correctly determine the encoding of a chunk of text 100% of the time mitigates again

Re: [Python-Dev] unscriptable?

2008-04-21 Thread Alexander Belopolsky
> ruby: undefined method `[]=' for 1:Fixnum (NoMethodError) I think it will be natural to unify [] error message with the other binary ops: Now: >>> 1+"" Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str' Proposal: >>> 1[2] Tra

[Python-Dev] Encoding detection in the standard library?

2008-04-21 Thread David Wolever
Is there some sort of text encoding detection module is the standard library? And, if not, is there any reason not to add one? After some googling, I've come across this: http://mail.python.org/pipermail/python-3000/2006-September/003537.html But I can't find any changes that resulted from that

Re: [Python-Dev] BSDDB3

2008-04-21 Thread Jesus Cea
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin v. Löwis wrote: | I think it would be helpful if you could analyze the crashes that bsddb | caused on Windows. Just go back a few revisions in the subversion tree | to reproduce the crashes. I have no MS Windows machines in my environment :-(

[Python-Dev] Is Py_WIN_WIDE_FILENAMES still alive?

2008-04-21 Thread ocean
Hello. I noticed when I removes following line in trunk/PC/pyconfig.h #define Py_WIN_WIDE_FILENAMES _fileio.c and posixmodule.c (and maybe more) cannot be compiled on Windows. When Py_WIN_WIDE_FILENAMES is not defined, how should python behave? - call posix functions like open(2) - call A

Re: [Python-Dev] A smarter shutil.copytree ?

2008-04-21 Thread Tarek Ziadé
The pattern matching uses the src_dir to call glob.glob(), which returns the list of files to be excluded. That's why I added within the copytree() function. To make an excluding_patterns work, it could be coded like this:: def excluding_patterns(*patterns): def _excluding_patterns(fi