[issue13495] IDLE: Regressions - Two ColorDelegator instances loaded and -e no longer edits new files.

2012-01-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If you are saying that it is better to open a blank window than to not open a 
filled window, I agree.

--
stage:  -> patch review

___
Python tracker 

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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-14 Thread Eric V. Smith

Eric V. Smith  added the comment:

I agree it's not the best error message. What's happening is that these types 
(list, tuple, etc.) do not implement __format__, so object.__format__ is used. 
It returns str(self). Then the resulting string is formatted with the given 
format_spec. Since str does not support the 'd' format type, the error you see 
is raised.

I'm open to suggestions on how to improve this, but I don't see how it's 
possible given what str.__format__ knows when it generates the error.

--
assignee:  -> eric.smith
nosy: +eric.smith
versions: +Python 3.2, Python 3.3 -Python 3.1

___
Python tracker 

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



[issue13495] IDLE: Regressions - Two ColorDelegator instances loaded and -e no longer edits new files.

2012-01-14 Thread Roger Serwy

Roger Serwy  added the comment:

There was another regression introduced by (a4bd8a4805a8). IDLE 3 no longer 
allows for editing of new files from the command line. 

For example:

   idle -e /tmp/newfile.py 

will momentarily flash an editor window before it is closed. This is due to 
"good_load" not being set. What's worse is that the IDLE process will continue 
running without having any visible windows open. 

The rev2 patch removes the "good_load" flag and fixes the ColorDelegator issue.

I understand the purpose of the original code is to avoid displaying a blank 
editor in case of a decode error. The rev2 patch reintroduces this behavior. In 
my opinion, that behavior is not a serious problem.

--
nosy: +terry.reedy
title: IDLE: Regression - Two ColorDelegator instances loaded -> IDLE: 
Regressions - Two ColorDelegator instances loaded and -e no longer edits new 
files.
Added file: http://bugs.python.org/file24243/issue13495_rev2.patch

___
Python tracker 

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



[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2012-01-14 Thread py.user

New submission from py.user :

>>> '{0:d}'.format('a')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 'd' for object of type 'str'
>>> '{0:d}'.format(1+1j)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 'd' for object of type 'complex'
>>> '{0:d}'.format([])
Traceback (most recent call last):
  File "", line 1, in 
ValueError: Unknown format code 'd' for object of type 'str'
>>>

also strange behavior:
>>> '{0:s}'.format((1, 2, 3))
'(1, 2, 3)'
>>> '{0:10.5s}'.format([1, 2, 3])
'[1, 2 '
>>>

--
components: Interpreter Core
messages: 151277
nosy: py.user
priority: normal
severity: normal
status: open
title: In str.format an incorrect error message for list, tuple, dict, set
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue13789] _tkinter does not build on Windows 7

2012-01-14 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Modules/_tkinter.py #includes Modules/tkinter.h, tcl.h, and tk.h. The latter 
two #include tclDecls.h, tclPlatDecls.h, and tkDecls.h. I obtained 8.5.9 
versions of all 5 and added them to Include/. Although they came from Ubuntu, 
they appear to be cross-platform in that they look for Mac and Win defines. 
They make the corresponding build errors go away. However, one remains: a 
failure to open X11/Xlib.h.

This must come from the following in tk.h:
#ifndef RC_INVOKED
#ifndef _XLIB_H
#   if defined(MAC_OSX_TK)
#include 
#include 
#   else
#include 
#   endif
#endif
#ifdef __STDC__
#   include 
#endif

It seems this tk.h header, at least, expects RC_INVOKED to be defined on 
non-X11 platforms. Something here is crucially different than on the machine 
that builds Python for windows. The version of tk.h? the absence of X11/xlib.h? 
the pcbuild stuff? or the Visual Studio version?

I tried to compile PCbuild/pcbuild.sln with VC2008 Express in the 3.3, 3.2, and 
2.7 repositories. For 3.3, I tried both debug and release builds.

--
components: Build, Windows
messages: 151276
nosy: brian.curtin, loewis, terry.reedy, tim.golden
priority: normal
severity: normal
status: open
title: _tkinter does not build on Windows 7
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue13788] os.closerange optimization

2012-01-14 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

Thanks for the patch.

However, this cannot as far as I understand be used for the subprocess 
implementation due to the limitation of what can be called after a fork() and 
before an exec().

Take a look at #8052 for some more discussion of this.

--
nosy: +rosslagerwall

___
Python tracker 

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



[issue13788] os.closerange optimization

2012-01-14 Thread Ferringb

Changes by Ferringb :


Removed file: http://bugs.python.org/file24241/closerange-optimization.patch

___
Python tracker 

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



[issue13788] os.closerange optimization

2012-01-14 Thread Ferringb

Ferringb  added the comment:

Fixed tabs/spaces...

--
Added file: http://bugs.python.org/file24242/closerange-optimization.patch

___
Python tracker 

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



[issue13788] os.closerange optimization

2012-01-14 Thread Ferringb

New submission from Ferringb :

The current implementation of closerange essentially is a bruteforce invocation 
of close for every integer in the range.

While this works, it's rather noisy for stracing, and for most invocations, is 
near a thousand close invocations more than needed.

As such it should be aware of /proc/${PID}/fd, and use that to isolate down 
just what is actually open, and close that.

--
components: Extension Modules
files: closerange-optimization.patch
keywords: patch
messages: 151273
nosy: ferringb
priority: normal
severity: normal
status: open
title: os.closerange optimization
type: performance
Added file: http://bugs.python.org/file24241/closerange-optimization.patch

___
Python tracker 

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



[issue13770] python3 & json: add ensure_ascii documentation

2012-01-14 Thread Éric Araujo

Éric Araujo  added the comment:

All right.  I’ll do like other parameters (see check_circular for an example) 
and just duplicate the two-line doc.

--
assignee: docs@python -> eric.araujo
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



[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-14 Thread Mahmoud Hashemi

Mahmoud Hashemi  added the comment:

And here's the working Python 2 version (works fine on Python 2.7, and likely a 
few versions prior).

--
Added file: http://bugs.python.org/file24240/co_what2.py

___
Python tracker 

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



[issue13787] PyCode_New not round-trippable (TypeError)

2012-01-14 Thread Mahmoud Hashemi

New submission from Mahmoud Hashemi :

On Python 3.1.4, attempting to create a code object will apparently result in a 
TypeError (must be str, not tuple), even when you're creating a code object 
from another, working code object:

# co_what.py
def foo():
return 'bar'

co = foo.__code__

co_copy = type(co)(co.co_argcount,
   co.co_kwonlyargcount,
   co.co_nlocals,
   co.co_stacksize,
   co.co_flags,
   co.co_code,
   co.co_consts,
   co.co_names,
   co.co_varnames,
   co.co_freevars,
   co.co_cellvars,
   co.co_filename,
   co.co_name,
   co.co_firstlineno,
   co.co_lnotab)
# EOF
$ python3 co_what.py
Traceback (most recent call last):
  File "co_what.py", line 20, in 
co.co_lnotab)
TypeError: must be str, not tuple

Looking at the PyCode_New function, all the arguments look correctly matched up 
according to the signature in my Python 3.1.4 build source (looks identical to 
the trunk source):

# Objects/codeobject.c

PyCode_New(int argcount, int kwonlyargcount,
   int nlocals, int stacksize, int flags,
   PyObject *code, PyObject *consts, PyObject *names,
   PyObject *varnames, PyObject *freevars, PyObject *cellvars,
   PyObject *filename, PyObject *name, int firstlineno,
   PyObject *lnotab)
{
PyCodeObject *co;
Py_ssize_t i;

/* Check argument types */
if (argcount < 0 || nlocals < 0 ||
code == NULL ||
consts == NULL || !PyTuple_Check(consts) ||
names == NULL || !PyTuple_Check(names) ||
varnames == NULL || !PyTuple_Check(varnames) ||
freevars == NULL || !PyTuple_Check(freevars) ||
cellvars == NULL || !PyTuple_Check(cellvars) ||
name == NULL || !PyUnicode_Check(name) ||
filename == NULL || !PyUnicode_Check(filename) ||
lnotab == NULL || !PyBytes_Check(lnotab) ||
!PyObject_CheckReadBuffer(code)) {
PyErr_BadInternalCall();
return NULL;
}

And, for the record, this same behavior works just fine in the equivalent 
Python 2.

--
components: Interpreter Core
files: co_what.py
messages: 151270
nosy: mahmoud
priority: normal
severity: normal
status: open
title: PyCode_New not round-trippable (TypeError)
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file24239/co_what.py

___
Python tracker 

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



[issue12949] Documentation of PyCode_New() lacks kwonlyargcount argument

2012-01-14 Thread Mahmoud Hashemi

Changes by Mahmoud Hashemi :


--
nosy: +mahmoud

___
Python tracker 

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



[issue12409] Moving "Documenting Python" to Devguide

2012-01-14 Thread Sandro Tosi

Sandro Tosi  added the comment:

"Documenting Python" has been:

- moved to devguide; http://hg.python.org/devguide/rev/5d4a90e568ed
- removed from 2.7, 3.2 and default;
http://hg.python.org/cpython/rev/8975f7d0fbf7
http://hg.python.org/cpython/rev/70c46599fb0e
http://hg.python.org/cpython/rev/900c01e643a7

Thanks everyone!

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



[issue13785] Make concurrent.futures.Future state public

2012-01-14 Thread Brian Quinlan

Brian Quinlan  added the comment:

Thanks for the patch!

1. The fetching the state feature seems reasonable but I think that explaining 
the difference between CANCELLED and CANCELLED_AND_NOTIFIED is going to be 
hard. Maybe you could look at how Doc/library/concurrent.futures.rst would need 
to be updated to see if we can provide a reasonable description of the 
different states?

2. Having the future record the history of its state transitions seems 
potentially useful but there is no precedent for this in other Python objects 
where it would also be useful. Maybe you could make the executors take a 
Futures factory and then provide a subclass that does that? Not sure that I 
like that either but...

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-01-14 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

A new lock type will NOT solve this.  It is ALWAYS okay to clear all 
thread/threading module locks after a fork.

They are and always have been process-local by definition so they are also by 
definition 100% invalid to any child process.

Anyone who has written code using them to "lock" an out-of-process resource has 
written code that is already broken today. Thread locks can't guard network 
resources.

--

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-01-14 Thread Charles-François Natali

Charles-François Natali  added the comment:

> However, extending RLock to provide ForkClearedRLock (this would be used by 
> logging, i.e.) is quite straighforward.
>
> The extended class would simply need to record the process ID, in which the 
> lock was created, and the process ID, which is trying to acquire it.  Done!

There are at least two problems with this approach.
- with LinuxThreads, threads have different PIDs, so this would break.
 LinuxThreads have now been replaced with NPTL, so this may not be a
showstopper, though
- however, the other problem is more serious: it has the exact same
problem as the lock reinitialization upon fork(): locks are used to
protect critical sections, to make sure that threads see a consistent
state: if you simply proceed and reset/acquire the lock when the
process is not the last one that owned it, the invariants protected by
the lock will be broken.
The proper solution is to setup handlers to be called upon fork, that
not only reset locks, but also internal state of objects they protect.
However, this is a dull and boring task, and would require patching
dozens of different places. It's been on my todo list for some time...
Another "solution" would be to remove the only place in the standard
library where a bare fork() is used, in multiprocessing (issue #8713).
Then, it's the user's problem if he calls fork() :-)

--

___
Python tracker 

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



[issue13752] add a str.casefold() method

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d4669f43d05f by Benjamin Peterson in branch 'default':
add str.casefold() (closes #13752)
http://hg.python.org/cpython/rev/d4669f43d05f

--
nosy: +python-dev
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



[issue12409] Moving "Documenting Python" to Devguide

2012-01-14 Thread Sandro Tosi

Sandro Tosi  added the comment:

On Sat, Jan 14, 2012 at 04:36, Éric Araujo  wrote:
>
> Éric Araujo  added the comment:
>
> I just replied to your python-dev email.  I think you can update 2.7 to use 
> Sphinx 1.0 as soon as you’re down to a handful of warnings.

thanks! I've just updated 2.7 to sphinx 1.0 - yay

> When the migration is done, you can add the documenting doc to the devguide 
> and send a message to pydev to tell people to not commit changes to 
> Doc/documenting in CPython clones anymore.
>
> In the same email you can ask who to ask for setting up redirects (BTW, will 
> redirecting paths to fragments work?  e.g. docs.py.o/documenting/style to 
> devguide/documenting#style-and-blah).  When the redirects are up you’ll be 
> able to rm Doc/documenting.

I just did that with:
http://mail.python.org/pipermail/python-dev/2012-January/115520.html

> Then we’ll open other reports to talk about the unrelated I mentioned and to 
> see how to stop downloading Sphinx from svn once per clone :)

Ah yes, sure!

Cheers,
Sandro

--

___
Python tracker 

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



[issue13725] regrtest does not recognize -d flag

2012-01-14 Thread Erno Tukia

Erno Tukia  added the comment:

Meador, thanks for the acknowledgement.

--

___
Python tracker 

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



[issue13786] regrtest.py does not handle --trace

2012-01-14 Thread Meador Inge

Meador Inge  added the comment:

Fixed.

--
resolution:  -> fixed
stage: commit 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



[issue13786] regrtest.py does not handle --trace

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset a32bc62b8772 by Meador Inge in branch '3.2':
Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
http://hg.python.org/cpython/rev/a32bc62b8772

New changeset 9b14b04a0cdd by Meador Inge in branch 'default':
Issue #13786: Remove unimplemented 'trace' long option from regrtest.py.
http://hg.python.org/cpython/rev/9b14b04a0cdd

--
nosy: +python-dev

___
Python tracker 

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



[issue6721] Locks in python standard library should be sanitized on fork

2012-01-14 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue13786] regrtest.py does not handle --trace

2012-01-14 Thread Meador Inge

New submission from Meador Inge :

While fixing issue13725 I noticed that there is a long option for 'trace', but 
it is not actually handled:

[meadori@motherbrain cpython]$ ./python -m test --trace
No handler for option --trace.  Please report this as a bug at 
http://bugs.python.org.

I will commit the attached patch shortly.

--
assignee: meador.inge
components: Tests
files: regrtest-remove-unhandled-trace-longoption.patch
keywords: easy, patch
messages: 151260
nosy: meador.inge
priority: low
severity: normal
stage: commit review
status: open
title: regrtest.py does not handle --trace
type: behavior
versions: Python 3.2, Python 3.3
Added file: 
http://bugs.python.org/file24238/regrtest-remove-unhandled-trace-longoption.patch

___
Python tracker 

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



[issue13785] Make concurrent.futures.Future state public

2012-01-14 Thread Juan Javier

New submission from Juan Javier :

Hello,

This is a proposal to make the state of Future objects public.

The idea is to have access to the current state of the Future using a property 
instead of calling several methods (done, cancelled, etc.).

Also, a history property that returns a list of Event(state, timestamp) objects 
is written, the list stores the timestamp every time the state of a future 
changes.

There is a patch attached to the issue.

Regards.

--
components: Library (Lib)
files: concurrent.futures.Future.state_public.patch
keywords: patch
messages: 151259
nosy: bquinlan, jjdominguezm
priority: normal
severity: normal
status: open
title: Make concurrent.futures.Future state public
type: enhancement
versions: Python 3.3
Added file: 
http://bugs.python.org/file24237/concurrent.futures.Future.state_public.patch

___
Python tracker 

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



[issue13770] python3 & json: add ensure_ascii documentation

2012-01-14 Thread Марк Коренберг

Марк Коренберг  added the comment:

ensure_ascii is documented only in Jsonencoder class. Other functions like 
dumps() should refer to this class description for that parameter.

--

___
Python tracker 

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



[issue13725] regrtest does not recognize -d flag

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3e9b107fb5da by Meador Inge in branch '3.2':
Issue #13725: Add a NEWS entry.
http://hg.python.org/cpython/rev/3e9b107fb5da

New changeset 7332e97587da by Meador Inge in branch 'default':
Issue #13725: Add a NEWS entry.
http://hg.python.org/cpython/rev/7332e97587da

--

___
Python tracker 

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



[issue13725] regrtest does not recognize -d flag

2012-01-14 Thread Meador Inge

Meador Inge  added the comment:

Éric, I got it.

Erno, thanks for the patch.

--
nosy: +meador.inge
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



[issue13725] regrtest does not recognize -d flag

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f80f9eb5df02 by Meador Inge in branch '3.2':
Issue #13725: regrtest does not recognize -d flag.
http://hg.python.org/cpython/rev/f80f9eb5df02

New changeset f2b764dd0851 by Meador Inge in branch 'default':
Issue #13725: regrtest does not recognize -d flag.
http://hg.python.org/cpython/rev/f2b764dd0851

--
nosy: +python-dev

___
Python tracker 

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



[issue13783] Clean up PEP 380 C API additions

2012-01-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Also check any GetAttr and CallMethod operations to see if they should be moved 
over to the new *Id variants.

--

___
Python tracker 

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



[issue13780] make YieldFrom its own node

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset e1177b9167ce by Benjamin Peterson in branch 'default':
make YieldFrom its own distinct from Yield (closes #13780)
http://hg.python.org/cpython/rev/e1177b9167ce

--
nosy: +python-dev
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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Fixed now. Thanks!

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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c4919642fd25 by Senthil Kumaran in branch '3.2':
Fix issue13726: -S accepts an argument just as --start.
http://hg.python.org/cpython/rev/c4919642fd25

New changeset 347f6305bd26 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix issue13726: -S accepts an argument just as --start.
http://hg.python.org/cpython/rev/347f6305bd26

--

___
Python tracker 

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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Erno Tukia

Changes by Erno Tukia :


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

___
Python tracker 

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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Erno Tukia

Erno Tukia  added the comment:

--start requires an argument but short opt -S does not.

in Lib/test/regrtest.py

opts, args = getopt.getopt(sys.argv[1:], '...S...',
[..., 'start=', ...])

Patch included.

--
keywords: +patch
Added file: http://bugs.python.org/file24236/issue13726-2.patch

___
Python tracker 

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



[issue12760] Add create mode to open()

2012-01-14 Thread Charles-François Natali

Charles-François Natali  added the comment:

Thanks, I've committed your version.

--

___
Python tracker 

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



[issue13642] urllib incorrectly quotes username and password in https basic auth

2012-01-14 Thread Joonas Kuorilehto

Joonas Kuorilehto  added the comment:

Updating the issue with version 3.2 tag since it was fixed there as well. Still 
fixed, of course.

You are correct that the encodings can be tricky. Luckily I only added coding 
to tests. But you're right, I would consider very carefully before using 
similar code outside tests.

I just realized what's the impact of this change on python3.2 really. Since 
urllib.request.urlopen (for some reason) does not allow username and password 
on the URI, it is not possible to hit this with that, I think. But 
FancyURLopener does allow using user-pass in url, so this bug was reachable. I 
just verified that and the fix :)

Fix does the trick for FancyURLopener when the username and password are passed 
in the URL.

--
versions: +Python 3.2

___
Python tracker 

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



[issue13784] Documentation of xml.sax.xmlreader: Locator.getLineNumber() and Locator.getColumnNumber()

2012-01-14 Thread patrick vrijlandt

New submission from patrick vrijlandt :

Problem:
Locator methods return the location where the event starts, not where it ends.
Locator line numbers start at 1, Locator column numbers can be 0.

Proposal:
Adapt documentation.

>From the docs:
Instances of Locator provide these methods:

Locator.getColumnNumber() 
Return the column number where the current event ends.

Locator.getLineNumber() 
Return the line number where the current event ends

My Test:

import xml.sax

data = b"""



"""


class MyHandler(xml.sax.handler.ContentHandler):

def startElement(self, name, attrs):
if name == "sub":
print("open", name, self._locator.getLineNumber(), 
self._locator.getColumnNumber())

def endElement(self, name):
if name == "sub":
print("close", name, self._locator.getLineNumber(), 
self._locator.getColumnNumber())

xml.sax.parseString(data, MyHandler())

Output:

open sub 2 4
close sub 7 4

--
assignee: docs@python
components: Documentation, XML
messages: 151247
nosy: docs@python, patrick.vrijlandt
priority: normal
severity: normal
status: open
title: Documentation of  xml.sax.xmlreader: Locator.getLineNumber() and 
Locator.getColumnNumber()
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue13766] explain the relationship between Lib/lib2to3/Grammar.txt and Grammar/Grammar

2012-01-14 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue13642] urllib incorrectly quotes username and password in https basic auth

2012-01-14 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Here we go! I thought the problem did not exist in py3k, but good that the 
tests caught them and we have a fix now.

Thanks for the complete patch, Joonas. I hope it was easy to port the patch to 
3k. The encoding part may perhaps be the only thing to careful with and use of 
the new string format feature was good one.  Thanks!

--
status: open -> closed

___
Python tracker 

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



[issue13642] urllib incorrectly quotes username and password in https basic auth

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 80e3b8de4edd by Senthil Kumaran in branch '3.2':
Fix Issue #13642: Unquote before b64encoding user:password during Basic 
Authentication.
http://hg.python.org/cpython/rev/80e3b8de4edd

New changeset 4b4029fc8cf2 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix Issue #13642: Unquote before b64encoding user:password 
during Basic Authentication.
http://hg.python.org/cpython/rev/4b4029fc8cf2

--

___
Python tracker 

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



[issue12760] Add create mode to open()

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8bcbe2dc3835 by Charles-François Natali in branch 'default':
Issue #12760: Refer to the new 'x' open mode as "exclusive creation" mode.
http://hg.python.org/cpython/rev/8bcbe2dc3835

--

___
Python tracker 

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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I add -o as a short form for --slow. regrtest was using getopt and this 
conflicting option was not caught. I see it is a bug than a feature so the 
change is made in 3.2 and 3.3
default: b84f61fdcb4c and 6797e7458ad0

Thanks for catching this bug, Erno Tukia.

--
nosy: +orsenthil
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



[issue13726] regrtest ambiguous -S flag

2012-01-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4fc5dfad766a by Senthil Kumaran in branch '3.2':
Issue13726 - Fix the  ambiguous -S flag in regrtest. It is -o/--slow for 
printing the 10 slowest test.
http://hg.python.org/cpython/rev/4fc5dfad766a

New changeset 9a0efac5bbcb by Senthil Kumaran in branch '3.2':
Adding the -o option for Issue13726
http://hg.python.org/cpython/rev/9a0efac5bbcb

--
nosy: +python-dev

___
Python tracker 

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



[issue6774] socket.shutdown documentation: on some platforms, closing one half closes the other half

2012-01-14 Thread Charles-François Natali

Charles-François Natali  added the comment:

> This is questionable, unexpected, and should be documented.

There's already this note at the top of the socket module documentation:
"""
Note

Some behavior may be platform dependent, since calls are made to the
operating system socket APIs.
"""

There are other such subtleties with the socket API, e.g. SO_REUSEADDR
which doesn't have the same semantics on Windows. As I said earlier, I
don't think we should document every platform quirks: it will make
users worry for no reason, and as time passes, there's a chance that
the documentation doesn't match the actual behavior.
For example, this specific behavior might very well be a bug, and it's
not our responsibility to document this.

--

___
Python tracker 

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



[issue13642] urllib incorrectly quotes username and password in https basic auth

2012-01-14 Thread Joonas Kuorilehto

Joonas Kuorilehto  added the comment:

Also adding a patch that may be enough to fix the problem in python3.2. Review 
needed, did not test more than passing the previously failed unit test.

--
Added file: http://bugs.python.org/file24235/urllib-userpass-w-spaces-fix.patch

___
Python tracker 

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