[issue17833] test_gdb broken PPC64 Linux

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 63f2941477d3 by Ezio Melotti in branch '2.7': #17833: add debug output to investigate buildbot failure. http://hg.python.org/cpython/rev/63f2941477d3 -- ___ Python tracker rep...@bugs.python.org

[issue17833] test_gdb broken PPC64 Linux

2013-05-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- Removed message: http://bugs.python.org/msg188621 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17833 ___

[issue17871] Wrong signature of TextTestRunner's init function

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5dd076d441ec by Ezio Melotti in branch '3.3': #17871: fix unittest.TextTestRunner signature in the docs. Patch by Yogesh Chaudhari. http://hg.python.org/cpython/rev/5dd076d441ec New changeset 15ed67602ddf by Ezio Melotti in branch 'default':

[issue17871] Wrong signature of TextTestRunner's init function

2013-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: docs@python - ezio.melotti resolution: - fixed stage: needs patch - committed/rejected status: open - closed versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org

[issue17914] add os.cpu_count()

2013-05-07 Thread Charles-François Natali
Charles-François Natali added the comment: I also vote +1 for returning None when the information is unknown. I still don't like it. If a function returns a number of CPU, it should either return an integer = 1, or raise an exception. None is *not* an integer. And returning an exception is

[issue17917] use PyModule_AddIntMacro() instead of PyModule_AddIntConstant() when applicable

2013-05-07 Thread Charles-François Natali
Charles-François Natali added the comment: PC/_msi.c: Oh, here you should remove cast to int. Example: PyModule_AddIntMacro(m, (int)MSIDBOPEN_CREATEDIRECT); I'm surprised that the does compile. You may have a (int)MSIDBOPEN_CREATEDIRECT variable :-) Probably, good catch ;-) I'll fix

[issue17914] add os.cpu_count()

2013-05-07 Thread STINNER Victor
STINNER Victor added the comment: I don't see exactly what this C implementation brings over the one in multiprocessing (which is written in Python)? multiprocessing.cpu_count() creates a subprocess on BSD and Darwin to get the number of CPU. Calling sysctl() or sysctlnametomib() should be

[issue17914] add os.cpu_count()

2013-05-07 Thread Charles-François Natali
Charles-François Natali added the comment: Fair enough, I guess we should use it then. We just have to agree on the value to return when the number of CPUs can't be determined ;-) -- ___ Python tracker rep...@bugs.python.org

[issue17914] add os.cpu_count()

2013-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: Returning None sounds reasonable to me. Raising an exception pretty much means that the function should always be called in a try/except (unless you are sure that the code is running on an OS that knows the number of CPUs). Returning -1 is not very Pythonic,

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
New submission from Jan Safranek: I have Python 2.7.4 running on Fedora Rawhide and I get segmentation fault with following backtrace: #0 0x7f73f69ca5f1 in clear_weakref (self=0x7f73ff515c00) at Objects/weakrefobject.c:56 #1 weakref_dealloc (self=0x7f73ff515c00) at

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
Jan Safranek added the comment: I can reproduce the crash in very unusual setup: 1. OpenPegasus (http://www.openpegasus.org/), for this bug we may consider it just a network daemon, listening on TCP port. When a request comes, it is eventually processed by a provider (= something like plugin).

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
Jan Safranek added the comment: Bisecting Python mercurial repository, I found the patch which causes the crash: changeset: 80762:7e771f0363e2 branch: 2.7 parent: 80758:29627bd5b333 user:Antoine Pitrou solip...@pitrou.net date:Sat Dec 08 21:15:26 2012 +0100 summary:

[issue17922] Crash in clear_weakref

2013-05-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +benjamin.peterson, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17922 ___ ___

[issue17714] str.encode('base64') add trailing new line character. It is not documented.

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b764c3521fa by Ezio Melotti in branch '2.7': #17714: document that the base64 codec adds a trailing newline. http://hg.python.org/cpython/rev/8b764c3521fa -- nosy: +python-dev ___ Python tracker

[issue17714] str.encode('base64') add trailing new line character. It is not documented.

2013-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: The str.encode() doc is the wrong place where to document this, since the '\n' is added only for the base64 codec. I added a note about this in the codecs docs[0]. [0]: http://docs.python.org/2/library/codecs.html#standard-encodings -- assignee:

[issue17714] str.encode('base64') add trailing new line character. It is not documented.

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset cbb23e40e0d7 by Ezio Melotti in branch '3.3': #17714: document that the base64 codec adds a trailing newline. http://hg.python.org/cpython/rev/cbb23e40e0d7 New changeset b3e1be1493a5 by Ezio Melotti in branch 'default': #17714: merge with 3.3.

[issue13515] Consistent documentation practices for security concerns and considerations

2013-05-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___

[issue17923] test glob with trailing slash fail

2013-05-07 Thread Delhallt
New submission from Delhallt: test_glob's trailing_slash tests fails on AIX 6.1/Python 2.7.4: The code section for no_magic/slash case seems to be the issue. Attached patch resolves issue. FAIL: test_glob_directory_with_trailing_slash (test.test_glob.GlobTests)

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hi Jan, First, have you seen the following message on that bug report: http://bugs.python.org/issue16602#msg177180 Second, I would suggest you build a debug build of Python (./configure --with-pydebug), it should give you more information in the stack trace,

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2013-05-07 Thread Nick Coghlan
Nick Coghlan added the comment: I checked in the missing file after I woke up this morning. Maybe I'll learn to use hg import instead of patch some day... Sorry for the noise. -- status: open - closed ___ Python tracker rep...@bugs.python.org

[issue17912] thread states should use a doubly-linked list

2013-05-07 Thread Charles-François Natali
Charles-François Natali added the comment: There are a couple other places, IIRC. That said, I'm not sure what the point is, since a linked list is quite a simple structure anyway? Well, it was just to avoid code duplication, and gain a nice iteration macro ;-) Anyway, I'll submit a patch

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
Jan Safranek added the comment: First, have you seen the following message on that bug report: http://bugs.python.org/issue16602#msg177180 I'm reading it now... I searched for PyWeakref_GET_OBJECT in cmpi-bindings and both occurrences generated by SWIG and both look safe. Is it

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not working fine on Python 3.3.0. with codecs.open('/tmp/test.txt', 'w', encoding='iso-8859-1') as f: ... xml = XMLGenerator(f, encoding='iso-8859-1') ... xml.startDocument() ... xml.startElement('root', {'attr': u'\u20ac'}) ...

[issue17924] Deprecate stat.S_IF* integer constants

2013-05-07 Thread Christian Heimes
New submission from Christian Heimes: Related to #11016 I like to deprecate the S_IF* constants in favor of the S_IS*() functions. rationals: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html No new S_IFMT symbolic names for the file type values of mode_t will be defined

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread STINNER Victor
STINNER Victor added the comment: Accepting of text streams in XMLGenerator should be deprecated in future versions. I agree that the following pattern is strange: with codecs.open('/tmp/test.txt', 'w', encoding='iso-8859-1') as f: xml = XMLGenerator(f, encoding='iso-8859-1') Why would

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Debugging with gdb is quite a problem, I have gdb linked with distribution Python 2.7.4 and it doesn't cooperate with my custom built python, which I have in LD_LIBRARY_PATH Ok. Still, you should be able to inspect the variables at the crash point. Could

[issue17914] add os.cpu_count()

2013-05-07 Thread R. David Murray
R. David Murray added the comment: As for why to not return 1, I can imagine code that checks cpu_count, and only if it returns the don't know result would it invoke some more expensive method of determining the CPU count on platforms that cpu_count doesn't support. Since the os module is

[issue13515] Consistent documentation practices for security concerns and considerations

2013-05-07 Thread Nick Coghlan
Nick Coghlan added the comment: The new section looks good to me. Would it be appropriate to explicitly note that this is a relatively recent change of policy, so most of the stdlib docs don't actually follow it? (and patches to bring them into line would be reasonable) --

[issue13515] Consistent documentation practices for security concerns and considerations

2013-05-07 Thread R. David Murray
R. David Murray added the comment: Probably. Otherwise people are going to go look at the subprocess docs as an example...and they don't follow it. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515

[issue13515] Consistent documentation practices for security concerns and considerations

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch looks fine to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515 ___ ___ Python-bugs-list mailing

[issue17911] Extracting tracebacks does too much work

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: You may want two pieces of stack: the piece of stack that is above and including the catch point, and the piece of stack that is below it. The former is what gets traditionally printed in tracebacks, but the latter can be useful as well (see issue1553375 for

[issue15392] Create a unittest framework for IDLE

2013-05-07 Thread Nick Coghlan
Nick Coghlan added the comment: I've added 2.7 to the affected versions - the core unittest framework should be present in all 3 versions, so the choice of if/when to backport a fix and its test can be made on a case-by-case basis, rather than being a foregone conclusion due to the lack of

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which adds explicit checks for codecs stream writers and adds tests for these cases. The tests are not entirely honest, they test only that XMLGenerator works with some specially prepared streams. XMLGenerator doesn't work with a stream with

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: The test seems to be failing on Windows. -- nosy: +sbt status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463 ___

[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe

2013-05-07 Thread Pierrick Koch
New submission from Pierrick Koch: Dear, del deque[0] is not safe, see the attached patch for the asynchat.async_chat.initiate_send method. fix the IndexError: deque index out of range of del self.producer_fifo[0] Best, Pierrick Koch -- components: Library (Lib) files:

[issue12535] Chained tracebacks are confusing because the first traceback is minimal

2013-05-07 Thread Nick Coghlan
Nick Coghlan added the comment: Marking this as Library as well, since the traceback module should also be updated. -- components: +Library (Lib) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12535

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Of course, if this patch will be committed, perhaps it will be worth to apply it also for 3.2 which has the same regression. -- components: +XML stage: needs patch - patch review versions: +Python 3.2 ___ Python

[issue14146] IDLE: source line in editor doesn't highlight when debugging

2013-05-07 Thread Roger Serwy
Roger Serwy added the comment: I'm pinging this issue to see if anyone has had any problems with the Windows-specific workaround for highlighting the selection tags. Issue17511 depends on this fix. -- assignee: - roger.serwy ___ Python tracker

[issue12458] Tracebacks should contain the first line of continuation lines

2013-05-07 Thread Kushal Das
Kushal Das added the comment: I have been able to get the logical line details (start of it), now working on to print the required lines. The current way of showing source lines removes any indentation, but to show all the physical lines (related to the logical line) one should show the

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps we should add a deprecation warning for codecs streams right in this patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17915 ___

[issue13515] Consistent documentation practices for security concerns and considerations

2013-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: We could use the SSL docs[0] as example instead of subprocess. [0]: http://docs.python.org/3/library/ssl.html#security-considerations -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13515

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
Jan Safranek added the comment: Could you try to inspect the `self` variable inside weakref_dealloc, especially `self-wr_object` and its Py_TYPE() value? Also, what is the value of Py_REFCNT(self-wr_object)? in weakref_dealloc at Objects/weakrefobject.c:106: (gdb) p *self $1 = {_ob_next =

[issue4831] exec() behavior - revisited

2013-05-07 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4831 ___ ___ Python-bugs-list

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: (gdb) p *((PyWeakReference*)self)-wr_object $9 = {_ob_next = 0x0, _ob_prev = 0x0, ob_refcnt = 0, ob_type = 0x0} If I am reading Py_TYPE right, Py_TYPE(self-wr_object) must be 0 (=NULL). Well, no, it should *always* be non-NULL (and it's a strong

[issue17922] Crash in clear_weakref

2013-05-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: swigpyobject_type is a static PyTypeObject variable (similar to all static PyTypeObject structures we write in extension modules, but inside a function) It should never be deallocated... There may be a refcount issue with this object. -- nosy:

[issue12458] Tracebacks should contain the first line of continuation lines

2013-05-07 Thread R. David Murray
R. David Murray added the comment: Can you preserve just the *additional* indentation? That is, strip the excess leading whitespace, but preserve the logical indentation, like textwrap.dedent does? -- ___ Python tracker rep...@bugs.python.org

[issue17925] asynchat.async_chat.initiate_send : del deque[0] is not safe

2013-05-07 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17925 ___ ___

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: swigpyobject_type is a static PyTypeObject variable (similar to all static PyTypeObject structures we write in extension modules, but inside a function) It should never be deallocated... There may be a refcount issue with this object. Even if it's

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: The test seems to be failing on Windows. Yes. I'll try to setup a new Windows dev environment and take a look :-/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463

[issue17922] Crash in clear_weakref

2013-05-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Right. But this is an embedded interpreter, and SWIG does not call PyType_Ready() again; the old type is returned instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17922

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread David Edelsohn
Changes by David Edelsohn dje@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926 ___ ___ Python-bugs-list

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread David Edelsohn
New submission from David Edelsohn: The PowerLinux buildslave fails in test_dbm:test_keys() because of a problem with the in operator. import dbm d = dbm.open('t','c') a = [('a', 'b'), ('12345678910', '019237410982340912840198242')] for k,v in a: ... d[k] = v ... print d dbm.dbm

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread David Edelsohn
Changes by David Edelsohn dje@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926 ___ ___ Python-bugs-list mailing

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: But this is an embedded interpreter, and SWIG does not call PyType_Ready() again; the old type is returned instead. Yuk. Perhaps Dave Beazley can give us some insights here? Jan, one possibility would be for Pegasus to stop unloading Python, it seems.

[issue17922] Crash in clear_weakref

2013-05-07 Thread Jan Safranek
Jan Safranek added the comment: Right. But this is an embedded interpreter, and SWIG does not call PyType_Ready() again; the old type is returned instead. Python crashes in Py_Initialize(). SWIG_init() is called right after it. So even if SWIG calls PyType_Ready, it would be too late. Why

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you try the other dbm methods? e.g. has_key(), get()... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926 ___

[issue17922] Crash in clear_weakref

2013-05-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Python remembers SWIG types because SWIG generates code like this: PyTypeObject * SwigPyObject_TypeOnce(void) { static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { // ... initialization code ...

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Forget it, can you just try the following patch? diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c --- a/Modules/dbmmodule.c +++ b/Modules/dbmmodule.c @@ -168,11 +168,13 @@ dbm_contains(register dbmobject *dp, PyObject *v) { datum key, val; +

[issue17927] Argument copied into cell still referenced by frame

2013-05-07 Thread Guido van Rossum
New submission from Guido van Rossum: This came out of some investigations into Tulip reference cycles. I've only confirmed this with 3.3 and 3.4, but I suspect it's a problem in earlier versions too. The scenario is as follows. Consider a object with a method that ends up catching an

[issue17922] Crash in clear_weakref

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Why python remembers SWIG types after Py_Finalize() in the first place? I want to destroy it and start with fresh instance. Because a significant amount of static data inside CPython actually survives Py_Finalize :-/ --

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread David Edelsohn
David Edelsohn added the comment: My example and test_dbm succeeds on Python2.7 with your patch applied. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926 ___

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok. This is a classic example of why a big-endian buildbot is useful :) -- stage: - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926 ___

[issue17917] use PyModule_AddIntMacro() instead of PyModule_AddIntConstant() when applicable

2013-05-07 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: Added file: http://bugs.python.org/file30167/ins_macro-2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17917 ___

[issue17912] thread states should use a doubly-linked list

2013-05-07 Thread Charles-François Natali
Changes by Charles-François Natali cf.nat...@gmail.com: -- keywords: +needs review, patch stage: needs patch - patch review Added file: http://bugs.python.org/file30168/pystate.diff ___ Python tracker rep...@bugs.python.org

[issue16569] Preventing errors of simultaneous access in zipfile

2013-05-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- Removed message: http://bugs.python.org/msg176850 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16569 ___

[issue16569] Preventing errors of simultaneous access in zipfile

2013-05-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- Removed message: http://bugs.python.org/msg176851 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16569 ___

[issue17883] Fix buildbot testing of Tkinter

2013-05-07 Thread Ezio Melotti
Ezio Melotti added the comment: Here's the traceback: http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%202.7/builds/435/steps/test/logs/stdio == ERROR: testLoadWithUNC (test.test_tcl.TclTest)

[issue17928] PowerLinux getargs.c FETCH_SIZE endianness bug

2013-05-07 Thread David Edelsohn
New submission from David Edelsohn: Another endianness bug that causes a failure in test_structmembers.py. _testcapi reports string too long because getargs.c:PyArg_ParseTupleAndKeywords() incorrectly returns a huge value for string_len. The problem is FETCH_ARGS is passing the wrong type to

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think the problem is that the __del__ method fails on Windows, maybe because sys.stdout and sys.__stderr__ have been replaced by None. Consider the following program: import os class C: def __del__(self, write=os.write): write(1,

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: I will try a fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1545463 ___ ___ Python-bugs-list mailing

[issue14191] argparse doesn't allow optionals within positionals

2013-05-07 Thread Glenn Linderman
Glenn Linderman added the comment: Paul, thanks for your continued work. I had reworked your prior patch into a subclass of Argument Parser, and tweaking the code to get parse_intermixed_args to adjust the behaviors I had reported. Now substituting exactly your more flexible new code into my

[issue17927] Argument copied into cell still referenced by frame

2013-05-07 Thread Yuval Greenfield
Changes by Yuval Greenfield ubershme...@gmail.com: -- nosy: +ubershmekel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17927 ___ ___

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Richard Oudkerk
Richard Oudkerk added the comment: On Windows my encoding for stdout, stderr is cp1252 which is implemented in pure python. By the time that _PyGC_DumpShutdownStats() runs the encoding.cp1252 module has been purged so stdout and stderr are broken. I am afraid I will have to leave this to you

[issue17929] TypeError using tarfile.addfile() with io.StringIO replacing StringIO.StringIO()

2013-05-07 Thread Firstname Lastname
New submission from Firstname Lastname: Trying to work with tarfile library and python 3.3 (Ubuntu 13.04 64-bit) While everything works quite well using StringIO.StringIO() and python 2.7.4, the equivalent code with io.StringIO() and python 3.3.1 doesn't. Is that a bug or am I doing something

[issue16584] unhandled IOError filecmp.cmpfiles() if file not readable

2013-05-07 Thread Till Maas
Till Maas added the comment: When might this be patched in Python 2.X? This Exception makes the function pretty useless for me, since it makes by custom compare script crash. -- ___ Python tracker rep...@bugs.python.org

[issue17929] TypeError using tarfile.addfile() with io.StringIO replacing StringIO.StringIO()

2013-05-07 Thread R. David Murray
R. David Murray added the comment: Basic questions like this aren't really suitable for the tracker, you should use other forums such as the python-list mailing list or the #python irc channel. In Python3, bytes and strings are different classes, but in Python2 they are not. You need to be

[issue17929] TypeError using tarfile.addfile() with io.StringIO replacing StringIO.StringIO()

2013-05-07 Thread R. David Murray
R. David Murray added the comment: Bah, I should reread my messages *before* I hit submit. A better phrasing would be questions like this aren't what the tracker is intended to answer, you will get more and better help from... :) (The bytes/string split is the most important thing to

[issue17930] Search not needed in combinations_with_replacement

2013-05-07 Thread Tim Peters
New submission from Tim Peters: Each time thru, CWR searches for the rightmost position not containing the maximum index. But this is wholly determined by what happened the last time thru - search isn't really needed. Here's Python code: def cwr2(iterable, r): pool = tuple(iterable)

[issue17930] Search not needed in combinations_with_replacement

2013-05-07 Thread Tim Peters
Tim Peters added the comment: Oops! Last part should read since the indices vector is non-decreasing, if indices[j] was n-2 then indices[j-1] is also at most n-2 That is, the instances of r-2 in the original should have been n-2. -- ___ Python

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-07 Thread STINNER Victor
New submission from STINNER Victor: The issue #1983 was not fixed on Windows: pid_t is HANDLE on Windows, which is a pointer. SIZEOF_PID_T is not defined in PC/pyconfig.h and so longobject.h takes the default implementation (use C long type): /* Issue #1983: pid_t can be longer than a C long

[issue17870] Python does not provide PyLong_FromIntMax_t() or PyLong_FromUintMax_t() function

2013-05-07 Thread STINNER Victor
STINNER Victor added the comment: @Mark: any opinion on my patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17870 ___ ___ Python-bugs-list

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Your diagnosis seems right about test_garbage_at_shudown (I can reproduce under Linux using `PYTHONIOENCODING=iso8859-15 ./python -m test -v test_gc`). -- ___ Python tracker rep...@bugs.python.org

[issue1545463] New-style classes fail to cleanup attributes

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

[issue17932] Win64: possible integer overflow in iterobject.c

2013-05-07 Thread STINNER Victor
STINNER Victor added the comment: I don't know how to create an iterator object. How can I do that? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17932 ___

[issue17932] Win64: possible integer overflow in iterobject.c

2013-05-07 Thread STINNER Victor
New submission from STINNER Victor: seqiterobject.it_index type is long, whereas iter_setstate() uses a Py_ssize_t. It would be safer to use Py_ssize_t type for seqiterobject.it_index. The issue emits a compiler warning on Windows 64-bit. iterator.__getstate__() was introduced in Python 3.3,

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 53da3bad8554 by Antoine Pitrou in branch '2.7': Issue #17926: Fix dbm.__contains__ on 64-bit big-endian machines. http://hg.python.org/cpython/rev/53da3bad8554 -- nosy: +python-dev ___ Python tracker

[issue17926] PowerLinux dbm failure in 2.7

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed, thank you. -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17926

[issue17928] PowerLinux getargs.c FETCH_SIZE endianness bug

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Is it 2.7-only? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17928 ___ ___ Python-bugs-list mailing list

[issue17928] PowerLinux getargs.c FETCH_SIZE endianness bug

2013-05-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset a199ec80c679 by Antoine Pitrou in branch '2.7': Issue #17928: Fix test_structmembers on 64-bit big-endian machines. http://hg.python.org/cpython/rev/a199ec80c679 -- nosy: +python-dev ___ Python tracker

[issue1545463] New-style classes fail to cleanup attributes

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch, it seems to work on the custom buildbots. The problem was two-fold: - PyErr_Warn() is too high-level, it will invoke linecache and others - encodings and codecs shouldn't be cleared before the final shutdown -- Added file:

[issue17928] PowerLinux getargs.c FETCH_SIZE endianness bug

2013-05-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Fixed. _testcapi was actually the culprit. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17928

[issue17933] test_ftp failure / ftplib error formatting issue

2013-05-07 Thread Antoine Pitrou
New submission from Antoine Pitrou: The following error appeared on some buildbots: http://buildbot.python.org/all/builders/x86%20Gentoo%203.x/builds/4195/steps/test/logs/stdio == ERROR: test_ftp

[issue17931] PyLong_FromPid() is not correctly defined on Windows 64-bit

2013-05-07 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17931 ___ ___ Python-bugs-list

[issue995907] memory leak with threads and enhancement of the timer class

2013-05-07 Thread R. David Murray
R. David Murray added the comment: Review comments added. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue995907 ___ ___

[issue5492] Error on leaving IDLE with quit() or exit() under Linux

2013-05-07 Thread Rajanikanth Jammalamadaka
Changes by Rajanikanth Jammalamadaka rajanika...@gmail.com: -- nosy: +Raj ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5492 ___ ___

[issue1551113] random.choice(setinstance) fails

2013-05-07 Thread wim glenn
wim glenn added the comment: The implementation suggested by the OP def choice(self, seq): Choose a random element from a non-empty sequence. idx = int(self.random() * len(seq)) try: result = seq[idx] # raises IndexError if seq is empty except TypeError:

[issue1551113] random.choice(setinstance) fails

2013-05-07 Thread wim glenn
wim glenn added the comment: How about if isinstance(seq, collections.Sequence): # do it the usual way .. else: return choice(list(seq)) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1551113