Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Terry Reedy
On 11/24/2010 3:06 PM, Alexander Belopolsky wrote: Any non-trivial text processing is likely to be broken in presence of surrogates. Producing them on input is just trading known issue for an unknown one. Processing surrogate pairs in python code is hard. Software that has to support non-BMP c

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Terry Reedy
On 11/24/2010 5:13 PM, "Martin v. Löwis" wrote: So I presume it did the same with IOBinding.py. No. This file contains only ASCII characters, so notepad has decided to not add the BOM. Or it somehow got removed from the .py file. I tried with another .py file (and reverted!) and the diff sho

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Terry Reedy
On 11/24/2010 3:04 PM, Georg Brandl wrote: Adding the BOM will be an editor thing, not a svn thing. Doing a It should show up as an invisible change in the first line of a file when you look at a "svn diff". (It is a very good practice to look at a diff before committing anyway.) It does s

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Alexander Belopolsky
On Wed, Nov 24, 2010 at 9:17 PM, Stephen J. Turnbull wrote: .. >  > I note that an opinion has been raised on this thread that >  > if we want compressed internal representation for strings, we should >  > use UTF-8.  I tend to agree, but UTF-8 has been repeatedly rejected as >  > too hard to impl

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Stephen J. Turnbull
Greg Ewing writes: > On 24/11/10 22:03, Stephen J. Turnbull wrote: > > But > > if you actually need to remember positions, or regions, to jump to > > later or to communicate to other code that manipulates them, doing > > this stuff the straightforward way (just copying the whole iterator > >

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Greg Ewing
On 25/11/10 12:38, average wrote: Is immutability a general need that should have general solution? I don't think it really generalizes. Tuples are not just frozen lists, for example -- they have a different internal structure that's more efficient to create and access. -- Greg ___

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
On 25/11/10 06:37, Alexander Belopolsky wrote: I don't think there is a recipe on how to fix legacy character-by-character processing loop such as for c in string: ... to make it iterate over code points consistently in wide and narrow builds. A couple of possibilities: 1) Make t

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
On 24/11/10 22:03, Stephen J. Turnbull wrote: But if you actually need to remember positions, or regions, to jump to later or to communicate to other code that manipulates them, doing this stuff the straightforward way (just copying the whole iterator object to hang on to its state) becomes expen

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Stephen J. Turnbull
Alexander Belopolsky writes: > Any non-trivial text processing is likely to be broken in presence of > surrogates. If you're worried about this, write a UCS-2-producing codec that rejects surrogates or stuffs them into the private zone of the BMP. Maybe such a codec should be default, but so fa

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Greg Ewing
On 24/11/10 13:22, James Y Knight wrote: Instead, provide bidirectional iterators which can traverse the string by byte, codepoint, or by grapheme Maybe it would be a good idea to add some iterators like this to Python. (Or has the time machine beaten me there?) -- Greg __

Re: [Python-Dev] r86731 - in python/branches/py3k: Lib/distutils/command/install.py Lib/distutils/sysconfig.py Lib/sysconfig.py Makefile.pre.in Misc/python.pc.in configure configure.in

2010-11-24 Thread Barry Warsaw
On Nov 25, 2010, at 12:41 AM, Antoine Pitrou wrote: >On Wed, 24 Nov 2010 20:43:47 +0100 (CET) >barry.warsaw wrote: >> Author: barry.warsaw >> Date: Wed Nov 24 20:43:47 2010 >> New Revision: 86731 >> >> Log: >> Final patch for issue 9807. > >This seems to have broken compilation under Windows: >

Re: [Python-Dev] r86731 - in python/branches/py3k: Lib/distutils/command/install.py Lib/distutils/sysconfig.py Lib/sysconfig.py Makefile.pre.in Misc/python.pc.in configure configure.in

2010-11-24 Thread Antoine Pitrou
On Wed, 24 Nov 2010 20:43:47 +0100 (CET) barry.warsaw wrote: > Author: barry.warsaw > Date: Wed Nov 24 20:43:47 2010 > New Revision: 86731 > > Log: > Final patch for issue 9807. This seems to have broken compilation under Windows: Build started: Project: ssl, Configuration: Debug|Win32 Performi

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread average
Is immutability a general need that should have general solution? By generalizing the idea to lists/tuples, set/frozenset, dicts, and strings (for example), it seems one could simplify the container classes, eliminate code complexity, and perhaps improve resource utilization. mark ___

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Martin v. Löwis
> So I presume it did the same with IOBinding.py. No. This file contains only ASCII characters, so notepad has decided to not add the BOM. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-d

[Python-Dev] collect2: library libpython2.6 not found while building extensions (--enable-shared)

2010-11-24 Thread Anurag Chourasia
All, When I configure python to enable shared libraries, none of the extensions are getting built during the make step due to this error. building 'cStringIO' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -I/u01/home/apli/wm/GDD/Python-2.

[Python-Dev] [Preview] Comments and change proposals on documentation

2010-11-24 Thread Georg Brandl
Hi, at , you can look at a version of the 3.2 docs that has the upcoming commenting feature. JavaScript is mandatory. I've switched on anonymous comments for testing, but usually at least comments from anonymous users can be moderated. Be sure to test the "propose

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Alexander Belopolsky
On Wed, Nov 24, 2010 at 1:50 PM, M.-A. Lemburg wrote: .. >> add an option for decoders that currently produce surrogate pairs to >> treat non-BMP characters as errors and handle them according to user's >> choice. > > But what do you gain by doing this ? You'd lose the round-trip > safety of those

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Georg Brandl
Am 24.11.2010 20:25, schrieb Terry Reedy: > On 11/24/2010 2:04 PM, Brett Cannon wrote: >> On Tue, Nov 23, 2010 at 15:07, Terry Reedy wrote: > >>> I used Notepad to edit the file, TortoiseSvn to commit, the same as I did >>> for #9222, rev86702, Lib\idlelib\IOBinding.py, yesterday. >>> If the latt

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Terry Reedy
On 11/24/2010 2:04 PM, Brett Cannon wrote: On Tue, Nov 23, 2010 at 15:07, Terry Reedy wrote: I used Notepad to edit the file, TortoiseSvn to commit, the same as I did for #9222, rev86702, Lib\idlelib\IOBinding.py, yesterday. If the latter is OK, perhaps *.py gets filtered better than misc. te

Re: [Python-Dev] [Python-checkins] r86720 - python/branches/py3k/Misc/ACKS

2010-11-24 Thread Brett Cannon
On Tue, Nov 23, 2010 at 15:07, Terry Reedy wrote: > > > On 11/23/2010 5:43 PM, Éric Araujo wrote: >>> >>> Modified: python/branches/py3k/Misc/ACKS >>> >>> == >>> --- python/branches/py3k/Misc/ACKS      (original) >>> +++ p

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread M.-A. Lemburg
Alexander Belopolsky wrote: > To conclude, I feel that rather than trying to fully support non-BMP > characters as surrogate pairs in narrow builds, we should make it > easier for application developers to avoid them. I don't understand what you're after here. Programmers can easily avoid them by

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Michael Foord
On 24/11/2010 14:08, Nick Coghlan wrote: On Wed, Nov 24, 2010 at 10:30 PM, Michael Foord wrote: Based on a non-exhaustive search, Python standard library modules currently using integers for constants: Thanks for that review. I think following up on the "NamedConstant" idea may make more sens

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Alexander Belopolsky
On Tue, Nov 23, 2010 at 2:18 PM, Amaury Forgeot d'Arc wrote: .. >> Given the apparent difficulty of writing even basic text processing >> algorithms in presence of surrogate pairs, I wonder how wise it is to >> expose Python users to them. > > This was already discussed two years ago: > > http://m

[Python-Dev] Fwd: constant/enum type in stdlib

2010-11-24 Thread Joao S. O. Bueno
Hi -- If I may add my 0.02 cents - this sample has a sample implementation of the proposed features I found most interesting up to now: 1) inherit from int 2) display the constant's name on 'repr' 3) optionally populate a module with the constants 4) Optionally provide a starting value for the enu

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Benjamin Peterson
2010/11/24 Steven D'Aprano : > Nick Coghlan wrote: >> >> On Wed, Nov 24, 2010 at 10:30 PM, Michael Foord >> wrote: >>> >>> Based on a non-exhaustive search, Python standard library modules >>> currently >>> using integers for constants: >> >> Thanks for that review. I think following up on the "Na

Re: [Python-Dev] OpenSSL Vulnerability (openssl-1.0.0a)

2010-11-24 Thread exarkun
On 03:11 pm, solip...@pitrou.net wrote: On Wed, 24 Nov 2010 15:01:06 - exar...@twistedmatrix.com wrote: > >If I believe the link above: > 1CAny OpenSSL based TLS server is vulnerable if it is multi-threaded and >uses OpenSSL's internal caching mechanism. Servers that are >multi-process and

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Steven D'Aprano
Nick Coghlan wrote: On Wed, Nov 24, 2010 at 10:30 PM, Michael Foord wrote: Based on a non-exhaustive search, Python standard library modules currently using integers for constants: Thanks for that review. I think following up on the "NamedConstant" idea may make more sense than pursuing enums

Re: [Python-Dev] OpenSSL Voluntarily (openssl-1.0.0a)

2010-11-24 Thread Antoine Pitrou
On Wed, 24 Nov 2010 15:01:06 - exar...@twistedmatrix.com wrote: > > > >If I believe the link above: > > 1CAny OpenSSL based TLS server is vulnerable if it is multi-threaded and > >uses OpenSSL's internal caching mechanism. Servers that are > >multi-process and/or disable internal session cachin

Re: [Python-Dev] OpenSSL Voluntarily (openssl-1.0.0a)

2010-11-24 Thread exarkun
On 08:02 am, solip...@pitrou.net wrote: Le mardi 23 novembre 2010 � 20:56 -0500, Glyph Lefkowitz a �crit : On Nov 23, 2010, at 9:02 AM, Antoine Pitrou wrote: > On Tue, 23 Nov 2010 00:07:09 -0500 > Glyph Lefkowitz wrote: >> On Mon, Nov 22, 2010 at 11:13 PM, Hirokazu Yamamoto < >> ocean-c...@m2.

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Nick Coghlan
On Wed, Nov 24, 2010 at 10:30 PM, Michael Foord wrote: > Based on a non-exhaustive search, Python standard library modules currently > using integers for constants: Thanks for that review. I think following up on the "NamedConstant" idea may make more sense than pursuing enums in their own right.

Re: [Python-Dev] constant/enum type in stdlib

2010-11-24 Thread Michael Foord
On 23/11/2010 14:16, Nick Coghlan wrote: On Tue, Nov 23, 2010 at 11:50 PM, Michael Foord wrote: PEP 354 was rejected for two primary reasons - lack of interest and nowhere obvious to put it. Would it be *so bad* if an enum type lived in its own module? There is certainly more interest now, and

Re: [Python-Dev] r86726 - python/branches/release27-maint/Objects/setobject.c

2010-11-24 Thread Antoine Pitrou
On Wed, 24 Nov 2010 11:39:23 +0100 (CET) armin.rigo wrote: > Author: armin.rigo > Date: Wed Nov 24 11:39:23 2010 > New Revision: 86726 > > Log: > A no-op change. It looks like this call was not meant to be a recursive > call, but just call the helper (which the recursive call ends up doing). Si

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Antoine Pitrou
On Wed, 24 Nov 2010 18:51:49 +0900 "Stephen J. Turnbull" wrote: > James Y Knight writes: > > > But, now, if your choices are UTF-8 or UTF-16, UTF-8 is clearly > > superior [...]a because it is an ASCII superset, and thus more > > easily compatible with other software. That also makes it most >

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Stephen J. Turnbull
James Y Knight writes: > But, now, if your choices are UTF-8 or UTF-16, UTF-8 is clearly > superior [...]a because it is an ASCII superset, and thus more > easily compatible with other software. That also makes it most > commonly used for internet communication. Sure, UTF-8 is very nice as a

Re: [Python-Dev] len(chr(i)) = 2?

2010-11-24 Thread Stephen J. Turnbull
James Y Knight writes: > a) You seem to be hung up implementation details of emacs. Hung up? No. It's the program whose text model I know best, and even if its design could theoretically be a lot better for this purpose, I can't say I've seen a real program whose model is obviously better for

Re: [Python-Dev] http.server - reference to bug #427345

2010-11-24 Thread Antoine Pitrou
On Tue, 23 Nov 2010 22:35:10 -0600 Brian Curtin wrote: > On Tue, Nov 23, 2010 at 22:28, Glenn Linderman > > > wrote: > > > Where might I find the bug #427345 that is referred to in a comment inside > > http.server ? Here is a code excerpt: > > > > # throw away additional data [see

Re: [Python-Dev] Centos 5.5 freeze during test_concurrent_futures

2010-11-24 Thread Antoine Pitrou
Hi, > py3k built from trunk on Centos 5.5 freezes during regrtest on > test_concurrent_futures with "Fatal Python error: Invalid thread state for > this thread". As in a typical concurrent problem, subsequent calls freeze in > different test cases, but the freeze itself is always reproducible

Re: [Python-Dev] OpenSSL Voluntarily (openssl-1.0.0a)

2010-11-24 Thread Antoine Pitrou
Le mardi 23 novembre 2010 à 20:56 -0500, Glyph Lefkowitz a écrit : > On Nov 23, 2010, at 9:02 AM, Antoine Pitrou wrote: > > > On Tue, 23 Nov 2010 00:07:09 -0500 > > Glyph Lefkowitz wrote: > >> On Mon, Nov 22, 2010 at 11:13 PM, Hirokazu Yamamoto < > >> ocean-c...@m2.ccsnet.ne.jp> wrote: > >> > >>