[issue14409] IDLE does not execute any commands (command prompt works fine!)

2012-03-26 Thread Roger Serwy

Roger Serwy  added the comment:

Hi Ankit,

It looks like your configuration files for IDLE has a bug. Can you try renaming 
your .idlerc directory (likely located in your home directory) to something 
else and then retry using IDLE?

Also, can you post your existing config-main.cfg and config-keys.cfg? This may 
help in making IDLE more robust against this error in the future.

--
nosy: +serwy

___
Python tracker 

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



[issue14410] argparse typo

2012-03-26 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

typo fix

--
assignee: docs@python
components: Documentation
files: typo.patch
keywords: patch
messages: 156801
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: argparse typo
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file25024/typo.patch

___
Python tracker 

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



[issue14411] outdatedness on rlcompleter docstring

2012-03-26 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

This text appeared in Lib/rlcompleter.py in 1997, so ought to be outdated:

"This requires the latest extension to the readline module..."

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 156802
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: outdatedness on rlcompleter docstring
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



[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I've just started looking at this.  Nice job and good attention to detail on 
the error checking.  Expect to have a few high-level suggestions and a ton of 
minor edits.

Here are a couple of quick thoughts:
* The comment style needs to switch to the /* style */
* Use the pure python _cache_info by looking it up on the module object.
* I had expected PyList objects rather than links between C structs (following 
the pure python lru_cache as closely as possible).

--

___
Python tracker 

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



[issue14399] zipfile and creat/update comment

2012-03-26 Thread Cassaigne

Cassaigne  added the comment:

Tanks à lot. To complete Information about this bug.

it up and take a look.  The relevant code is in Python, and I'm guessing
there is some logic bug when only the comment is set (and nothing is added
to the zipfile), but I haven't looked at the code.  I'm also adding 3.2 and
3.3; it fails on 3.3 as well.
>
> --
> keywords: +easy
> nosy: +r.david.murray
> stage:  -> needs patch
> versions: +Python 3.2, Python 3.3
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I don't quite understand what you're saying about line mismatch Victor.
Anyway, if you look at it, it is clear that:
1) sys_update_path() can be called with argc==0 (main.c line 647)
2) 1742 was always setting arg0 to argv[0] that is undefined and this access 
may cause a crash if 1) above is true
3) line 1812 assumes n to be equal to the length of arg0, but depending on 
conditional compilation, it may not get set at all, and in any case, in line 
line 1805 it gets set only if p is not NULL.

I think it is simply safer to make the proper assumptions.

--

___
Python tracker 

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



[issue14408] Support the test_cases protocol in the stdlib tests

2012-03-26 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +michael.foord

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

It's the line argv0 = argv[0] in sys_update_path(). The copies of
argv made in python.c aren't NULL terminated. Kristján's patch
worked around that (and fixes the problem), but I'd prefer to
make a full copy of argv in python.c.

Could one of you look at the patch? I didn't check if there are other
problems in sys_update_path() that Kristján's patch addressed.

--
Added file: http://bugs.python.org/file25025/argv-alloc.diff

___
Python tracker 

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



[issue14379] Several traceback docs improvements

2012-03-26 Thread R. David Murray

Changes by R. David Murray :


--
type:  -> enhancement

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

> 3) line 1812 assumes n to be equal to the length of arg0, but depending >
> on conditional compilation, it may not get set at all, and in any>
> case in line line 1805 it gets set only if p is not NULL.

n is initialized to 0 when its declared. I think it's deliberate
to call a = PyUnicode_FromWideChar(argv0, 0) in order to insert
an empty path.

--

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner

Matt Joiner  added the comment:

I've fixed the commenting, and cache_info use.

I've left the element management in pure C as it reduces memory use (56 bytes 
for 4 element list, vs. 16 for lru_cache_elem), and avoids ref counting 
overhead (3 refs per link, plus GC). The difference might become quite marked 
for very large caches. There's also a nice invariant that links the key to the 
cache dict, and the result object to the lru_cache_elem. I'm happy to change 
this if it doesn't matter.

My only concern now is the wrapping of the lru cache object. In the Python 
version, @wraps allows the lru_cache to masquerade as the wrapped function wrt 
str/repr. The C version is wrapped, but str/repr remain unchanged. Not sure if 
this is a problem.

--
Added file: http://bugs.python.org/file25026/functools.lru_cache-in-c.patch

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2012-03-26 Thread Matt Joiner

Changes by Matt Joiner :


Removed file: http://bugs.python.org/file24958/functools.lru_cache-in-c

___
Python tracker 

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



[issue14412] Sqlite Integer Fields

2012-03-26 Thread Mendez

New submission from Mendez :

There appears to be a problem with the handling of integer fields in SQLite in 
the 32-bit release candidate for 2.7.3.

I'm running the 64-bit version of Windows 7.

I've attached a script which reproduces the issue. The following are the 
results I get with different versions of Python, with the later two being as 
expected.

Python - 2.7.3 rc2 - 32-bit:
R:\>c:\python27\python "C:\Temp\sqltest.py"
530428456761032704 

Python - 2.7.2 - 32-bit:
R:\>c:\python27\python "C:\Temp\sqltest.py"
12349 

Python - 2.7.2 rc2 - 64-bit:
R:\>c:\python27_64\python c:\temp\sqltest.py
12349 

I wonder if this might be related to the changes in #8033.

--
files: sqltest.py
messages: 156809
nosy: goatsofmendez
priority: normal
severity: normal
status: open
title: Sqlite Integer Fields
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file25027/sqltest.py

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread STINNER Victor

STINNER Victor  added the comment:

Kristján's patch is wrong: n should be set to 0 even if argc > 0. The
patch is also useless with argv-alloc.diff.

@Stefan: Your patch is correct and solves the issue. You can commit it
to 2.7, 3.2 and 3.3.

--

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I'm sure you didn't intend to use words such as "wrong" and "useless" Victor.  
Perhaps n must be 0 even for argc>0, but I did that as an afterthought. Which 
is the reason I asked you to take a look rather than committing this right away.

Please allow me to point out that relying on an extra NULL pointer at the end 
of argv is dangerous.  C makes no such guarantees with main() and you are 
coupling implementation details betweeen layers using this.  The "correct" 
thing to do is to simply not dereference argv at argc or beyond.

--

___
Python tracker 

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



[issue14412] Sqlite Integer Fields

2012-03-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can't reproduce under Linux. Can someone test under Windows?

--
components: +Library (Lib)
nosy: +benjamin.peterson, brian.curtin, pitrou, tim.golden
priority: normal -> release blocker

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

I only have the C99 standard. It says [5.1.2.2.1]:

  - argv[argc] shall be a NULL pointer.

Is this different in C89?

Also, my patch terminates the *copies* of argv, not argv itself.

--

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

K&R page 115 also says: The standard requires that argv[argc] be a NULL pointer.
So it must be in C89 as well.

--

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread STINNER Victor

STINNER Victor  added the comment:

New patch replacing dictproxy() builtin type with collections.mappingview() 
type:

 - dictproxy() type doesn't need to be a builtin type
 - it is not specific to dict so replace "dict" prefix with "mapping"
 - "view" is a better suffix than "proxy" to indicate that it is a read-only 
proxy
 - IMO collections is the best place for new containers

I don't understand how collections types are called: should it be MappingView 
or mappingview?

The code of mappingview is just moved to _collectionsmodule.c to avoid the 
creation of two short files. PyDictProxy_Type and PyDictProxy_New() are kept 
and still declared in descrobject.h for backward compatibility.

I fixed the doc to indicate that mappingview methods operate on the *underlying 
mapping*.

I also added test_views() test.

TODO:

 - mappingview() constructor only accepts dict: it should accept any mapping
 - mappingview.copy() creates a dict, it should create a new object of the same 
type than the underlying mapping

--
Added file: http://bugs.python.org/file25028/mappingview-3.patch

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread STINNER Victor

STINNER Victor  added the comment:

> I'm sure you didn't intend to use words such as "wrong" and "useless" Victor. 
>  Perhaps n must be 0 even for argc>0, but I did that as an afterthought.

If n is initialized as wcslen(argv[0]), test_cmd_line_script fails.

--

___
Python tracker 

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



[issue14412] Sqlite Integer Fields

2012-03-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can't reproduce on a 2.7 debug build under Windows either.
Some data points:

>>> hex(530428456761032704)
'0x75c75df'
>>> hex(12349)
'0x75c75df'

Looking at #8033, it seems unlikely to have caused this problem.
Perhaps we shipped the 2.7.3 rc with a buggy SQLite build?

Can you (or someone else) check the 2.6, 3.1 and 3.2 release candidates as well?

--
nosy: +loewis, petri.lehtinen

___
Python tracker 

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



[issue14412] Sqlite Integer Fields

2012-03-26 Thread Mendez

Mendez  added the comment:

I've tried the 32-bit version of 3.2.3rc2 and that works as expected.

There don't seem to be Windows builds of 2.6 and 3.1 available so I haven't 
been able to try those.

--

___
Python tracker 

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



[issue14404] multiprocessing with maxtasksperchild: bug in control logic?

2012-03-26 Thread Jesse Noller

Changes by Jesse Noller :


--
nosy: +asksol, jnoller

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c0900fd6e4b3 by Stefan Krah in branch '3.2':
Issue #3367: NULL-terminate argv[] copies to prevent an invalid access
http://hg.python.org/cpython/rev/c0900fd6e4b3

New changeset 1ab8fa2277d9 by Stefan Krah in branch 'default':
Issue #3367: Merge fix from 3.2.
http://hg.python.org/cpython/rev/1ab8fa2277d9

--
nosy: +python-dev

___
Python tracker 

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



[issue14404] multiprocessing with maxtasksperchild: bug in control logic?

2012-03-26 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Sorry if I missed something, didn't RTFM etc.

You didn't: it's a duplicate of #10332 (which has already been fixed).

--
nosy: +neologix
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> Multiprocessing maxtasksperchild results in hang

___
Python tracker 

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



[issue1053687] PyOS_InputHook not called in IDLE subprocess

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
versions: +Python 3.3 -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



[issue3367] Uninitialized value read in parsetok.c

2012-03-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

You are right, Stefan, argv[argc] is defined to be NULL by the standard.  Jolly 
good.

--

___
Python tracker 

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



[issue14228] It is impossible to catch sigint on startup in python code

2012-03-26 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Why an environment variable instead of a command line switch (as
> suggested by Ian Jackson)? Shouldn't a script be able to decide for
> itself how it handles signals?

Because the available space for command line switches is rather limited, and 
this isn't an important option.

This issue applies only to POSIX systems AFAIK, and it's easy to force an env 
var when running an executable ("MYENVVAR=foo python ...").

--

___
Python tracker 

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



[issue14413] whatsnew deprecation tweak

2012-03-26 Thread Jim Jewett

New submission from Jim Jewett :

http://www.python.org/~gbrandl/build/html2/whatsnew/3.3.html#pep-393-flexible-string-representation

"The packaging module replaces the distutils module"

All other deprecation messages list the deprecated object first, such as 
"platform.popen(): use the subprocess module."  I would therefore suggest 
rewording this as 

"distutils module:  Use the packaging module."

--
messages: 156823
nosy: Jim.Jewett
priority: normal
severity: normal
status: open
title: whatsnew deprecation tweak

___
Python tracker 

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



[issue9609] make cProfile multi-stack aware

2012-03-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I've presented the patch, but no one has voiced an opinion on it.

--

___
Python tracker 

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



[issue14087] multiprocessing.Condition.wait_for missing

2012-03-26 Thread Charles-François Natali

Changes by Charles-François Natali :


--
nosy: +pitrou
stage:  -> commit review

___
Python tracker 

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



[issue14381] Intern certain integral floats for memory savings and performance

2012-03-26 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Why do you think it isn't safe, Antoine?
We only support IEEE platforms, and IEEE defines positive 0.0 to be all bits 
cleared.

I personally don't think that even a small measurable performance degradation 
in creating new floats is problematic since that is not where typical cpu power 
is spent.  But this is the second time I´ve made this suggestion (the first was 
on python-dev) and in both cases I've run up against the opinion that it is a 
"rare" problem and worries about "performance."  Yet this seemed not to be an 
issue when ints/longs were united.

So, while I was recently prompted to resubmit this suggestion, I feel no  need 
to push the matter further and am just letting it rest here, then.  I'm sure 
someone will think it is a good idea again in the future and can then reopen it.

--
resolution:  -> 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



[issue11826] Leak in atexitmodule

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

Actually _iomodule.c already has a freefunc with the same signature.
atexit_free() is properly called in:

static void
module_dealloc(PyModuleObject *m)
{
PyObject_GC_UnTrack(m);
if (m->md_def && m->md_def->m_free)
m->md_def->m_free(m);
if (m->md_dict != NULL) {
_PyModule_Clear((PyObject *)m);
Py_DECREF(m->md_dict);
}
if (m->md_state != NULL)
PyMem_FREE(m->md_state);
Py_TYPE(m)->tp_free((PyObject *)m);
}


So my only worry is if there's a way to exploit the fact that _PyModule_Clear()
is called after atexit_free(). I tried things like: 

>>> import atexit
>>> def g(): pass
...
>>> class silly:
... def __del__(self): atexit.register(g)
...
>>> atexit.x = silly()
>>> atexit.register(g)

>>>
Exception AttributeError: "'NoneType' object has no attribute 'register'" in 
> ignored


But I haven't been able to break anything, so I think I'll go ahead and
commit if there aren't any protests.

--

___
Python tracker 

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



[issue14404] multiprocessing with maxtasksperchild: bug in control logic?

2012-03-26 Thread ranga

ranga  added the comment:

Thanks for the quick response, neologix. I copied the multiprocessing/ 
directory from latest cpython's 2.7 branch into my project dir and it works as 
advertised now!

--

___
Python tracker 

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



[issue14414] xmlrpclib leaves connection in broken state if server returns error without content-length

2012-03-26 Thread Joachim Bauch

New submission from Joachim Bauch :

If a XML-RPC server returns an error page without a content-length header (for 
example with "transfer-encoding: chunked" instead), the method "single_request" 
in xmlrpclib doesn't read the response before raising a ProtocolError.
If this happens and the http connection is reused, the response is in a broken 
state and the next request will trigger a ResponseNotReady exception in httplib.

Possible solutions would be to explicitly close the response before raising the 
ProtocolError or read the response for chunked encoding.

--
components: Library (Lib)
messages: 156828
nosy: fancycode
priority: normal
severity: normal
status: open
title: xmlrpclib leaves connection in broken state if server returns error 
without content-length
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



[issue14410] argparse typo

2012-03-26 Thread Jim Jewett

Jim Jewett  added the comment:

Patch is doc-only, and looks good to me.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue786827] IDLE starts with no menus (Cygwin)

2012-03-26 Thread Jason Tishler

Jason Tishler  added the comment:

AFAICT, this issue is resolved in the latest Cygwin Python package (i.e., 
2.6.7-1) that is built against a X11-based Tcl/Tk instead of a Win32 GDI 
version:

http://cygwin.com/ml/cygwin-announce/2012-02/msg00014.html

--

___
Python tracker 

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



[issue786827] IDLE starts with no menus (Cygwin)

2012-03-26 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

I like to close the issue if problem has been solved by cygwin itself.

--

___
Python tracker 

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



[issue786827] IDLE starts with no menus (Cygwin)

2012-03-26 Thread Jason Tishler

Jason Tishler  added the comment:

Please do.

When I tested the Cygwin Python 2.6.7-1 release, IDLE was one of my testcases. 
In my limited testing (I'm not a regular IDLE user), the menus appeared to 
function properly.

--

___
Python tracker 

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



[issue14415] ValueError: I/O operation on closed file

2012-03-26 Thread thao nguyen

New submission from thao nguyen :

Dear Support Team,

I have built a function (enclosed here) to merge many files (in this example is 
2 files: "a1.txt" and "a2.txt") lines by lines. The output file is called 
"final_file". However, i could not have it run successfully.

Content of "a1.txt":
1
3
5


Content of "a2.txt":
2
4
6


Content of "final_file.txt" will be like:
1
2
3
4
5
6


In Python, i called just written module:

import argument
reload(argument)
argument.test(2,"C:/a1.txt","C:/a2.txt")

and get the error as below: 
 "ValueError: I/O operation on closed file
  File "c:\append.py", line 5, in 
  argument.test(2,"C:/a1.txt","C:/a2.txt")
  File "c:\argument.py", line 28, in test
 for line_data in f:"

Could you please advise the resolution for this?


Thank you

--
components: None
files: argument.py
messages: 156833
nosy: thaonphuong
priority: normal
severity: normal
status: open
title: ValueError: I/O operation on closed file
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file25029/argument.py

___
Python tracker 

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



[issue14415] ValueError: I/O operation on closed file

2012-03-26 Thread thao nguyen

Changes by thao nguyen :


Removed file: http://bugs.python.org/file25029/argument.py

___
Python tracker 

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



[issue14415] ValueError: I/O operation on closed file

2012-03-26 Thread thao nguyen

Changes by thao nguyen :


Added file: http://bugs.python.org/file25030/argument.py

___
Python tracker 

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



[issue786827] IDLE starts with no menus (Cygwin)

2012-03-26 Thread R. David Murray

Changes by R. David Murray :


--
nosy:  -smccardell

___
Python tracker 

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



[issue14228] It is impossible to catch sigint on startup in python code

2012-03-26 Thread poq

poq  added the comment:

> Because the available space for command line switches is rather limited

Limited by what?

> "MYENVVAR=foo python ..."

That does not work with hashbangs (and env is kludgey).

--

___
Python tracker 

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



[issue14415] ValueError: I/O operation on closed file

2012-03-26 Thread R. David Murray

R. David Murray  added the comment:

The bug tracker is not a good place to get programming help.  Please try the 
python-tutors list, or the general python-list (see mail.python.org for a list 
of mailing lists).  There will be people on one of those lists with time to 
help you out.

--
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



[issue14413] whatsnew deprecation tweak

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c407db9120e9 by R David Murray in branch 'default':
#14413: tweak word order in deprecation section
http://hg.python.org/cpython/rev/c407db9120e9

--
nosy: +python-dev

___
Python tracker 

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



[issue14413] whatsnew deprecation tweak

2012-03-26 Thread R. David Murray

R. David Murray  added the comment:

Somebody (Raymond?) is going to go through and edit for style and consistency 
before the release.  But I applied your tweak anyway.

--
nosy: +r.david.murray
resolution:  -> fixed
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



[issue7635] 19.6 xml.dom.pulldom doc: stub?

2012-03-26 Thread R. David Murray

R. David Murray  added the comment:

Looks like someone else noticed the problem, but did not notice that there was 
an existing issue with a patch :(.

Sorry about that, Mark.  Thanks very much for working on this, and I'm very 
sorry it got lost.  Hopefully Eli will review your patch and see if there is 
anything to adopt from it to add to the stuff he already checked in on issue 
14202.

--
nosy: +eli.bendersky, r.david.murray
resolution:  -> out of date
stage: patch review -> committed/rejected
status: open -> closed
superseder:  -> The docs of xml.dom.pulldom are almost nonexistent

___
Python tracker 

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



[issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

2012-03-26 Thread David Manowitz

David Manowitz  added the comment:

I have a couple of issues with that argument:

1.) Until fairly recently, the fact that sys.exit() when called from a
non-primary thread only causes the thread to die, was not clearly
documented (and still isn't in the python2.6 docs).  Admittedly,
thread.exit() does say that it raises the SystemExit exception, but as most
people are encouraged to use the *threading* module, rather than the
*thread* module directly, this is still fairly obscure.

2.) A ThreadExit exception could be derived from the SystemExit exception,
so existing code that works by catching a SystemExit exception would still
work.

--David

On Sat, Mar 24, 2012 at 6:47 AM, Antoine Pitrou wrote:

>
> Antoine Pitrou  added the comment:
>
> > I don't see why this should be considered acceptable behavior.  Why
> > don't threads have their own ThreadExit exception, rather than
> > overloading the use, and therefore, the meaning, of the SystemExit
> > exception?  As indicated by their names, sys.exit and the SystemExit
> > exception should *only* be used to exit the entire system, not just a
> > thread!
>
> I agree the situation isn't optimal. However, fixing this would also break
> compatibility with any application that uses sys.exit() in a thread and
> expects it to exit the thread, not the whole process. So we're kind of
> stuck with it.
>
> --
> nosy: +pitrou
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue14410] argparse typo

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 03771ea22ead by Sandro Tosi in branch '2.7':
Issue #14410: fix typo in argparse doc; patch by Tshepang Lekhonkhobe
http://hg.python.org/cpython/rev/03771ea22ead

New changeset 3e18af617266 by Sandro Tosi in branch '3.2':
Issue #14410: fix typo in argparse doc; patch by Tshepang Lekhonkhobe
http://hg.python.org/cpython/rev/3e18af617266

New changeset 4691f8a57db0 by Sandro Tosi in branch 'default':
Issue #14410: merge with 3.2
http://hg.python.org/cpython/rev/4691f8a57db0

--
nosy: +python-dev

___
Python tracker 

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



[issue14410] argparse typo

2012-03-26 Thread Sandro Tosi

Sandro Tosi  added the comment:

Thanks for your patch: committed!

--
nosy: +sandro.tosi
resolution:  -> fixed
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



[issue14416] syslog missing constants

2012-03-26 Thread Edward Yang

New submission from Edward Yang :

The syslog module is missing constants for a number of logging priorities 
available on modern Linuxen. In particular, the following options are missing: 
LOG_ODELAY, LOG_AUTHPRIV, LOG_SYSLOG, LOG_UUCP.

--
components: Library (Lib)
messages: 156842
nosy: ezyang
priority: normal
severity: normal
status: open
title: syslog missing constants
type: enhancement
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



[issue14417] dict RuntimeError workaround

2012-03-26 Thread Jim Jewett

New submission from Jim Jewett :

Per the 3.3 WhatsNew:
"""issue 14205: A dict lookup now raises a RuntimeError if the dict is modified 
during the lookup. If you implement your own comparison function for objects 
used as dict keys and the dict is shared by multiple threads, access to the 
dict should be protected by a lock."""

This should be easier to do.  My suggestion would be that the change to 
(general) lookdict (or possibly an additional transition, if you want a 
less-slow path for non-string non-container builtins) create the lock, and 
acquire/release that lock.  At a minimum, there should be a dict subclass that 
does this.

[Note that this is arguably a regression, since previous python versions would 
just retry, which would be enough to protect innocent but unlucky code.]

--
messages: 156843
nosy: Jim.Jewett
priority: normal
severity: normal
status: open
title: dict RuntimeError workaround
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



[issue14228] It is impossible to catch sigint on startup in python code

2012-03-26 Thread R. David Murray

R. David Murray  added the comment:

> Limited by what?

The alphabet.

I suppose we could use a -- option, but somebody would have to add support for 
those.

--

___
Python tracker 

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



[issue13608] remove born-deprecated PyUnicode_AsUnicodeAndSize

2012-03-26 Thread Jim Jewett

Jim Jewett  added the comment:

It is now a useful function, as PyUnicode_AsUnicode defers to it.

It is still born-deprecated, but that may be unavoidable, as all use of the 
wstr format is deprecated.

--

___
Python tracker 

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



[issue14417] dict RuntimeError workaround

2012-03-26 Thread R. David Murray

R. David Murray  added the comment:

I must admit to being concerned by the possible impact of this change as well.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue989712] Support using Tk without a mainloop

2012-03-26 Thread Roger Serwy

Roger Serwy  added the comment:

There's a subtle bug in the currently applied patch.

import tkinter
a = tkinter.Tk()
b = tkinter.Tk()

Closing the first window will prevent closing the second window. This example 
may seem abstract, but it is a real issue especially when using matplotlib with 
multiple figures.

Attached is a patch that incorporates what IdleX uses for driving the Tk/Tcl 
event loop.

--
nosy: +serwy
status: closed -> open
Added file: http://bugs.python.org/file25031/issue989712.patch

___
Python tracker 

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



[issue786827] IDLE starts with no menus (Cygwin)

2012-03-26 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Closing as the latest cygwin build works fine.

--
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



[issue14006] Improve the documentation of xml.etree.ElementTree

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e38f4cf482c7 by Eli Bendersky in branch 'default':
Issue #6488: Explain the XPath support of xml.etree.ElementTree, with code
http://hg.python.org/cpython/rev/e38f4cf482c7

--
nosy: +python-dev

___
Python tracker 

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



[issue6488] ElementTree documentation refers to "path" with no explanation, and inconsistently

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e38f4cf482c7 by Eli Bendersky in branch 'default':
Issue #6488: Explain the XPath support of xml.etree.ElementTree, with code
http://hg.python.org/cpython/rev/e38f4cf482c7

--
nosy: +python-dev

___
Python tracker 

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



[issue14006] Improve the documentation of xml.etree.ElementTree

2012-03-26 Thread Eli Bendersky

Eli Bendersky  added the comment:

First step in the right direction - e38f4cf482c7

--

___
Python tracker 

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



[issue6488] ElementTree documentation refers to "path" with no explanation, and inconsistently

2012-03-26 Thread Eli Bendersky

Changes by Eli Bendersky :


--
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



[issue6488] ElementTree documentation refers to "path" with no explanation, and inconsistently

2012-03-26 Thread Eli Bendersky

Eli Bendersky  added the comment:

Closing the issue, unless someone wants to back-port this to 3.2/2.7

--
nosy: +eli.bendersky

___
Python tracker 

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



[issue13608] remove born-deprecated PyUnicode_AsUnicodeAndSize

2012-03-26 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

It could be made an internal function.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-03-26 Thread Eli Bendersky

Eli Bendersky  added the comment:

There was a patch for the docs (+ other stuff) in issue #7635 as well. It can 
be integrated, if relevant.

--

___
Python tracker 

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



[issue7635] 19.6 xml.dom.pulldom doc: stub?

2012-03-26 Thread Eli Bendersky

Eli Bendersky  added the comment:

Yes, sorry for missing this. I've placed a note in issue #14202 to review this. 
Mark, it would be great if you could prepare a fresh patch vs. 3.3 default with 
your additions. Let's continue discussion in #14202 - it's still open.

--

___
Python tracker 

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



[issue989712] Support using Tk without a mainloop

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 837ac3abf0c5 by Andrew Svetlov in branch 'default':
Issue #989712: update the code to process tkinter messages in IDLE
http://hg.python.org/cpython/rev/837ac3abf0c5

--

___
Python tracker 

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



[issue989712] Support using Tk without a mainloop

2012-03-26 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Roger, your patch is pushed.

Please next time when you reopen closed bug set 'Resolution' field to 'remind'.

Thank you.

--

___
Python tracker 

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



[issue989712] Support using Tk without a mainloop

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
status: open -> closed

___
Python tracker 

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



[issue989712] Support using Tk without a mainloop

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
assignee: kbk -> asvetlov

___
Python tracker 

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



[issue539907] Tkinter lock conflicts extension widgets

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue539907] Tkinter lock conflicts extension widgets

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue14205] Raise an error if a dict is modified during a lookup

2012-03-26 Thread Jim Jewett

Jim Jewett  added the comment:

See http://bugs.python.org/issue14417

--

___
Python tracker 

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



[issue5680] Command-line arguments when running in IDLE

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue5233] Enhance 2.7 IDLE to exec IDLESTARTUP/PYTHONSTARTUP on restart

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue5594] IDLE startup configuration

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue8378] PYTHONSTARTUP is not run by default when Idle is started

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue8427] toplevel jumps to another location on the screen

2012-03-26 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Ping

--
nosy: +asvetlov

___
Python tracker 

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



[issue6717] Some problem with recursion handling

2012-03-26 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue14399] zipfile and creat/update comment

2012-03-26 Thread Anthony Kong

Changes by Anthony Kong :


--
nosy: +Anthony.Kong

___
Python tracker 

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



[issue14417] dict RuntimeError workaround

2012-03-26 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I would very much like this to go somewhere other than the collections module.  
As the maintainer of that module, I've worked hard to keep it clutter free 
(people frequently want to stick things in that module when they can't think of 
some place else to put it).

Perhaps consider the existing types module, the builtin namespace, or a new 
module for proxies (if dict_proxy goes in, other proxy types won't be far 
behind).

--

___
Python tracker 

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



[issue14390] Tkinter single-threaded deadlock

2012-03-26 Thread John Bollinger

John Bollinger  added the comment:

I was already working on a standalone test, and now I have it ready.  Using it 
I can demonstrate the issue against both the cpython trunk and against my local 
v2.6.6 binary distribution, therefore I have added v3.3 as an affected version. 
 It is reasonable to suppose that all versions in between are affected as well, 
but I have not tested versions 2.7, 3.1, or 3.2.

I attach a complete package with source and Autotools build scripts.  A bit of 
overkill, I guess, but pretty easy to use.  As is typical with the Autotools, 
the build system is far larger than the actual project sources (those are only 
162 lines of C and 57 lines of Python, both reasonably well commented).

The test should be run against a Python configured with --enable-shared 
--with-threads (I also used --with-pydebug), and that can be an uninstalled 
working copy.  To build and perform the test:

1) Unpack the tarball
tar xzf deadlocktest-0.2.tar.gz
2) Change to the test source directory
cd deadlocktest-0.2
3) Configure the test for building
./configure [--with-python-build=/path/to/working/copy]
4) Build the test
make
5) Run the test
make check

The test builds and runs (and fails) against both Python 2.6 and the current 
trunk (3.3).  It passes when run against my patched versions of 2.6 and 3.3.

--
versions: +Python 3.3
Added file: http://bugs.python.org/file25032/deadlocktest-0.2.tar.gz

___
Python tracker 

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



[issue14409] IDLE does not execute any commands (command prompt works fine!)

2012-03-26 Thread Roger Serwy

Changes by Roger Serwy :


--
status: open -> pending

___
Python tracker 

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



[issue14408] Support the test_cases protocol in the stdlib tests

2012-03-26 Thread Michael Foord

Michael Foord  added the comment:

Thanks for doing the work Matt. In principle the patch looks good, and being 
able to run standard library tests direct from unittest is nice. It's also a 
step towards being able to use test discovery to run standard library tests.

Is the thread setup and cleanup not needed in test_socket when run from 
unittest?

--

___
Python tracker 

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



[issue14368] floattime() should not raise an exception

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 206c45f45236 by Victor Stinner in branch 'default':
Issue #14368: _PyTime_gettimeofday() cannot fail
http://hg.python.org/cpython/rev/206c45f45236

--
nosy: +python-dev

___
Python tracker 

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



[issue14368] floattime() should not raise an exception

2012-03-26 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

Raymond, that sounds like a very irrational way of deciding where it should go.

--

___
Python tracker 

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



[issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c

2012-03-26 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c67f3681e032 by Victor Stinner in branch 'default':
Issue #14383: Add _PyDict_GetItemId() and _PyDict_SetItemId() functions
http://hg.python.org/cpython/rev/c67f3681e032

--
nosy: +python-dev

___
Python tracker 

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



[issue14408] Support the load_tests protocol in the stdlib tests

2012-03-26 Thread Michael Foord

Changes by Michael Foord :


--
title: Support the test_cases protocol in the stdlib tests -> Support the 
load_tests protocol in the stdlib tests

___
Python tracker 

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



[issue14383] Generalize the use of _Py_IDENTIFIER in ceval.c and typeobject.c

2012-03-26 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue14162] PEP 416: Add a builtin frozendict type

2012-03-26 Thread STINNER Victor

STINNER Victor  added the comment:

The PEP has been rejected. See issue #14386 for a new mappingview type.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread Stefan Krah

Stefan Krah  added the comment:

I wonder about the name: There is already a collections.abc.MappingView.

--
nosy: +skrah

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The weakref collections objects (sets, dicts, etc) were all put in a separate 
module and that has worked out well.  I suggest doing the same for proxy 
objects.

In maintaining the itertools module, I learned long ago that adding new tools 
to the module made the whole module more difficult to use (increasing the 
number of choices increases the complexity of choosing the correct tool).  I 
believe that same also applies to the collections module and have been very 
reserved about adding new types there.  

ISTM that exposing internal types such as dict_proxy or bound/unbound methods 
could be collected together or that various proxy types and tools could be 
collected together.  I don't feel that dict_proxy belongs with namedtuple, 
deques, or OrderedDicts.

As the module maintainer, I request that dict_proxy be put elsewhere.  Of 
course, as BDFL you are free to override that request.

--

___
Python tracker 

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



[issue14418] Document differences in SocketServer between Python 2.6 and 2.7

2012-03-26 Thread Geoffrey Bache

New submission from Geoffrey Bache :

Here I'm referring to the section about RequestHandler objects under the 
SocketServer page.  

http://docs.python.org/release/2.7.2/library/socketserver.html#requesthandler-objects
 
This appears to be the same in Python 2.6 and Python 2.7. But the objects don't 
behave the same, in two respects:

1) For finish() "If setup() or handle() raise an exception, this function will 
not be called." This is true in Python 2.6. It appears to no longer be true in 
Python 2.7, where finish() is called in a "finally" clause.

2) For handle(). "The default implementation does nothing". This is true up to 
a point, but using the default implementation has different effects. 
Specifically, if I try to read from a socket when the server has not written 
anything, I get an exception in Python 2.6 and an empty string in Python 2.7. 
Consider this code:

## server.py

from SocketServer import TCPServer, StreamRequestHandler
import sys, socket

server = TCPServer((socket.gethostname(), 0), StreamRequestHandler)
host, port = server.socket.getsockname()
address = host + ":" + str(port)
print "Started server at", address
sys.stdout.flush()

server.serve_forever()

## client.py

import sys, socket

servAddr = sys.argv[1]
host, port = servAddr.split(":")
serverAddress = (host, int(port))
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(serverAddress)
sock.sendall("Some Message")
sock.shutdown(1)
response = sock.makefile().read()
print "Got reply:", response
sock.close()

and compare the following:

$ python2.7 server.py &
Started server at  127.0.1.1:42759
$ python2.7 client.py 127.0.1.1:42759
Got reply:
$ python2.6 server.py &
Started server at  127.0.1.1:42758
$ python client.py 127.0.1.1:42758
Traceback (most recent call last):
  File "client.py", line 12, in 
response = sock.makefile().read()
  File "/usr/lib/python2.7/socket.py", line 351, in read
data = self._sock.recv(rbufsize)
socket.error: [Errno 104] Connection reset by peer

(doesn't matter which Python runs the client in the last case)

I am unsure whether this is a bug in Python 2.6, or really what the reasoning 
behind the behaviour difference is, but I think this change in behaviour is 
worth a small note in the documentation (how it will behave if you try to read 
when nothing has been written)

--
assignee: docs@python
components: Documentation
messages: 156869
nosy: docs@python, gjb1002
priority: normal
severity: normal
status: open
title: Document differences in SocketServer between Python 2.6 and 2.7
versions: Python 2.6, Python 2.7

___
Python tracker 

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



[issue14419] Faster ascii decoding

2012-03-26 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The proposed patch accelerates ascii decoding in a particular case, when the 
alignment of the input data coincides with the alignment of data in 
PyASCIIObject. This is a common case on 32-bit platforms. I did not check 
whether the patch have any effect on 64-bit platforms.

Without patch:
$ ./python -m timeit -n 1000 -s 'enc = "ascii"; import codecs; d = 
codecs.getdecoder(enc); x = ("\u0020" * 100).encode(enc)' 'd(x)'
1000 loops, best of 3: 1.93 msec per loop
$ ./python -m timeit -n 1 -s 'enc = "ascii"; import codecs; d = 
codecs.getdecoder(enc); x = ("\u0020" * 10).encode(enc)' 'd(x)'
1 loops, best of 3: 59.4 usec per loop

With patch:
$ ./python -m timeit -n 1000 -s 'enc = "ascii"; import codecs; d = 
codecs.getdecoder(enc); x = ("\u0020" * 100).encode(enc)' 'd(x)'
1000 loops, best of 3: 1.46 msec per loop
$ ./python -m timeit -n 1 -s 'enc = "ascii"; import codecs; d = 
codecs.getdecoder(enc); x = ("\u0020" * 10).encode(enc)' 'd(x)'
1 loops, best of 3: 35.6 usec per loop

--
components: Interpreter Core
files: decode_ascii.patch
keywords: patch
messages: 156870
nosy: storchaka
priority: normal
severity: normal
status: open
title: Faster ascii decoding
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file25033/decode_ascii.patch

___
Python tracker 

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



[issue14386] Expose dictproxy as a public type

2012-03-26 Thread Guido van Rossum

Guido van Rossum  added the comment:

I like the suggestion of a library module containing proxy classes.

--

___
Python tracker 

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



[issue14419] Faster ascii decoding

2012-03-26 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +pitrou

___
Python tracker 

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



[issue14419] Faster ascii decoding

2012-03-26 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I would like to have someone tested it on a 64-bit platform. May be worth a 
copy smaller blocks, not sizeof(long) but sizeof(void *)? This guaranteed the 
alignment of the destination (and very likely the source).

--

___
Python tracker 

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



[issue14419] Faster ascii decoding

2012-03-26 Thread STINNER Victor

STINNER Victor  added the comment:

Results on a 64-bit Linux box, Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz with 12 
GB of RAM:

Unpatched: 1 loops, best of 3: 150 usec per loop
Patched:   1 loops, best of 3: 80.2 usec per loop

--
nosy: +haypo

___
Python tracker 

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



  1   2   >