[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread James Henstridge
James Henstridge [EMAIL PROTECTED] added the comment: Is repeating a test with the same TestCase instance ever safe? It'd be better to create a new instance and run that. If any of the variables in test.globs are changed by the test (e.g. appending to a list), then rerunning the test will not

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread Piet Delport
Piet Delport [EMAIL PROTECTED] added the comment: If any of the variables in test.globs are changed by the test (e.g. appending to a list), then rerunning the test will not necessarily give the same result. This is true, but modifying the globals such that subsequent runs of the same test can

[issue2607] why is (default)dict so slow on tuples???

2008-04-11 Thread Andreas Eisele
Andreas Eisele [EMAIL PROTECTED] added the comment: Great, that really solves my problem. Thank you so much, Amaury! As you say, the problem is unrelated to dicts, and I observe it also when including the tuples to a set or keeping them in lists. Perhaps your GC thresholds would be better

[issue2614] Console UnicodeDecodeError s once more

2008-04-11 Thread anatoly techtonik
New submission from anatoly techtonik [EMAIL PROTECTED]: Python debugging under console is a PITA, because it has a bad habit to fail with UnicodeEncodeError in case of unknown encoding in output. It quickly turns into a headache when inspecting methods like in the following example running

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread James Henstridge
James Henstridge [EMAIL PROTECTED] added the comment: If I create a test case with a command like: test = DocFileSuite('foo.txt', globs={'somelist': [42]}) The doctest isn't doing anything wrong if it modifies somelist. Furthermore, Glyph has said he thinks the current --until-failure

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread Piet Delport
Piet Delport [EMAIL PROTECTED] added the comment: Well, whether that code is wrong depends on whether your project policy wants repeatable tests or not. A repeatable and arguably more idiomatic way of writing that example is to give DocFileSuite a setUp function which initializes any special

[issue2607] why is (default)dict so slow on tuples???

2008-04-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: The slowdown is because of the garbage collector, which has more and more objects to traverse (the tuples). If I add import gc; gc.disable() at the beginning of your script, it runs much faster, and the timings look linear. Martin's

[issue2613] inconsistency with bare * in parameter list

2008-04-11 Thread Mark Summerfield
New submission from Mark Summerfield [EMAIL PROTECTED]: A bare * in a parameter list behaves differently depending on what follows it: Py30a4: def f(*, a=1, b=2): return 1 def g(*, **kwargs): return 1 SyntaxError: named arguments must follow bare * (pyshell#10, line 1) I don't know if this

[issue2615] xml.dom.minidom documentation consistency and update

2008-04-11 Thread Jeroen Ruigrok van der Werven
New submission from Jeroen Ruigrok van der Werven [EMAIL PROTECTED]: xml.dom.minidom details three methods: writexml(), toxml(), toprettyxml(). Only one, toxml(), showed the optional encoding argument. In the documentation for writexml() the encoding argument is explained, but toprettyxml()

[issue1738] filecmp.dircmp does exact match only

2008-04-11 Thread Michael Amrhein
Michael Amrhein [EMAIL PROTECTED] added the comment: I've implemented an enhanced version of this feature by adding a keyword 'match' to the constructor of class 'dircmp'. It defaults to function 'fnmatch' imported from module 'fnmatch'. This allows to exclude directories and/or files by using

[issue2604] doctest.DocTestCase fails when run repeatedly

2008-04-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: FWIW, the python testsuite needs repeatable tests, when running in reference leaks mode. See also r62100, where a DocTestSuite construction had to be moved into the repeated function. -- nosy: +amaury.forgeotdarc

[issue2612] file.tell() returns Long usually, Int if subclassed

2008-04-11 Thread Benjamin Peterson
Benjamin Peterson [EMAIL PROTECTED] added the comment: The documentation is still not very good about documenting the differences between new and old style classes. Perhaps this is something which could go under the __len__ entry in Special Method Names. -- nosy: +georg.brandl

[issue2610] string representation of range

2008-04-11 Thread Brad Miller
Brad Miller [EMAIL PROTECTED] added the comment: Here is a new patch file. This one contains the modifications to rangeobject.c as well as test_range.py I think this is everything. If there is something else I need to do please let me know. I looked to see if there was any documentation I

[issue1738] filecmp.dircmp does exact match only

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: +1 on adding the match argument. Can you comment on how one would implement the old behavior? I would guess match=lambda x,y: x in y, which is not that bad, but maybe that should be the default and those who need pattern matching

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2008-04-11 Thread Sérgio Durigan Júnior
Sérgio Durigan Júnior [EMAIL PROTECTED] added the comment: Hi Martin, Actually, I know that you can use CC to do it, but IMHO that's not the correct approach. I understand too you concern about adding @CFLAGS@, but I think the user should be able to define his/her own CFLAGS, and this is not

[issue2610] string representation of range

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: -1 I don't think 0, 1, ..., 9 is much clearer than range(0, 10). The only problem students may have is that 10 not in range(0, 10), but this can be learned very quickly. The .. repr breaks x == eval(repr(x)) invariant which is

[issue2610] string representation of range

2008-04-11 Thread Brad Miller
Brad Miller [EMAIL PROTECTED] added the comment: The patch does not change the behavior of repr. It modifies the behavior of str. I agree that learning list/tuple sooner is better, but students who have never written a line of code before can only absorb so much information, this little

[issue2610] string representation of range

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: I did not realize that the proposed patch only affects str and not repr. Some of may previous arguments against it do not hold in this case, but I am still -1. If you introduce range before list, it will be hard to explain why lists

[issue2616] ctypes.pointer(), ctypes.POINTER() speedup

2008-04-11 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: This patch implements the POINTER() and the pointer() function in C; giving a speedup of roughly a factor of 2. -- assignee: theller components: ctypes files: ctypes-pointer.diff keywords: patch, patch messages: 65356 nosy: theller

[issue2610] string representation of range

2008-04-11 Thread Brad Miller
Brad Miller [EMAIL PROTECTED] added the comment: Our use of range in the first few classes is exactly for iteration purposes, but I do not like students to have to have too many mysteries. So I always have liked to show that range(10) simply produces a sequence of integers. In Python 3.0

[issue1738] filecmp.dircmp does exact match only

2008-04-11 Thread Michael Amrhein
Michael Amrhein [EMAIL PROTECTED] added the comment: Ok, I've set default arguments (back) to None. Revised patch attached. Defaulting the match function to fnmatch doesn't change the behavior in the normal case, i.e. when regular file / directory names are used, like in the default value of

[issue2559] atom sorting error when building ctypes

2008-04-11 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I see this also, on Leopard x86. The linker error is not printed on Tiger PPC. At least, the ctypes test suite does work ok so it may be that it can be ignored. Googling for this error, I find that it may be related to linker changes that

[issue1738] filecmp.dircmp does exact match only

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: As you are working on this, please consider changing self.hide+self.ignore in phase0 to chain(self.hide, self.ignore) where chain should be imported from itertools. There is no need to create the combined list (twice!) and not accepting

[issue2610] string representation of range

2008-04-11 Thread Brad Miller
Brad Miller [EMAIL PROTECTED] added the comment: Clearly neither Alexander nor I are going to get the other to come around to our point of view. Thats fine, I think we can disagree here, and I can adapt and change my class either way. My question is how does this get resolved. When I posted

[issue2617] Patch to emit -J is reserved for Jython on -J arg

2008-04-11 Thread Frank Wierzbicki
New submission from Frank Wierzbicki [EMAIL PROTECTED]: This patch adds the message -J is reserved for Jython if that arg is attempted. See http://mail.python.org/pipermail/python-dev/2008-April/078564.html For support from BDFL. -- components: Interpreter Core files: argdashjay.diff

[issue2610] string representation of range

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: On Fri, Apr 11, 2008 at 2:45 PM, Brad Miller [EMAIL PROTECTED] wrote: .. My question is how does this get resolved. When I posted this idea to python-dev Guido suggested an approach. Nobody else expressed an opinion so after

[issue2618] Tile module: Add support for themed widgets

2008-04-11 Thread Kevin Walzer
New submission from Kevin Walzer [EMAIL PROTECTED]: The Tile module adds support for the platform-native themed widgets now available in Tk 8.5's core (ttk:: namespace in Tk terms). The module also supports the ttk:: namespace for Tk 8.4 if a separate Tk extension is installed. Adding this

[issue858809] Use directories from configure rather than hardcoded

2008-04-11 Thread Sérgio Durigan Júnior
Sérgio Durigan Júnior [EMAIL PROTECTED] added the comment: Hi, Continuing with my effort to improve Python's build system, I'd really like to know why this issue has not been solved yet. I mean, apparently this problem is still present in Python 2.5, since I can't change the library's path with

[issue2618] Tile module: Add support for themed widgets

2008-04-11 Thread Guilherme Polo
Guilherme Polo [EMAIL PROTECTED] added the comment: Is this complete ? I see several methods with just a pass, where the docstring says it returns a dict, for example. -- nosy: +gpolo __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2618

[issue2619] Document memoryview

2008-04-11 Thread Benjamin Peterson
New submission from Benjamin Peterson [EMAIL PROTECTED]: memoryview documentation is currently nonexistent. -- assignee: georg.brandl components: Documentation messages: 65370 nosy: benjamin.peterson, georg.brandl priority: critical severity: normal status: open title: Document

[issue2610] string representation of range

2008-04-11 Thread Brad Miller
Brad Miller [EMAIL PROTECTED] added the comment: I would suggest considering a custom displayhook approach. You can write a custom displayhook that will print range(..), {}.keys(), {}.values() etc in a student-friendly way. I believe a module installing such display hook can be included in

[issue2559] atom sorting error when building ctypes

2008-04-11 Thread Ronald Oussoren
Ronald Oussoren [EMAIL PROTECTED] added the comment: I'm pretty sure I get the same error when building PyObjC. It seems to be a harmless warning though, PyObjC passes all its unittests and those really exercise all of libffi. __ Tracker [EMAIL PROTECTED]

[issue2590] S_unpack_from() Read Access Violation

2008-04-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: What do you mean by obscene values? Do you have an example of actual values where the check at line 1561 does not do the right thing? -- just trying to understand where the problem is. -- nosy: +amaury.forgeotdarc

[issue2618] Tile module: Add support for themed widgets

2008-04-11 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- components: +Library (Lib) type: behavior - feature request __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2618 __

[issue2607] why is (default)dict so slow on tuples???

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Perhaps your GC thresholds would be better default values than what is currently in force. No, the defaults are correct for typical applications. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2607

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Actually, I know that you can use CC to do it, but IMHO that's not the correct approach. I understand too you concern about adding @CFLAGS@, but I think the user should be able to define his/her own CFLAGS, and this is not implemented yet.

[issue2610] string representation of range

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I don't think 0, 1, ..., 9 is much clearer than range(0, 10). The only problem students may have is that 10 not in range(0, 10), but this can be learned very quickly. The .. repr breaks x == eval(repr(x)) invariant which is actually

[issue2610] string representation of range

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Now there are objections. Other than some mild frustration at having invested a fair amount of time in producing my first python patch, I am also in the middle of editing a textbook that will come out this fall. Don't be frustrated.

[issue2618] Tile module: Add support for themed widgets

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Kevin, is this all your code (the comment seems to suggest otherwise). Can all authors fill out contributor agreements? -- nosy: +loewis __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2618

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Justin Ferguson
New submission from Justin Ferguson [EMAIL PROTECTED]: 174 static 175 int unicode_resize(register PyUnicodeObject *unicode, 176 Py_ssize_t length) 177 { [...] 201 202 oldstr = unicode-str; 203 PyMem_RESIZE(unicode-str, Py_UNICODE, length + 1); [...] 209

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Justin Ferguson
Changes by Justin Ferguson [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10012/python-2.5.2-unicode_resize-utf8.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2620 __

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Justin Ferguson
Changes by Justin Ferguson [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10013/python-2.5.2-unicode_resize-utf16.py __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2620 __

[issue2590] S_unpack_from() Read Access Violation

2008-04-11 Thread Justin Ferguson
Justin Ferguson [EMAIL PROTECTED] added the comment: What I was originally thinking was if offset was larger than buf_len, that would cause the check at 1561 to fail due to the subtraction. That said, I'm not sure what type its being compared against so I need to check this further, let me get

[issue2618] Tile module: Add support for themed widgets

2008-04-11 Thread Kevin Walzer
Kevin Walzer [EMAIL PROTECTED] added the comment: No, it is not all my code. I will contact Martin Franklin about filling out contributors agreement. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2618 __

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Marc-Andre Lemburg
Marc-Andre Lemburg [EMAIL PROTECTED] added the comment: You are probably referring to 32-bit platforms. At least on 64-bit platforms, there's no problem with your test cases: # this is to get the unicode_freelist initialized ... # the length of the string must be = 9 to keep ... # unicode-str

[issue2610] string representation of range

2008-04-11 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: FWIW, I would like to see a newsgroup or python-dev discussion for a more general solution to the problem for helpful repr's for iterators. In 3.0, lots of things return iterators, not just range(). Before applying one ad-hoc patch, it

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Justin Ferguson
Justin Ferguson [EMAIL PROTECTED] added the comment: Yes, excuse me-- this should be 32-bit specific as I believe Python will not let me get a string long enough to overflow the integer on 64-bit. It's a big string, the only realistic scenario I can see is XML parsing or similar. theory$

[issue2621] rename test_support to support

2008-04-11 Thread Benjamin Peterson
New submission from Benjamin Peterson [EMAIL PROTECTED]: I used some brute force search and replace for this and it worked quite well. If this patch is accepted, I'll fix the docs. -- components: Tests files: rename_test_support.patch keywords: easy, patch messages: 65385 nosy:

[issue2621] rename test_support to support

2008-04-11 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: Added file: http://bugs.python.org/file10015/rename_test_support2.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2621 __

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Note that in r61458 Neal replaced PyMem_RESIZE with a direct call to PyMem_REALLOC thus eliminating integer overflow check even from the debug builds. -- nosy: +belopolsky, nnorwitz __ Tracker

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Justin, Where did you find the definition that you cited: 95 #define PyMem_RESIZE(p, type, n) \ 96 ( assert((n) = PY_SIZE_MAX / sizeof(type)) , \ 97 ( (p) = (type *) PyMem_REALLOC((p), (n) * sizeof(type)) ) ) ? Current

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Gregory P. Smith
Changes by Gregory P. Smith [EMAIL PROTECTED]: -- nosy: +gregory.p.smith priority: - high versions: +Python 2.4 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2620 __

[issue2607] why is (default)dict so slow on tuples???

2008-04-11 Thread Andreas Eisele
Andreas Eisele [EMAIL PROTECTED] added the comment: Even if they mean that creation of a huge number N of objects requires O(N*N) effort? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2607 __

[issue2620] Multiple buffer overflows in unicode processing

2008-04-11 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: The following simple change should be enough for this issue, but I would consider implementing the overflow check in the PyMem_RESIZE and PyMem_NEW macros and de-deprecate their use.

[issue2607] why is (default)dict so slow on tuples???

2008-04-11 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: This discussion ought to be moved to comp.lang.python. The timing script needs work. It doesn't isolate any one issue for discussion. It is affected by GC, dict resizing, details of creating and hashing string objects, the need to

[issue2622] Import errors in email.message.py

2008-04-11 Thread John Jackson
New submission from John Jackson [EMAIL PROTECTED]: In email.message.py there are two import errors: line 128 from email.Generator import Generator should be from email.generator import Generator line 784 from email.Iterators import walk should be from email.iterators import walk

[issue2621] rename test_support to support

2008-04-11 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: What's the rationale for this change? -- nosy: +loewis __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2621 __ ___