[issue17200] telnetlib.read_until() timeout uses the wrong units

2013-02-14 Thread Reuben D'Netto

Reuben D'Netto added the comment:

OK, I've implemented tests for read_until() and expect() using both poll and 
select. I ended up rewriting _read_until_with_select() to look more like the 
poll equivalent in the process, which should hopefully make it more 
maintainable.

--
Added file: http://bugs.python.org/file29076/telnetlib.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-02-14 Thread Brett Cannon

Brett Cannon added the comment:

Python 3.4.0a1 isn't due until August so you have no worries about missing the 
next release. =)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16795] Patch: some changes to AST to make it more useful for static language analysis

2013-02-14 Thread Sven Brauch

Sven Brauch added the comment:

I don't want to push anything, but did you find time to review this yet? It 
would be great to have it in the next release.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17207] string format precision misbehaving

2013-02-14 Thread R. David Murray

R. David Murray added the comment:

You appear to be mixing up % style formatting and 'format' style formatting, 
especially since you seem to be using both in your examples, which is redundant.

Please see http://docs.python.org/2.7/library/string.html#format-string-syntax 
for the explanation of the format method, including the % presentation type.

Your questions will probably be answered better and more thoroughly if you post 
to the python-lits mailing list (the tracker is not a place to get help, I'm 
afraid), but some quick hints:  In Python2.7, 1/10 is 0. In a 'format' format 
string you can get what it sounds like you want by doing this:

  >>> '{:.2f}%'.format(12.6)
  '12.68%'

In % style formatting you would do

  >>> '%.2f%%' % 12.6
  '12.68%'

This is all well documented, but if you can see places it could be clarified, 
please let us know.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17207] string format precision misbehaving

2013-02-14 Thread Martin Mokrejs

New submission from Martin Mokrejs:

Hi,
  I don't know if this is related to issue8040 or not. I find the 2.7 string 
formatting behavior inconsistent. I found out sometimes I have to divide my 
number by 100 so that the percentage values get printed correctly. Somehow, 
when a percent sign appears in the formatting "definition" python magically 
multiplies the number by 100. But sometimes not. This is not specified in 
http://docs.python.org/2/library/stdtypes.html#string-formatting so I really do 
not like this whole thing, sorry to say that.

Some examples, which should have been posted in the Library reference doc above.

$ python
Python 2.7.3 (default, Dec 19 2012, 00:02:12) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> "%s" % 12.77
'12.77'
>>> "%s" % '{:.2%}'.format(12.77)
'1276.67%'
>>> "%s" % '{:.2%}'.format(float(12.77))
'1276.67%'
>>>
>>> "%s" % ( '{:.4%}'.format(12.77) )
'1276.6667%'
>>> "%s" % ( '{:.4}'.format(12.77) )
'12.77'
>>> "%s" % ( '{:.2}'.format(12.77) )
'1.3e+01'
>>> "%s%%" % ( '{:.2}'.format(12.77) )
'1.3e+01%'
>>> "%s%%" % ( '{:.2}'.format('12.77') )
'12%'
>>> "%s%%" % ( '{:.4}'.format(float(12.77)) )
'12.77%'
>>>

>>> "%s" % ( '{:.2%}'.format(1/10) )
'0.00%'
>>> "%s" % ( '{:.2%}'.format(1/10.0) )
'10.00%'
>>> "%s" % ( '{:.2%}'.format(1/10.0 * 100) )
'1000.00%'
>>> "%s" % ( '{:.2%}'.format((1/10.0) * 100) )
'1000.00%'
>>>
>>> "%s" % ( '{:.2}'.format((1/10.0) * 100) )
'1e+01'
>>> "%s" % ( '{:.2%}'.format((1/10.0) * 100) )
'1000.00%'
>>>


1) Would somebody please document the behavior?

2) Would somebody explain how can I print 12.67% (I want precision of 2 places 
after the decimal dot).

3) Why sometimes using float() fixes the behavior (likely converting int() to 
float()?

4) But why does the scientific exponential notation sometimes come out?



5) Finally, it would be nice if the python 2.7 docs contained how to format 
floats to 2 places after the dot using the "old" syntax":

"float=%f" % (12.77)

I would like to get just "12.77" out. I can use round() but that is not what I 
am asking for. I want to change just the formatting of the output:

>>> round(12.77, 2)
12.77
>>> 


Thank you

--
components: ctypes
messages: 182125
nosy: mmokrejs
priority: normal
severity: normal
status: open
title: string format precision misbehaving
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> In any case, I think it's just something we'll have to live with. Daemon
> threads are not a terrific idea in general.

I agree.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> But in Py_Finalize(), call_py_exitfuncs() is called *before*
> _Py_Finalizing is set to a non-NULL value.
> 
> 
> http://hg.python.org/cpython/file/0f827775f7b7/Python/pythonrun.c#l492

Ah, right. But is it any different from, e.g., registering an atexit
handler from a daemon thread?
In any case, I think it's just something we'll have to live with. Daemon
threads are not a terrific idea in general.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14515] tempfile.TemporaryDirectory documented as returning object but returns name

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Aha, now it makes a sense to me.

I don't know which variant will be clear.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14515] tempfile.TemporaryDirectory documented as returning object but returns name

2013-02-14 Thread R. David Murray

R. David Murray added the comment:

The patch is missing the markup for the 'as' keyword (it should read 
:keyword:`as`).  If that were added, would the sentence make sense to you?  
Would it be clearer to say that the directory name is returned by the __enter__ 
method?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11649] startElementNS in xml.sax.saxutils.XMLGenerator ignored encoding

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Already fixed in issue1470548.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14720] sqlite3 microseconds

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can convert_timestamp(val) be implemented as 
datetime.datetime.strptime(val.decode(), '%Y-%m-%d %H:%M:%S.%f')?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17179] Incorrect use of type function in types.new_class

2013-02-14 Thread Daniel Urban

Daniel Urban added the comment:

I don't think this is a bug:

>>> from datetime import datetime
>>> class tdatetime(datetime, foo='bar'):
... pass
... 
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type() takes 1 or 3 arguments
>>>

--
nosy: +daniel.urban

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14515] tempfile.TemporaryDirectory documented as returning object but returns name

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't understand a phrase "and is assigned to the target of the as clause on 
entry to a context". Typo?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11397] os.path.realpath() may produce incorrect results

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Already fixed in issue6975.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17201] Use allowZip64=True by default

2013-02-14 Thread William Mallard

Changes by William Mallard :


Added file: http://bugs.python.org/file29075/zipfile_zip64_by_default.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16893] Create IDLE help.txt from Doc/library/idle.rst

2013-02-14 Thread Zachary Ware

Zachary Ware added the comment:

Ping!

If there are no objections, would anyone mind committing this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17201] Use allowZip64=True by default

2013-02-14 Thread William Mallard

William Mallard added the comment:

See attached. The patch updates ZipFile, its documentation, and its unit tests.

--
keywords: +patch
Added file: http://bugs.python.org/file29074/zipfile_zip64_by_default.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5202] wave.py cannot write wave files into a shell pipeline

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Now, is there some problem if we remove the calls to the "tell" method
> in _write_header ? See patch attached (tests are very welcome too).

Yes, there is a problem. User can pass already open file to wave.open() and 
file position can be not 0 at the start of the WAVE file. But you can do with 
only one tell(). Note a magic number 36 in many places of the code. This is 
struct.calcsize(wave_header_format).

Test is needed as well as a documentation change.

I think this is rather a new feature and should be added only in 3.4. Actually 
the current behavior is documented: "If *file* is a string, open the file by 
that name, otherwise treat it as a seekable file-like object."

--
nosy: +serhiy.storchaka
stage: patch review -> needs patch
type: behavior -> enhancement
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16246] Multiprocessing infinite loop on Windows

2013-02-14 Thread Richard Oudkerk

Changes by Richard Oudkerk :


--
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Won't fix?

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17206] Py_XDECREF() expands its argument multiple times

2013-02-14 Thread Brett Cannon

Brett Cannon added the comment:

On Thu, Feb 14, 2013 at 11:07 AM, Dave Malcolm wrote:

>
> New submission from Dave Malcolm:
>
> When running my refcount static analyzer [1] on a large corpus of
> real-world C extension code for Python, I ran into the following construct
> in various places:
>
> Py_XDECREF(PyObject_CallObject(callable, args));
>

Eww.

>
> This is bogus code: Py_XDECREF expands its argument multiple times, so
> after this goes through the C preprocessor the callable is actually called
> invoked up to 4 times, leaking refs to 3 of the results - assuming that
> none of the calls fail, and a non pydebug build of CPython (which would
> expand the argument more times).
>
> The raw preprocessor output for an optimized Python 2.7 looks like this:
>do { if ((PyObject_CallObject(callable, args)) == ((void *)0)) ; else
> do { if ( --((PyObject*)(PyObject_CallObject(callable, args)))->ob_refcnt
> != 0) ; else ( (*(((PyObject*)((PyObject *)(PyObject_CallObject(callable,
> args->ob_type)->tp_dealloc)((PyObject *)((PyObject
> *)(PyObject_CallObject(callable, args); } while (0); } while (0);
>
> Cleaned up (and removing some of the casts for clarity) it looks like this:
>   do {
> if ((PyObject_CallObject(callable, args)) == ((void *)0))
>   ;
> else
>   do {
> if (--(PyObject_CallObject(callable, args)->ob_refcnt) != 0)
>   ;
> else
>   (*(PyObject_CallObject(callable, args)->ob_type)->tp_dealloc)
> PyObject_CallObject(callable, args);
>   } while (0);
>   } while (0);
> which is clearly not what the extension author was expecting.
>
> Should we:
>   (A) update the macro so that it expands its argument only once, or
>

How expensive is that going to be? Since there is a 'do' statement using a
temp variable would be easy to introduce, but is a compiler going to be
smart enough to inline it all so it doesn't have to waste an allocation,
etc.?

>   (B) warn people not to write code like the above?
>

Only if (A) is too costly. I would modify a checkout for ALL refcount
macros and run the benchmark suite to see if there is a noticeable
difference. If there isn't then I say change all the macros (can't make one
safe and the rest not as that is just asking for inconsistent usage and
trouble).

-Brett

>
> Similar considerations apply to the other macros, I guess, but I've seen
> the above used "in the wild", I haven't yet seen it for the other macros).
>
> Seen in the wild in:
>   python-alsa-1.0.25-1.fc17:
>   pyalsa/alsamixer.c:179
> 00174 | for (i = 0; i < count; i++) {
> 00175 | t = PyTuple_New(2);
> 00176 | if (t) {
> 00177 | PyTuple_SET_ITEM(t, 0,
> PyInt_FromLong(pfd[i].fd));
> 00178 | PyTuple_SET_ITEM(t, 1,
> PyInt_FromLong(pfd[i].events));
> 00179>| Py_XDECREF(PyObject_CallObject(reg, t));
> 00180 | Py_DECREF(t);
> 00181 | }
> 00182 | }
> 00183 |
> 00184 | Py_XDECREF(reg);
>
>   pyalsa/alsahcontrol.c:190
> 00185 | for (i = 0; i < count; i++) {
> 00186 | t = PyTuple_New(2);
> 00187 | if (t) {
> 00188 | PyTuple_SET_ITEM(t, 0,
> PyInt_FromLong(pfd[i].fd));
> 00189 | PyTuple_SET_ITEM(t, 1,
> PyInt_FromLong(pfd[i].events));
> 00190>| Py_XDECREF(PyObject_CallObject(reg, t));
> 00191 | Py_DECREF(t);
> 00192 | }
> 00193 | }
> 00194 |
> 00195 | Py_XDECREF(reg);
>
>   pyalsa/alsaseq.c:3277
> 03272 | for (i = 0; i < count; i++) {
> 03273 | t = PyTuple_New(2);
> 03274 | if (t) {
> 03275 | PyTuple_SET_ITEM(t, 0, PyInt_FromLong(pfd[i].fd));
> 03276 | PyTuple_SET_ITEM(t, 1,
> PyInt_FromLong(pfd[i].events));
> 03277>| Py_XDECREF(PyObject_CallObject(reg, t));
> 03278 | Py_DECREF(t);
> 03279 | }
> 03280 | }
> 03281 |
> 03282 | Py_XDECREF(reg);
>
>  python-4Suite-XML-1.0.2-14.fc17:
>   Ft/Xml/src/domlette/refcounts.c:80
> 00075 | /* refcount = this */
> 00076 | expected = 1;
> 00077 |   }
> 00078 |   else {
> 00079 | sprintf(buf, "Unexpected object type '%.200s'"
> ,node->ob_type->tp_name);
> 00080>| Py_XDECREF(PyObject_CallMethod(tester, "error", "s", buf));
> 00081 | return 0;
> 00082 |   }
> 00083 |
> 00084 |   sprintf(buf, "%.200s refcounts", node->ob_type->tp_name);
> 00085 |   return do_test(tester, buf, expected, node->ob_refcnt);
>
>
> [Note to self: I actually saw this because it uncovered a traceback in
> cpychecker, which I fixed as:
>
> http://git.fedorahosted.org/cgit/gcc-python-plugin.git/commit/?id=99fa820487e380b74c2eda1d97facdf2ee6d2f3a]
>
>
> [1] https://gcc-python-plugin.readthe

[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, I shouldn't close this until this dangerous feature will be deprecated.

--
assignee: serhiy.storchaka -> 
resolution: fixed -> 
stage: committed/rejected -> needs patch
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17205] In the help() function the order of methods changes

2013-02-14 Thread R. David Murray

R. David Murray added the comment:

Ramchandra is correct.  If you were to implement a "don't sort" flag, what you 
would get is *random* order (and a different order each time, in 3.3+).

Further, this is Python-interpreter internal data structure we are talking 
about, so it isn't even an option to use OrderedDict in pydoc.

I'm closing this as "won't fix" because it would certainly be nice to have this 
ability...but there is no practical way to implement it.

--
nosy: +r.david.murray
resolution:  -> wont fix
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FreeBSD 6.4 and Windows test failures was fixed in changesets 8fb98fb758e8 and 
ec70abe8c886.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17206] Py_XDECREF() expands its argument multiple times

2013-02-14 Thread Dave Malcolm

New submission from Dave Malcolm:

When running my refcount static analyzer [1] on a large corpus of real-world C 
extension code for Python, I ran into the following construct in various places:

Py_XDECREF(PyObject_CallObject(callable, args));

This is bogus code: Py_XDECREF expands its argument multiple times, so after 
this goes through the C preprocessor the callable is actually called invoked up 
to 4 times, leaking refs to 3 of the results - assuming that none of the calls 
fail, and a non pydebug build of CPython (which would expand the argument more 
times).

The raw preprocessor output for an optimized Python 2.7 looks like this:
   do { if ((PyObject_CallObject(callable, args)) == ((void *)0)) ; else do { 
if ( --((PyObject*)(PyObject_CallObject(callable, args)))->ob_refcnt != 0) ; 
else ( (*(((PyObject*)((PyObject *)(PyObject_CallObject(callable, 
args->ob_type)->tp_dealloc)((PyObject *)((PyObject 
*)(PyObject_CallObject(callable, args); } while (0); } while (0);

Cleaned up (and removing some of the casts for clarity) it looks like this:
  do { 
if ((PyObject_CallObject(callable, args)) == ((void *)0))
  ; 
else 
  do {
if (--(PyObject_CallObject(callable, args)->ob_refcnt) != 0)
  ;
else
  (*(PyObject_CallObject(callable, args)->ob_type)->tp_dealloc)
PyObject_CallObject(callable, args);
  } while (0);
  } while (0);
which is clearly not what the extension author was expecting.

Should we:
  (A) update the macro so that it expands its argument only once, or
  (B) warn people not to write code like the above?

Similar considerations apply to the other macros, I guess, but I've seen the 
above used "in the wild", I haven't yet seen it for the other macros).

Seen in the wild in:
  python-alsa-1.0.25-1.fc17:
  pyalsa/alsamixer.c:179
00174 | for (i = 0; i < count; i++) { 
00175 | t = PyTuple_New(2); 
00176 | if (t) { 
00177 | PyTuple_SET_ITEM(t, 0, 
PyInt_FromLong(pfd[i].fd)); 
00178 | PyTuple_SET_ITEM(t, 1, 
PyInt_FromLong(pfd[i].events)); 
00179>| Py_XDECREF(PyObject_CallObject(reg, t)); 
00180 | Py_DECREF(t); 
00181 | } 
00182 | }
00183 |  
00184 | Py_XDECREF(reg); 

  pyalsa/alsahcontrol.c:190
00185 | for (i = 0; i < count; i++) { 
00186 | t = PyTuple_New(2); 
00187 | if (t) { 
00188 | PyTuple_SET_ITEM(t, 0, 
PyInt_FromLong(pfd[i].fd)); 
00189 | PyTuple_SET_ITEM(t, 1, 
PyInt_FromLong(pfd[i].events)); 
00190>| Py_XDECREF(PyObject_CallObject(reg, t)); 
00191 | Py_DECREF(t); 
00192 | } 
00193 | }
00194 |  
00195 | Py_XDECREF(reg); 

  pyalsa/alsaseq.c:3277
03272 | for (i = 0; i < count; i++) { 
03273 | t = PyTuple_New(2); 
03274 | if (t) { 
03275 | PyTuple_SET_ITEM(t, 0, PyInt_FromLong(pfd[i].fd)); 
03276 | PyTuple_SET_ITEM(t, 1, PyInt_FromLong(pfd[i].events)); 
03277>| Py_XDECREF(PyObject_CallObject(reg, t)); 
03278 | Py_DECREF(t); 
03279 | } 
03280 | } 
03281 |  
03282 | Py_XDECREF(reg); 

 python-4Suite-XML-1.0.2-14.fc17:
  Ft/Xml/src/domlette/refcounts.c:80
00075 | /* refcount = this */ 
00076 | expected = 1; 
00077 |   } 
00078 |   else { 
00079 | sprintf(buf, "Unexpected object type '%.200s'" 
,node->ob_type->tp_name); 
00080>| Py_XDECREF(PyObject_CallMethod(tester, "error", "s", buf)); 
00081 | return 0; 
00082 |   } 
00083 |  
00084 |   sprintf(buf, "%.200s refcounts", node->ob_type->tp_name); 
00085 |   return do_test(tester, buf, expected, node->ob_refcnt); 


[Note to self: I actually saw this because it uncovered a traceback in 
cpychecker, which I fixed as:
http://git.fedorahosted.org/cgit/gcc-python-plugin.git/commit/?id=99fa820487e380b74c2eda1d97facdf2ee6d2f3a
 ]


[1] https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html

--
components: Interpreter Core
messages: 182107
nosy: dmalcolm
priority: normal
severity: normal
status: open
title: Py_XDECREF() expands its argument multiple times
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13153] IDLE crashes when pasting non-BMP unicode char on Py3

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11837] smtplib._quote_periods triggers spurious type error in re.sub

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Already fixed in issue12283.

--
components: +email
nosy: +barry, r.david.murray, serhiy.storchaka
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> python3.2 smtplib _quote_periods
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11048] "import ctypes" causes segfault on read-only filesystem

2013-02-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> test needed
versions: +Python 3.4 -Python 2.6, Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Richard Oudkerk

Richard Oudkerk added the comment:

On 14/02/2013 3:16pm, Antoine Pitrou wrote:
> Mmmh... thread switching is already blocked at shutdown:
> http://hg.python.org/cpython/file/0f827775f7b7/Python/ceval.c#l434

But in Py_Finalize(), call_py_exitfuncs() is called *before* _Py_Finalizing is 
set to a non-NULL value.

http://hg.python.org/cpython/file/0f827775f7b7/Python/pythonrun.c#l492

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13461] Error on test_issue_1395_5 with Python 2.7 and VS2010

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ageed, it's probably easy enough.

--
stage:  -> needs patch
versions: +Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13461] Error on test_issue_1395_5 with Python 2.7 and VS2010

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Can we fix this easy issue before 2.7.4 release?

--
keywords: +easy
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17201] Use allowZip64=True by default

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

+1. Let's make it for 3.4.

--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17179] Incorrect use of type function in types.new_class

2013-02-14 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Is it necessary/desirable to allow daemon threads to run during
> shutdown.  Maybe blocking thread switching at shutdown could cause
> deadlocks?

Mmmh... thread switching is already blocked at shutdown:
http://hg.python.org/cpython/file/0f827775f7b7/Python/ceval.c#l434

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Eric, do you want to commit?

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy:  -Ronald.Chapman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
hgrepos:  -174

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg182097

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17103] ampersand "&" in path prevents compilation of Python

2013-02-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Ronald Chapman

Ronald Chapman added the comment:

Islamabad l guythen vkd dudziozl

--
hgrepos: +174
nosy: +Ronald.Chapman

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17160] test_urllib2net fails

2013-02-14 Thread Ezio Melotti

Ezio Melotti added the comment:

See also #16969.

--
nosy: +ezio.melotti
resolution: out of date -> duplicate
superseder:  -> test_urlwithfrag fail
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17143] trace.py uses _warn without importing it

2013-02-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17135] imp doc should direct to importlib

2013-02-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
nosy: +brett.cannon
stage:  -> needs patch
type:  -> enhancement
versions: +Python 2.7 -Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17205] In the help() function the order of methods changes

2013-02-14 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Sorry, but there is no way of telling the order as methods are respresented 
internally as a dictionary. Please close this as invalid.

--
nosy: +ramchandra.apte

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16278] os.rename documentation slightly inaccurate

2013-02-14 Thread Todd Rovito

Todd Rovito added the comment:

Thanks Terry and Chris you guys have supplied great feedback.  I will work on 
the issue and try to get a new patch updated by end of the weekend (2/18/13).

Sent from my iPhone

On Feb 13, 2013, at 11:56 PM, "Terry J. Reedy"  wrote:

> 
> Terry J. Reedy added the comment:
> 
> "directory name.Yet a" needs spaces after '.'.
> 
> The text is decent English and clear enough sentence by sentence, but the 
> reality and hence the text as a whole is confusing.
> 
> I wonder if it would be possible to make a little table
> 
>dest
>   
> Src file empty-dirnon-empty-dir
> -
> file |||
> 
> dir
> 
> with the behavior for each combination indicated, 'success' or 'OSError', 
> with two lines prefixed with Unix, Win where they differ. Then the 
> differences would be much more obvious.
> 
> (A separate issue: Patch says that Windows currently raises a different error 
> in one situation. I think it would be better -- in a future version -- if 
> that were caught and reraised as OSError also.)
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16043] xmlrpc: gzip_decode has unlimited read()

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think instead of global variable it will be better to add an optional 
parameter for gzip_decode() (with a sane default value) and related functions. 
Or at least in additional to it.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> Richard, do you still want to push this forward? Otherwise I'd like to 
> finalize the patch (in the other sense ;-).

I started to worry a bit about daemon threads.  I think they can still run 
while atexit functions are being run.*  So if a daemon thread creates an atexit 
finalizer during shutdown it may never be run.

I am not sure how much to worry about this potential race.  Maybe a lock could 
be used to cause any daemon threads which try to create finalizers to block.

* Is it necessary/desirable to allow daemon threads to run during shutdown.  
Maybe blocking thread switching at shutdown could cause deadlocks?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1285086] urllib.quote is too slow

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Serhiy: One question. Is there a need to have  -
>
> + append = res.append
>
> And then use 'append'?

This speed up unquote_to_bytes by 15%.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12641] Remove -mno-cygwin from distutils

2013-02-14 Thread Martin v . Löwis

Martin v. Löwis added the comment:

doko: this issue is about Windows; autoconf is not being used here (plus the 
"correct" compiler would be MSC).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And here is a patch which uses __index__ for uid and gid conversion. 
decimal.Decimal should be added to the list of wrong types in the test.

I'm not sure about the last patch, whether to consider it as a bugfix or as a 
new feature?

--
nosy: +skrah
versions: +Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file29073/posix_uid_gid_conv_index.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15301] os.chown: OverflowError: Python int too large to convert to C long

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Similar test was committed for issue4591 and it fixes this issue. There are 
only two differences with Larry's patch: tests and handling of non-integers.

Here is a patch based on Larry's patch which extends tests for *chown().

--
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file29072/posix_uid_gid_conv_tests.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16043] xmlrpc: gzip_decode has unlimited read()

2013-02-14 Thread Christian Heimes

Christian Heimes added the comment:

IMHO the patch should also limit the maximum amount of read bytes in 
Transport.parse_response(). Do you agree?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17205] In the help() function the order of methods changes

2013-02-14 Thread py.user

New submission from py.user:

>>> class A:
...   '''class'''
...   def c(self):
... '''c doc'''
... pass
...   def b(self):
... '''b doc'''
... pass
...   def a(self):
... '''a doc'''
... pass
... 
>>> help(A)

class A(builtins.object)
 |  class
 |  
 |  Methods defined here:
 |  
 |  a(self)
 |  a doc
 |  
 |  b(self)
 |  b doc
 |  
 |  c(self)
 |  c doc
 |  
 

When I have many methods ordered in the source in readable order, the help() 
function is mixing them, so the last method goes to the top and the first 
method goes to the bottom.

I would like to have an option, whether I want sort them or not.

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 182086
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In the help() function the order of methods changes
type: enhancement
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7365] grp and pwd should treat uid and gid as unsigned

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed by patch for issue4591.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> 32-bits unsigned user/group identifier

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I agree with Stefan that the file is a lot more readable if the 
> docstring
> is not repeated twice.

Couldn't the generated C docstring end up in a separate file? It's only a 
constant after all.
It seems to me that one reason we don't give much love to C docstrings is
that they're painful to edit, compared to Python docstrings.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15528] Better support for finalization with weakrefs

2013-02-14 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Richard, do you still want to push this forward? Otherwise I'd like to finalize 
the patch (in the other sense ;-).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2005] posixmodule expects sizeof(pid_t/gid_t/uid_t) <= sizeof(long)

2013-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Auxiliary conversion functions for uid_t and gid_t was added in issue4591. They 
are supports unsigned types not larger than unsigned long.

If someone need the support of the platform with signed uid_t/gid_t or with 
uid_t/gid_t larger than long (I don't know such modern platforms), here's the 
patch.

--
dependencies: +32-bits unsigned user/group identifier

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2005] posixmodule expects sizeof(pid_t/gid_t/uid_t) <= sizeof(long)

2013-02-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: 
http://bugs.python.org/file29071/posix_uid_gid_conv_signed_long_long.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4591] 32-bits unsigned user/group identifier

2013-02-14 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com