[issue18553] os.isatty() is not Unix only

2013-09-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Georg: Thanks for spotting. I feel bad for the mistake. I shall correct it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18553 ___

[issue19044] getaddrinfo raises near-useless exception

2013-09-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19044 ___ ___ Python-bugs-list mailing

[issue19045] Make on Solaris 11 x64 with OracleStudio12.3 failed

2013-09-19 Thread Borut Podlipnik
New submission from Borut Podlipnik: # make CC -c -g -DNDEBUG -O -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c CC -c -g -DNDEBUG -O -I. -IInclude -I./Include -DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c CC -c -g -DNDEBUG -O -I. -IInclude

[issue18553] os.isatty() is not Unix only

2013-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2b7f11ba871c by Senthil Kumaran in branch '3.3': Correcting the mistake in 14ba90816930 http://hg.python.org/cpython/rev/2b7f11ba871c New changeset e839e524a7d5 by Senthil Kumaran in branch 'default': Correcting the mistake in 678e3c0d2d99

[issue18553] os.isatty() is not Unix only

2013-09-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed now. Ascertained myself by doing hg diff -r tip^ -U 10 on local commits before pushing. :-) -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18553

[issue19046] SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal function

2013-09-19 Thread Michael Herrmann
New submission from Michael Herrmann: I'm on 32 bit Python 2.7.3 and 64 bit Windows 7. I am working on a complex, multithreaded application which uses COM to communicate with other processes. My application uses regular expressions in a few (but not very many) places. An example re I am

[issue19044] getaddrinfo raises near-useless exception

2013-09-19 Thread Balazs
Changes by Balazs czv...@gmail.com: -- nosy: +balazs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19044 ___ ___ Python-bugs-list mailing list

[issue19047] Clarify weakref.finalize objects are kept alive automatically

2013-09-19 Thread Nick Coghlan
New submission from Nick Coghlan: I was just looking at weakref.finalize objects trying to figure out if they solve a problem I'm thinking about (they do), and I couldn't figure out from the class documentation ([1]) whether or not I needed to take care of keeping the object returned from

[issue19047] Assorted weakref docs improvements

2013-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: Changing the title, since I spotted a few other problems as well. The weakref docs still refer to module globals being set to None during shutdown. That is no longer the case. There are also some assumptions about cycles with __del__ methods not being garbage

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
New submission from Antoine Pitrou: An itertools.tee object can cache an arbitrary number of objects (pointers), but its sys.getsizeof() value will always remain the same. -- components: Library (Lib) messages: 198048 nosy: pitrou, rhettinger, serhiy.storchaka priority: normal

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou
New submission from Antoine Pitrou: itertools.tee uses ints rather than Py_ssize_t for indices. Using Py_ssize_t would not make the object bigger, since other fields will already be pointer-aligned. -- messages: 198049 nosy: pitrou, rhettinger, serhiy.storchaka priority: normal

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I find the implementation of itertools.tee a bit weird: why does teedataobject have to be a PyObject? It seems to complicate things and make them less optimal. -- ___ Python tracker rep...@bugs.python.org

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Anywhere, here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file31813/tee_sizeof.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue15475. -- superseder: - Correct __sizeof__ support for itertools ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048 ___

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Hmm, no, I'm wrong, it's not a duplication. -- superseder: Correct __sizeof__ support for itertools - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048 ___ ___

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure that sys.getsizeof() should recursively count all Python subobjects. That is why I had omitted tee() in my patch. sys.getsizeof([[]]) 36 sys.getsizeof([list(range(1))]) 36 -- ___ Python tracker

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure that sys.getsizeof() should recursively count all Python subobjects. Those are private subobjects. They are not visible to the programmer (except perhaps by calling __reduce__ or __setstate__). -- ___

[issue19046] SystemError: ..\Objects\weakrefobject.c:903: bad argument to internal function

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is there any reason why you don't switch to 2.7.5 and let your application run longer? (FWIW, this may be issue #16602) -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19046

[issue19047] Assorted weakref docs improvements

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Doc patches certainly welcome :-) -- nosy: +pitrou, sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19047 ___

[issue19043] Remove detailed listing of all versions from LICENSE, Doc/license.rst

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Looks good to me. Python 1.5.2 (which I've never used) is the best Python anyway! -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19043 ___

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Simple patch attached. -- keywords: +patch Added file: http://bugs.python.org/file31814/tee_64b.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19049

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ideally, test specification should be separate from test execution. That is, it should be possible to keep the TestCase around (or whatever instantiates it, e.g. a factory) but get rid of its per-test-execution attributes. Perhaps restoring the original

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thy are visible by calling gc.get_referents(). High-level function can use this to count recursive size of objects. import sys, gc, itertools def gettotalsizeof(*args, seen=None): ... if seen is None: ... seen = {} ... sum = 0 ... for

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: That would only be a shallow copy, so I'm not sure it's worth the effort. The test has the opportunity in the setUp to ensure that initial state is correct - so I would leave that per test. Obviously sharing state between tests is prima facie bad, but any

[issue12944] Accept arbitrary files for packaging's upload command

2013-09-19 Thread Florent Rougon
Changes by Florent Rougon frou...@users.sourceforge.net: -- nosy: +frougon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12944 ___ ___

[issue19050] crash while writing to a closed file descriptor

2013-09-19 Thread Daniel Rohlfing
New submission from Daniel Rohlfing: This snippet let my interpreter crash immediately: import sys, io io.open(sys.stdout.fileno(), 'wb') fd.close() sys.stdout.write(now writing on stdout will cause a crash) That's happened on Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32

[issue19050] crash while writing to a closed file descriptor

2013-09-19 Thread Daniel Rohlfing
Daniel Rohlfing added the comment: the correct snippet is: fd = io.open(sys.stdout.fileno(), 'wb') fd.close() sys.stdout.write(now writing on stdout will cause a crash) -- ___ Python tracker rep...@bugs.python.org

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thy are visible by calling gc.get_referents(). That's totally besides the point. The point is that those objects are invisible in normal conditions, not that they can't be read using advanced implementation-dependent tricks. --

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: That would only be a shallow copy, so I'm not sure it's worth the effort. The test has the opportunity in the setUp to ensure that initial state is correct - so I would leave that per test. I don't understand your objection. The concern is to get rid of old

[issue19047] Assorted weakref docs improvements

2013-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: I was initially thinking to myself I have a source checkout right here, I should just fix it, even though I'm at work and want to go home... and then I realised the potential scope of the fixes needed, given the longstanding misbehaviours these docs assume still

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: On 19 Sep 2013, at 14:06, Antoine Pitrou rep...@bugs.python.org wrote: Antoine Pitrou added the comment: That would only be a shallow copy, so I'm not sure it's worth the effort. The test has the opportunity in the setUp to ensure that initial state is

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: If the object state includes mutable objects then restoring the previous dictionary will just restore the same mutable (and likely mutated) object. I don't understand what you're talking about. Which mutable objects exactly? I'm talking about copying the

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The point is that your patch breaks functions like gettotalsizeof(). It makes impossible to get a total size of general object. It will be better to add gettotalsizeof() to the stdlib (or add an optional parameter to sys.getsizeof() for recursive counting).

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: Ah right, my mistake. Before setUp there shouldn't be test state. (Although tests are free to do whatever they want in __init__ too and I've seen plenty of TestCase subclasses using __init__ when they should be using setUp.) Essentially though _cleanup is a

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: That said, I agree that the __dict__ proposal is a hack, but as is the current _removetestAtIndex mechanism. The only clean solution I can think of would be to have two separate classes: - a TestSpec which contains execution-independent data about a test case,

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: The point is that your patch breaks functions like gettotalsizeof(). It makes impossible to get a total size of general object. The thing is, Total size is generally meaningless. It can include things such as the object's type, or anything transitively

[issue10042] functools.total_ordering fails to handle NotImplemented correctly

2013-09-19 Thread Drekin
Drekin added the comment: Hello, I have run into this when I wanted to use OrderedEnum and the example in enum docs seemed too repetitive to me. It's nice to know that it's being worked on. -- nosy: +Drekin ___ Python tracker rep...@bugs.python.org

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: There are some classes in gzip, bz2, lzma, and zipfile modules which implement buffered reader interface. They read chunks of data from underlied file object, decompress it, save in internal buffer, and provide common methods to read from this buffer.

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Michael Foord
Michael Foord added the comment: Having TestLoader.loadTestsFromTestCase() return a lazy suite that defers testcase instantiation until iteration is a nice idea. Unfortunately the TestSuite.addTests api iterates over a suite to add new tests. i.e. the code that builds a TestSuite for module

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are benchmark script and its results. -- Added file: http://bugs.python.org/file31816/read_bench.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19051

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file31817/read_bench_cmp ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19051 ___

[issue19051] Unify buffered readers

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: See issue12053 for a more flexible primitive. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19051 ___ ___

[issue18553] os.isatty() is not Unix only

2013-09-19 Thread Dmi Baranov
Dmi Baranov added the comment: I found a little difference in isatty implementaions: Windows Determines whether a file descriptor is associated with a character device [1] Unix Test whether a file descriptor refers to a terminal [2] So, we having a same behavior for pipes, but different for

[issue19053] read1() from zipfile returns empty data

2013-09-19 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Bzip2 is block-based compression with large (up to 800 Kb) size of block. It means that while decompressor not read enough data it can't produce any output (actually this issue exists for other compression algorithms too, but less frequent). And the

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +orsenthil type: performance - enhancement versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.5 ___ Python tracker rep...@bugs.python.org

[issue11798] Test cases not garbage collected after run

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Unfortunately the TestSuite.addTests api iterates over a suite to add new tests. i.e. the code that builds a TestSuite for module probably already iterates over the suites returned by TestLoader.loadTestsFromTestCase - so the change would need to be more

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This primitive doesn't not well fit a case of compressed streams. A chunk of compressed data read from underlied file object can be uncompressed to unpredictable large data. We can't limit the size of buffer. Another point is that buffer interface is not

[issue12053] Add prefetch() for Buffered IO (experiment)

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12053 ___ ___

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
New submission from Joseph Warren: I will add as a disclaimer to this bug report that I am relatively new to both the http spec, and Python programming, so I may have completely misunderstood something. When I make a post request with some data (using libCurl), It sends the headers first,

[issue18553] os.isatty() is not Unix only

2013-09-19 Thread Senthil Kumaran
Senthil Kumaran added the comment: Hello Dmi, I having a snippet to fix that, should I open a new issue for patch? Please open a new issue. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18553

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread R. David Murray
R. David Murray added the comment: See also issue 1346874. It seems that we do not currently handle 'continue' correctly in general. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19052

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This primitive doesn't not well fit a case of compressed streams. A chunk of compressed data read from underlied file object can be uncompressed to unpredictable large data. We can't limit the size of buffer. Another point is that buffer interface is not

[issue19051] Unify buffered readers

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- Removed message: http://bugs.python.org/msg198083 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19051 ___

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I like the definition of __sizeof__ that was discussed some time ago: http://bugs.python.org/issue14520#msg157798 With that definition (do we have it somewhere in the docs, by the way?) The current code works gives the correct answer. -- nosy:

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't sys.getsizeof() a low-level debugging tool? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048 ___

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
Joseph Warren added the comment: Cheers, would you suggest I submit a patch then? Also what version of python should I do this against? I've been working with 2.7, but the issue still exists in 3.* and I can conveniently work against 3.2.3-7, and less conveniently work against other versions.

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread R. David Murray
R. David Murray added the comment: I think we can fix this in maintenance releases without breaking anyone's code, so a patch against both 2.7 and 3.3 would be ideal. A patch against 3.2 will probably apply cleanly to 3.3, so that should be fine as well. Thanks for working on this, and could

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't think we need Py_ssize_t for integers from 0 to 57. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19049 ___

[issue19054] Descriptors howto

2013-09-19 Thread Marco Buttu
New submission from Marco Buttu: I think in the descriptor howto, at this point: class MyClass(object): x = RevealAccess(10, 'var x') y = 5 or the prompt should not have been, or there is a wrong indentation. Furthermore, in Python 3: http://docs.python.org/3/howto/descriptor.html

[issue19053] read1() from zipfile returns empty data

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19053 ___ ___

[issue19053] read1() from zipfile returns empty data

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file31819/zipfile_read1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19053

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Isn't sys.getsizeof() a low-level debugging tool? What would it help debug exactly? :-) I would hope it gives remotely useful information about the passed object. -- ___ Python tracker rep...@bugs.python.org

[issue19054] Descriptors howto

2013-09-19 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: Added file: http://bugs.python.org/file31821/py2howto.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: getsizeof() is interesting only if it gives sensible results when used correctly, especially if you want to sum these values and get a global memory usage. One usage is to traverse objects through gc.get_referents(); in this case the definition above

[issue19054] Descriptors howto

2013-09-19 Thread Marco Buttu
Changes by Marco Buttu marco.bu...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file31820/py3howto.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19054 ___

[issue19049] itertools.tee uses int for indices

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, my bad, it seems I misunderstood the tee() implementation. So apparenly even index cannot get past 57. It's more of a consistency patch then, and I agree it isn't very important. -- priority: normal - low stage: needs patch - patch review title:

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well. itertools._tee is one Python object and itertools._tee_dataobject is another Python object. sys.getsizeof() gives you the memory usage of this objects separately. -- ___ Python tracker

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How do you stop walking your graph if it spans the whole graph of Python objects? We can stop at specific types of objects (for example types and modules). If sys.getsizeof() is only useful for people who know *already* how an object is implemented

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is why using get_referents() is stupid in the general case: class C: pass ... c = C() gc.get_referents(c) [class '__main__.C'] With your method, measuring c's memory consumption also includes the memory consumption of its type object. (and of course

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: (By the way, OrderedDict.__sizeof__ already breaks the rule you are trying to impose) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19048 ___

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well. itertools._tee is one Python object and itertools._tee_dataobject is another Python object. sys.getsizeof() gives you the memory usage of this objects separately. This is great... And how do I know that I need to use gc.get_referents() to get those

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think we need Py_ssize_t for integers from 0 to 57. IMO it's better to use Py_ssize_t there, since it can get combined with other Py_ssize_t values. Avoiding spurious conversions eliminates a common source of errors. We don't gain anything by keeping

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's why sys.getsizeof() is a low-level tool. We need high-level tool in the stdlib. Even imperfect recursive counting will be better than confusing for novices sys.getsizeof(). Ok, but I need to see a satisfying version of gettotalsizeof before I'm

[issue3982] support .format for bytes

2013-09-19 Thread Augie Fackler
Augie Fackler added the comment: I'd like to put a nudge towards supporting the __mod__ interface on bytes - for Mercurial this is the single biggest impediment to even getting our testrunner working, much less starting the porting process. -- nosy: +durin42

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Optionally we can also not count objects which are referenced from outside of a graph of objects (this isn't so easy implement in Python). I.e. gettotalsizeof([1, 'abc', math.sqrt(22)], inner=True) will count only bare list and a square of 22, because 1 and

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Martin v . Löwis
Martin v. Löwis added the comment: The problem is that that definition isn't helpful. If we ever change itertools.tee to use non-PyObjects internally, s suddenly its sys.getsizeof() would have to return much larger numbers despite visible behaviour not having changed at all (and despite the

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I see no problem with that. If the internal representation changes, nobody should be surprised if sizeof changes. Who is nobody? Users aren't aware of internal representation changes. It sounds like you want sys.getsizeof() to be a tool for language

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Optionally we can also not count objects which are referenced from outside of a graph of objects (this isn't so easy implement in Python). I.e. gettotalsizeof([1, 'abc', math.sqrt(22)], inner=True) will count only bare list and a square of 22, because 1 and

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: getsizeof() is interesting only if it gives sensible results when used correctly, especially if you want to sum these values and get a global memory usage. Getting a global memory usage isn't a correct use of getsizeof(), though, because it totally ignores

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I doubt we should change this. Currently itertools.tee() will break if more than 2**31 elements are saved in the inner structures. I certainly think it should be fixed, rather than bite someone by surprise one day. However in any case you forgot about

[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We gain stability. I doubt we should change this. However in any case you forgot about tee_reduce(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19049

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
Joseph Warren added the comment: Issue1346874 seems similar, but is talking about a failure to handle 100 Continue responses sent by a server to the client, this issue is in server code, and is a failure of BaseHttpServer to send 100 Continue responses to a client which expects them. Please

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread R. David Murray
R. David Murray added the comment: You are making perfect sense. My point in referencing that issue was that you are not crazy, we do indeed not handle continue correctly ;) -- ___ Python tracker rep...@bugs.python.org

[issue19048] itertools.tee doesn't have a __sizeof__ method

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I like the definition of __sizeof__ that was discussed some time ago: http://bugs.python.org/issue14520#msg157798 The problem is that that definition isn't helpful. If we ever change itertools.tee to use non-PyObjects internally, suddenly its sys.getsizeof()

[issue15751] Support subinterpreters in the GIL state API

2013-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: I wanted to set issue10915 as duplicate but there is actually a tentative patch there. Unfortunately the discussions are now split apart... -- ___ Python tracker rep...@bugs.python.org

[issue15751] Support subinterpreters in the GIL state API

2013-09-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15751 ___ ___ Python-bugs-list

[issue10915] Make the PyGILState API compatible with multiple interpreters

2013-09-19 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10915 ___ ___ Python-bugs-list

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Jason Stumpf
New submission from Jason Stumpf: re.match('(a|ab)*',('aba')).group(0) 'a' According to the documentation, the * should match as many repetitions as possible. 2 are possible, it matches 1. Reversing the order of the operands of | changes the behaviour. re.match('(ab|a)*',('aba')).group(0)

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Jason Stumpf
Changes by Jason Stumpf jstu...@google.com: -- components: +Regular Expressions nosy: +ezio.melotti, mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19055 ___

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread David Benbennick
Changes by David Benbennick dbenb...@gmail.com: -- nosy: +dbenbenn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19055 ___ ___ Python-bugs-list

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
Joseph Warren added the comment: Have downloaded an up to date version of Python to develop with, and found that this issue had been fixed in it. This seems to have been done in changeset: 65028:7add45bcc9c6 changeset: 65028:7add45bcc9c6 user:Senthil Kumaran orsent...@gmail.com

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
Joseph Warren added the comment: Sorry, this change does appear in 2.7.* I was looking at the wrong mercurial Tag -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19052 ___

[issue19052] Python's CGIHTTPServer does not handle Expect: 100-continue gracefully which results in some Post requests being handled slowly.

2013-09-19 Thread Joseph Warren
Changes by Joseph Warren hungryjoe.war...@gmail.com: -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19052 ___

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19055 ___ ___

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19055 ___ ___

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread janzert
janzert added the comment: The documentation on the | operator in the re module pretty explicitly covers this. http://docs.python.org/2/library/re.html A|B, where A and B can be arbitrary REs, creates a regular expression that will match either A or B. An arbitrary number of REs can be

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Jason Stumpf
Jason Stumpf added the comment: Even with the documentation to |, the documentation to * is wrong. re.match('(a|ab)*c',('abac')).group(0) 'abac' From the doc: In general, if a string p matches A and another string q matches B, the string pq will match AB. Since '(a|ab)*c' matches 'abac',

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Jason Stumpf
Jason Stumpf added the comment: Sorry, that implication was backwards. I don't think I can prove from just the documentation that '(a|ab)*' can match 'aba' in certain contexts. If the docs said: * attempts to match again after each match of the preceding regular expression. I think it would

[issue19055] Regular expressions: * does not match as many repetitions as possible.

2013-09-19 Thread Matthew Barnett
Matthew Barnett added the comment: The behaviour is correct. Here's a summary of what's happening:- First iteration of the repeated group: Try the first branch. Can match a. Second iteration of the repeated group: Try the first branch. Can't match a. Try the second branch.

  1   2   >