[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2014-05-25 Thread Марк Коренберг

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

Is issue 21579 fixed in that bug? too many letters..sorry...

--
nosy: +mmarkk

___
Python tracker 

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



[issue21579] Python 3.4: tempfile.close attribute does not work

2014-05-25 Thread Berker Peksag

Berker Peksag added the comment:

See issue 18879 for more information about the change.

--
nosy: +berker.peksag, pitrou

___
Python tracker 

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



[issue21235] importlib's spec module create algorithm is not exposed

2014-05-25 Thread Eric Snow

Eric Snow added the comment:

How about this replacement for direct use of Loader.load_module():

# in importlib.util
def load(spec_or_name, /, **kwargs):  # or "load_from_spec"
if isinstance(spec_or_name, str):
name = spec_or_name
if not kwargs:
raise TypeError('missing loader')
spec = spec_from_loader(name, **kwargs)
else:
if kwargs:
raise TypeError('got unexpected keyword arguments')
spec = spec_or_name
return _SpecMethods(spec).load()

(See a similar proposal for new_module() in msg219135, issue #20383).

--

___
Python tracker 

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



[issue20383] Add a keyword-only spec argument to types.ModuleType

2014-05-25 Thread Eric Snow

Eric Snow added the comment:

Okay, I didn't read closely enough. :)  It may be worth updating the title.

FWIW, the name "module_from_spec" confused me at first because my brain 
interpreted that as "load_from_spec".  Keeping the name and purpose more 
focused might be helpful.  I have comments below to that effect.

If your proposed change still makes sense, could we keep it simpler for now?  
Something like this:

# in importlib.util
def module_from_spec(spec, module=None):
"""..."""
methods = _bootstrap._SpecMethods(spec)
if module is None:
return methods.create()
else:
methods.init_module_attrs(methods)
return module

Keeping the 2 methods on _SpecMethods is helpful for the PEP 406 (ImportEngine) 
superseder that I still want to get back to for 3.5. :)

--

> This serves two purposes. One is that it abstracts the
> loader.create_module() dance out so that's no longer a worry.

I'm not sure what dance you mean here and what the worry is.

> But more crucially it also means that if you have the function
> create the module for you then it will be returned with all of
> its attributes set without having to worry about forgetting that
> step.

So we would discourage calling ModuleType directly and encourage the use of a 
function in importlib.util that is equivalent to _SpecMethods.create().  That 
sounds good to me.  The use case for creating module objects directly is a 
pretty advanced one, but having a public API for that would still be good.

>From this point of view I'd expect it to just look like this:

def new_module(spec):
return _SpecMethods(spec).create()

or given what I expect is the common use case currently:

def new_module(name, loader):
spec = spec_from_loader(name, loader)
return _SpecMethods(spec).create()

or together:

def new_module(spec_or_name, /, loader=None):
if isinstance(spec_or_name, str):
name = spec_or_name
if loader is None:
raise TypeError('missing loader')
spec = spec_from_loader(name, loader)
else:
if loader is not None:
raise TypeError('got unexpected keyword argument "loader"')
spec = spec_or_name
return _SpecMethods(spec).create()

To kill 2 birds with 1 stone, you could even make that the new signature of 
ModuleType(), which would just do the equivalent under the hood.  That way 
people keep using the same API that they already are (no need to communicate a 
new one to them), but they still get the appropriate attributes set properly.

> The module argument is just for convenience in those
> instances where you truly only want to override the module
> creation dance for some reason and really just want the
> attribute setting bit.

Perhaps it would be better to have a separate function for that (equivalent to 
just _SpecMethods.init_module_attrs()).  However, isn't that an even more 
uncommon use case outside of the import system itself?

> About the only other thing I can think of that people might
> still want is something like `importlib.util.load(spec)`

I agree it's somewhat orthogonal.  I'll address comments to issue #21235.

--

___
Python tracker 

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



[issue21436] Consider leaving importlib.abc.Loader.load_module()

2014-05-25 Thread Eric Snow

Eric Snow added the comment:

I'd rather see something like "load_from_spec()" added to importlib.util, a la 
issue #21235.

--

___
Python tracker 

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



[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded

2014-05-25 Thread Martin Panter

New submission from Martin Panter:

At the bottom of the “tkinter” doc page it mentions the “data” option is 
available. However I was unable to get it to work well when passing a plain 
bytes() string in. It seems the bytes() string gets interpreted as UTF-8 
somewhere along the line, although the underlying TCL library apparenly handles 
byte strings fine itself. Passing binary GIF and PNG data in Python would 
usually produce strange exceptions, crashes, and blank images for me.

I found this message with a simple patch which might be useful, though I’m not 
familiar with the code involved to understand the implications:
https://mail.python.org/pipermail/tkinter-discuss/2012-April/003108.html

Even if that fix is not appropriate, can I suggest adding to the documentation 
to say the data should be encoded with one of these options that seem to work? 
The Base-64 one is probably better.

PhotoImage(data=data.decode("latin-1).encode("utf-8"))
PhotoImage(data=base64.encodebytes(data))

--
assignee: docs@python
components: Documentation, Tkinter
messages: 219133
nosy: docs@python, vadmium
priority: normal
severity: normal
status: open
title: PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded
versions: Python 3.4

___
Python tracker 

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



[issue21579] Python 3.4: tempfile.close attribute does not work

2014-05-25 Thread Марк Коренберг

New submission from Марк Коренберг:

Suppose code:
=
import os
import tempfile

want_to_replace = 'zxc.dat'
tmpdir=os.path.dirname(os.path.realpath(want_to_replace))
with tempfile.NamedTemporaryFile(dir=tmpdir) as fff:
# do somewhat with fff here... and then:
fff.flush()
os.fdatasync(fff)
os.rename(fff.name, want_to_replace)
fff.delete = False
=
In python 3.3 and lower that works FINE. In Python 3.4 the fff._closer 
attribute was introduced, so fff.close=False stopped to work. I think this is 
major loss of functionality. The "close" attribute was not marked as private, 
so may be used in past.

--
components: Library (Lib)
messages: 219132
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Python 3.4: tempfile.close attribute does not work
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue21137] Better repr for threading.Lock()

2014-05-25 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-25 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Raymond, will do.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3615cdb3b86d by Raymond Hettinger in branch '2.7':
Issue 8743:  Improve interoperability between sets and the collections.Set 
abstract base class.
http://hg.python.org/cpython/rev/3615cdb3b86d

--
nosy: +python-dev

___
Python tracker 

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



[issue16774] Additional recipes for itertools docs

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

In the end, I decided to add a variant of take_last().

Thank you for the suggestion.

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

___
Python tracker 

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



[issue16774] Additional recipes for itertools docs

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2781fb146f4a by Raymond Hettinger in branch 'default':
Issue 16774:  Add a new itertools recipe (suggested by Alexey Kachayev).
http://hg.python.org/cpython/rev/2781fb146f4a

--
nosy: +python-dev

___
Python tracker 

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



[issue16774] Additional recipes for itertools docs

2014-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue15767] add ModuleNotFoundError

2014-05-25 Thread Eric Snow

Eric Snow added the comment:

Any chance we could revive ModuleNotFoundError?  It's nice to be able to 
distinguish between the failure to *find* the module during import from other 
uses of ImportError.  I'd definitely expect it to work the way Guido explained. 
 Basically only importlib._bootstrap._find_and_load_unlocked() would raise 
ModuleNotFoundError (when _find_spec() returns None).

I've found the exception to be very useful while working on the importlib 
backport (https://bitbucket.org/ericsnowcurrently/importlib2).  My desire for 
adding ModuleNotFoundError is unrelated to its internal use in importlib that 
motivated the original request (see msg182332).

Here's the signature:

  ModuleNotFoundError(*args, name=None), inherits from ImportError

For reference, here's ImportError:

  ImportError(*args, name=None, path=None)

ModuleNotFoundError would need to be exposed somewhere sensible since once 
people see in tracebacks they'll want to catch it. :)  I'd expect that to be 
either in builtins or as importlib.ModuleNotFoundError.  We may be able to get 
away with not adding it to builtins, but maybe it would still make sense.

--

___
Python tracker 

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



[issue21343] os.path.relpath returns inconsistent types

2014-05-25 Thread Matt Bachmann

Matt Bachmann added the comment:

Looking into the project im working on I discovered why relpath was acting 
strangely.

It is because the project mocks get_cwd but not get_cwdu. Your request helped 
me track that down :-)

So that is not an issue. However, the issue described in the original ticket 
definitely happens in a clean python shell.

I still think it is bad that the method sometimes returns str and sometimes 
returns unicode, but I see your point that ultimately the byte strings that do 
come out of here coerce into unicode cleanly.

Thanks for working though this with me.

--

___
Python tracker 

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



[issue21578] Misleading error message when ImportError called with invalid keyword args

2014-05-25 Thread Eric Snow

New submission from Eric Snow:

>>> ImportError(spam='spam')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: ImportError does not take keyword arguments

However, it *does* take keyword arguments:

>>> ImportError(name='spam', path='spam')
ImportError()

--
components: Interpreter Core
messages: 219125
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Misleading error message when ImportError called with invalid keyword 
args
type: enhancement
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue21577] Help for ImportError should show a more useful signature.

2014-05-25 Thread Eric Snow

New submission from Eric Snow:

Currently:

  __init__(self, /, *args, **kwargs)

Proposed:

  __init__(self, /, *args, name=None, path=None, **kwargs)

Even that is still a little vague, but at least it doesn't gloss over the 
kwonly args added in 3.3.

--
components: Interpreter Core
messages: 219124
nosy: brett.cannon, eric.snow
priority: normal
severity: normal
stage: needs patch
status: open
title: Help for ImportError should show a more useful signature.
type: enhancement
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-25 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file35364/htest-25052014-27.diff

___
Python tracker 

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



[issue20664] _findLib_crle and _get_soname broken on latest SunOS 5.11

2014-05-25 Thread Jeff Quast

Jeff Quast added the comment:

Submitting fix to fallback to alternate '/usr/bin/dump' path, confirmed using 
SmartOS.

As for the issues writing to /lib and /usr/lib from a zone, and the request for 
"An environment variable .. to override this functionality." I have to 
disagree: crle(1) already provides facilities to add additional paths.

For example, to add `/usr/local/lib' to your dynamic library path, You would 
simply run, `crle -l /usr/local/lib -u'.

I don't *that* belongs in python.

--
keywords: +patch
nosy: +jquast
Added file: http://bugs.python.org/file35362/opensolaris-ctypes-python-2.7.patch

___
Python tracker 

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



[issue20664] _findLib_crle and _get_soname broken on latest SunOS 5.11

2014-05-25 Thread Jeff Quast

Changes by Jeff Quast :


Added file: http://bugs.python.org/file35363/opensolaris-ctypes-python-3.x.patch

___
Python tracker 

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-25 Thread tholzer

Changes by tholzer :


Removed file: http://bugs.python.org/file35360/socketmodule_2.7.6_eintr_patch.c

___
Python tracker 

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-25 Thread tholzer

Changes by tholzer :


Added file: http://bugs.python.org/file35361/socketmodule_2.7.6_eintr_patch.c

___
Python tracker 

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-25 Thread tholzer

tholzer added the comment:

I've also attached a potential patch for the C module Modules/socketmodule.c 
inside internal_connect().

A few notes:

This seems to work both without time-out and with time-out sockets 
(non-blocking).

One concern would be a signal storm prolonging the operation beyond the 
time-out. Should we keep track of the actual time taken in this loop and check 
it against the 'timeout' parameter ?

Also, I don't think we can call PyErr_CheckSignals() in this context. Does this 
need to happen at all ?

--
Added file: http://bugs.python.org/file35360/socketmodule_2.7.6_eintr_patch.c

___
Python tracker 

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



[issue20611] socket.create_connection() doesn't handle EINTR properly

2014-05-25 Thread tholzer

tholzer added the comment:

No problem, I've attached a patch for socket.py for Python 2.7.3.

A few notes:

getaddrinfo (and gethostbyname, etc.) are already immune to this bug, so I've 
just fixed the connect() call.

The socket does need to be closed after EINTR, otherwise a EINPROGRESS might 
get returned on subsequent connect() calls.

--
Added file: http://bugs.python.org/file35359/socket_2.7.3_eintr_patch.py

___
Python tracker 

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



[issue21575] list.sort() should show arguments in tutorial

2014-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
keywords: +patch
Added file: http://bugs.python.org/file35358/sort_tut.diff

___
Python tracker 

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



[issue21575] list.sort() should show arguments in tutorial

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is there a reason why we do not show the arguments there?

It was likely an oversight.   I think it should be updated so that people know 
the options are there.

--
nosy: +rhettinger

___
Python tracker 

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



[issue15246] Line coverage for collectionts.abc.Set

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks for the patch.  Nice work.

--
resolution:  -> fixed
status: open -> closed
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue15246] Line coverage for collectionts.abc.Set

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc353953ce8b by Raymond Hettinger in branch 'default':
Issue 15246:  Improve test coverage for collections.abc.Set.  (Contributed by 
James King).
http://hg.python.org/cpython/rev/dc353953ce8b

--
nosy: +python-dev

___
Python tracker 

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



[issue21137] Better repr for threading.Lock()

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Berker.

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

___
Python tracker 

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



[issue21137] Better repr for threading.Lock()

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7574f94b1068 by Raymond Hettinger in branch 'default':
Issue 21137:  Better repr for threading.Lock()
http://hg.python.org/cpython/rev/7574f94b1068

--
nosy: +python-dev

___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +ncoghlan
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21558] Fix a typo in the contextlib docs

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ebeade01bd8e by Raymond Hettinger in branch '3.4':
Issue 21558:  Fix a typo in the contextlib docs
http://hg.python.org/cpython/rev/ebeade01bd8e

--
nosy: +python-dev

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6dc5c4ba7544 by Raymond Hettinger in branch '2.7':
Issue 13355:  Make random.triangular degrade gracefully when low == high.
http://hg.python.org/cpython/rev/6dc5c4ba7544

--

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7ea6c8eb91e2 by Raymond Hettinger in branch '3.4':
Issue 13355:  Make random.triangular degrade gracefully when low == high.
http://hg.python.org/cpython/rev/7ea6c8eb91e2

--

___
Python tracker 

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



[issue13355] random.triangular error when low = high=mode

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Stefan.   For us, I don't see the need to add a restriction, possibly 
breaking code that is currently working fine (with high < mode <= low).  The 
important part is that we now allow low==mode or high==mode and  have a smooth 
transition to low==high.

--

___
Python tracker 

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



[issue21576] Overwritten (custom) uuid inside dictionary

2014-05-25 Thread beta

beta added the comment:

import copy

ship = {'Name': 'Slagschip', 'Blocks': 5}

shipData = copy.deepcopy(ship) # needed, otherwise linked-object
shipData['uuid'] = Id # unique Id

Is this the correct Python behavior?

--
resolution:  -> not a bug

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Added tests that include the pure python sets.Set().  Only the binary 
or/and/sub/xor methods are tested.   

The comparison operators were designed to only interact with their own kind.  A 
comment from Tim Peters explains the decision raise a TypeError instead of 
returning NotImplemented (it has unfortunate interactions with cmp()).  At any 
rate, nothing good would come from changing that design decision now, so I'm 
leaving it alone to fade peacefully into oblivion.

--
Added file: http://bugs.python.org/file35357/fix_set_abc3.diff

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, remove unscrollable (test2) tree widget (review response).

--

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

0. I pushed a slight revision of the patch. See 2) for the main change. In 
htest, I also did 3), corrected some line spacing issues, and changed 
'focussing' to the US spelling 'focusing'. A tested 2.7 version of the 
attached, htest-25052014-34.py, is top priority.

1. parent.mainloop() - ClassBrower, EditorWindow, PathBrowser: since mainloop 
is already running, this should have no effect. I had no problem with closing 
of child window closing parent. Perhaps there is an OS difference, perhaps 
related to the focus difference. Or this might even be a tk or tkinter bug in 
not masking OS differences. If the line is necessary for #nix, it seems 
harmless on Windows.

2. Let us remember that the purpose of htest is to test what cannot be sensibly 
tested with automated unittests. That includes the visual look of widgets and 
some behaviors that either cannot be automatically tested or that we currently 
do not know how to test.

The format paragragh methods and functions are well tested, better than a human 
will, in the current test_formatgraph unittest. I removed this part of the 
patch. (But see 5. below about moving it.)

When I wrote the notes that became htest.txt, a year ago, I had not written any 
tests other than for calltips. I listed almost all the files that had existig 
tests.  So don't add new tests not mentioned in htest.txt without discussion. 
And question the existing and proposed tests listed there.

For instance, I presume we can use the Text.tag_methods to write an automated 
ColorDelegator test that checks that tagged words are as expected and that 
colors match the configured values. We can leave the current test (with patch), 
until replaced.


3. Class/PathBrowser: not only does double clicking 'not work', it causes an 
exception to be printed to console or shell, but which seems to be ignored as 
test continues. The exception is either like this

Exception in Tkinter callback
Traceback (most recent call last):
  File "F:\Python\dev\4\py34\lib\idlelib\run.py", line 121, in main
seq, request = rpc.request_queue.get(block=True, timeout=0.05)
  File "F:\Python\dev\4\py34\lib\queue.py", line 175, in get
raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Python\dev\4\py34\lib\tkinter\__init__.py", line 1487, in __call__
return self.func(*args)
  File "F:\Python\dev\4\py34\lib\idlelib\TreeWidget.py", line 122, in flip
self.item.OnDoubleClick()
  File "F:\Python\dev\4\py34\Lib\idlelib\ClassBrowser.py", line 174, in 
OnDoubleClick
edit = PyShell.flist.open(self.file)
AttributeError: 'module' object has no attribute 'flist'

or with just the AttributeError. Unless and until we can suppress the 
traceback, the message should be changed from 'not work' to 'will print a 
traceback for an exception that is ignored'. [done]

4. Please comment on point 4 in msg219055.

5. Possible followup idea: By reviewing and running tests for classes I have 
not previously paid attention to, I learned something about them.  After htest 
is done, polish the test explanations as appropriate to explain each class to 
someone not familiar with it. Revise run() to start as follows: 

def run(*tests, *, test_list=None):
if test_list is None: test_list = []

Add htour.py (for instance) with a callable and spec for non-htested classes 
(and behaviors). It could begin like this
---
from idlelib.idle_test.htest import run

def _format_paragraph(parent): ...(such as in current patch)

_format_paragraph_spec = ...(such as in current patch)

tour_list = [(_format_paragraph, _format_paragraph_spec),]
# automate by scanning globals for callables and grabbing matching specs

run(test_list=tour_list)
---
This should be a separate issue that follows on this one. If you feel like 
expanding the above to a preliminary patch, go ahead.

6. For me, many of the htest geometry increments are too small. Example:
root.geometry("+%d+%d"%(x, y + 150) # percolator

--
Added file: http://bugs.python.org/file35356/htest-25052014-34.diff

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7eea8f608c2 by Terry Jan Reedy in branch '3.4':
Issue #21477: Idle htest: modify run; add more tests.
http://hg.python.org/cpython/rev/d7eea8f608c2

--

___
Python tracker 

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



[issue12972] Color prompt + readline

2014-05-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the followup. This should be useful info for anyone who finds this 
issue.

--

___
Python tracker 

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



[issue18622] reset_mock on mock created by mock_open causes infinite recursion

2014-05-25 Thread Florent Xicluna

Florent Xicluna added the comment:

I've been bitten by this issue with a custom psycopg2 mock.

>>> cur = mock.Mock()
>>> 
>>> cur.connection.cursor.return_value = cur
>>> cur.reset_mock()
RuntimeError: maximum recursion depth exceeded

the patch looks ok, except the mix of tab and spaces :-)

--
nosy: +flox

___
Python tracker 

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



[issue21493] Add test for ntpath.expanduser

2014-05-25 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Here's an updated patch.

--
Added file: http://bugs.python.org/file35355/issue21493.patch

___
Python tracker 

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



[issue10203] sqlite3.Row doesn't support sequence protocol

2014-05-25 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Thanks. Here's the updated patch. It supports negative indeces (my previous 
patch didn't do that).

--
Added file: http://bugs.python.org/file35354/issue10203.patch

___
Python tracker 

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



[issue21493] Add test for ntpath.expanduser

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. But most other tests in this file use tester() to test str and bytes. And 
it would be good to test multicomponent arguments (e.g. '~test\\foo\\bar' and 
'~/foo/bar').

--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue12972] Color prompt + readline

2014-05-25 Thread Damian

Damian added the comment:

Just a quick comment that I ran into this again, but turns out that it's not an 
issue with python. Rather, this is a quirk with how readline works...

https://stackoverflow.com/questions/9468435/look-how-to-fix-column-calculation-in-python-readline-if-use-color-prompt

Color prompts need to be wrapped by RL_PROMPT_START_IGNORE and 
RL_PROMPT_END_IGNORE.

--

___
Python tracker 

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



[issue21575] list.sort() should show arguments in tutorial

2014-05-25 Thread Éric Araujo

Éric Araujo added the comment:

I assume it is on purpose that the tutorial does not show all methods with all 
their arguments.  It could overwhelm readers with too much information, and 
would also duplicate the full doc that’s in the reference.

A link from this tutorial page to the list reference (and maybe the sorting 
howto) could be a good addition.

--

___
Python tracker 

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



[issue21560] gzip.write changes trailer ISIZE field before type checking - corrupted gz file after trying to write string

2014-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: needs patch -> test needed

___
Python tracker 

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



[issue10203] sqlite3.Row doesn't support sequence protocol

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. Perhaps it is worth to add a test for negative indices (valid (-1) and 
invalid (< -length)).

--

___
Python tracker 

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



[issue10203] sqlite3.Row doesn't support sequence protocol

2014-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Adding tests for non-set iterables as suggested by Serhiy.

--
Added file: http://bugs.python.org/file35353/fix_set_abc2.diff

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
versions: +Python 2.7, Python 3.4

___
Python tracker 

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



[issue21343] os.path.relpath returns inconsistent types

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In Python 2 str is coerced to unicode, so most functions should return the same 
(or compatible) result for str and unicode argument if it contains only 7-bit 
ASCII characters. Of course there are several obvious exceptions, such as 
type() or repr(). And presumably there are several bugs.

Apparently the actual bug in your case is that 
os.path.relpath(u'test_srcl.txt', u'.') and os.path.relpath(u'test_srcl.txt', 
'.') return totally different results.

What are os.getcwd(), os.getcwdu(), ntpath.abspath(ntpath.normpath(p)) for p in 
[u'test_srcl.txt', 'test_srcl.txt', u'.', '.'] in your case?

--

___
Python tracker 

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



[issue21477] Idle: improve idle_test.htest

2014-05-25 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Modifications in htest-25052014.diff

1. ClassBrowser, PathBrowser, EditorWindow no longer close parent when closed

2. Sample code in _color_delegator changed to string, instead of reading from 
file.

3. String text change for Tooltip.

4.  Adds htest for FormatParagraph, Percolator, EditorWindow(rather uncomment's 
spec),  StackViewer, KeyBinding

5. Modification to run based on review comments at 
http://bugs.python.org/review/21477/diff/11937/Lib/idlelib/idle_test/htest.py

6. Other cosmetic changes to spec string 'msg' text.

When this diff(subject to passing review and feedback) is pushed, I will make a 
corresponding patch for 2.7

--
Added file: http://bugs.python.org/file35352/htest-25052014.diff

___
Python tracker 

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



[issue18381] unittest warnings counter

2014-05-25 Thread Berker Peksag

Berker Peksag added the comment:

I get a test failure when I run the test suite with unittest.patch:

test_Exit (unittest.test.test_program.Test_TestProgram) ... test test_unittest 
crashed -- Traceback (most recent call last):
  File "/home/berker/projects/cpython-default/Lib/test/regrtest.py", line 1278, 
in runtest_inner
test_runner()
  File "/home/berker/projects/cpython-default/Lib/test/test_unittest.py", line 
8, in test_main
support.run_unittest(unittest.test.suite())
  File "/home/berker/projects/cpython-default/Lib/test/support/__init__.py", 
line 1764, in run_unittest
_run_suite(suite)
  File "/home/berker/projects/cpython-default/Lib/test/support/__init__.py", 
line 1730, in _run_suite
result = runner.run(suite)
  File "/home/berker/projects/cpython-default/Lib/unittest/runner.py", line 
178, in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 647, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 597, 
in run
testMethod()
  File 
"/home/berker/projects/cpython-default/Lib/unittest/test/test_program.py", line 
119, in test_Exit
testLoader=self.FooBarLoader())
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 726, 
in assertRaises
return context.handle('assertRaises', callableObj, args, kwargs)
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 173, 
in handle
callable_obj(*args, **kwargs)
  File "/home/berker/projects/cpython-default/Lib/unittest/main.py", line 93, 
in __init__
self.runTests()
  File "/home/berker/projects/cpython-default/Lib/unittest/main.py", line 244, 
in runTests
self.result = testRunner.run(self.test)
  File "/home/berker/projects/cpython-default/Lib/unittest/runner.py", line 
178, in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 87, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/suite.py", line 125, 
in run
test(result)
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 647, 
in __call__
return self.run(*args, **kwds)
  File "/home/berker/projects/cpython-default/Lib/unittest/case.py", line 597, 
in run
testMethod()
  File 
"/home/berker/projects/cpython-default/Lib/unittest/test/test_program.py", line 
60, in testFail
assert False
AssertionError

The new patch (see issue18381.diff) fixes that failure. Other changes:

* Added documentation
* Added a test case for addWarning and TestResult.warnings
* Added "print warning" feature

--
nosy: +berker.peksag
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file35351/issue18381.diff

___
Python tracker 

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



[issue21343] os.path.relpath returns inconsistent types

2014-05-25 Thread Matt Bachmann

Matt Bachmann added the comment:

Perhaps this is the bug I should be filing but here is why this comes up for 
me. 

I get different output from this function if I pass in two types.

On my machine:
os.path.relpath(u'test_srcl.txt', u'.') returns u'test_src.txt'
os.path.relpath(u'test_srcl.txt', '.') returns 
u'../../Users/bachmann/Code/diff-cover/diff_cover/tests/fixtures/test_src.txt'

I make a couple calls to this function, if the first call gives me back a byte 
string and I pass it to the second call I get the incorrect result. So I need 
to decode.

If the function always gave back the same type as I gave it I would not have 
this issue.

--

___
Python tracker 

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



[issue21565] multiprocessing: use contex-manager protocol for synchronization primitives

2014-05-25 Thread Charles-François Natali

Charles-François Natali added the comment:

Committed (I've added a versionchanged as suggested by Antoine), closing.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21343] os.path.relpath returns inconsistent types

2014-05-25 Thread Matt Bachmann

Matt Bachmann added the comment:

There is a difference! '.' is a bytes string and u'.' is a unicode one! 

I found this problem because I work on a project that supports both python2 and 
python3.

In python3 I pass in unicode I get back unicode. In python2.7 I pass in unicode 
and I get back a bytes string. We need to ensure that all data in the system is 
unicode. 

Under 2.7 I get unicode sometimes and bytes other times so I need to do this 
ugly check 

root_rel_path = os.path.relpath(self._cwd, self._root)
if isinstance(root_rel_path, six.binary_type):
root_rel_path = root_rel_path.decode()

in order to ensure that my string is once again of the correct type.

--

___
Python tracker 

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



[issue17679] sysconfig generation uses some env variables multiple times

2014-05-25 Thread Florent Rougon

Changes by Florent Rougon :


--
nosy: +frougon

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, interesting - I completely missed the comparison operators in my patch and 
tests. Your version looks good to me, though.

That looks like a patch against 2.7 - do you want to add 2.7 & 3.4 back to the 
list of target versions for the fix?

--

___
Python tracker 

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



[issue21576] Overwritten (custom) uuid inside dictionary

2014-05-25 Thread beta

New submission from beta:

Results:
Block: 2d = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 0} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 0}
Block: 2e = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 0} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 0}
Block: 2f = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 0} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 0}
Block: 8c = {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 1} same as {'Blocks': 
2, 'Name': 'Mijnenveger', 'uuid': 1}
Block: 8d = {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 1} same as {'Blocks': 
2, 'Name': 'Mijnenveger', 'uuid': 1}
Block: 4e = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 2} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 2}
Block: 4f = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 2} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 2}
Block: 4g = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 2} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 2}
Block: 4h = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 2} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 2}
Block: 6d = {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3} same as {'Blocks': 
2, 'Name': 'Mijnenveger', 'uuid': 3}
Block: 6e = {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3} same as {'Blocks': 
2, 'Name': 'Mijnenveger', 'uuid': 3}
Block: d3 = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 4} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 4}
Block: d4 = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 4} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 4}
Block: d5 = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 4} same as {'Blocks': 3, 
'Name': 'Fregatten', 'uuid': 4}
Block: 10h = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5} same as {'Blocks': 
3, 'Name': 'Fregatten', 'uuid': 5}
Block: 10i = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5} same as {'Blocks': 
3, 'Name': 'Fregatten', 'uuid': 5}
Block: 10j = {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5} same as {'Blocks': 
3, 'Name': 'Fregatten', 'uuid': 5}
Block: j3 = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 6} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 6}
Block: j4 = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 6} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 6}
Block: j5 = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 6} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 6}
Block: j6 = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 6} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 6}
Block: 10d = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 7}
Block: 10e = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 7}
Block: 10f = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 7}
Block: 10g = {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7} same as {'Blocks': 4, 
'Name': 'Kruiser', 'uuid': 7}

Actually SetPositions = {} result:
{   '10d': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'10e': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'10f': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'10g': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'10h': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'10i': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'10j': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'2d': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'2e': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'2f': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'4e': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'4f': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'4g': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'4h': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'6d': {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3},
'6e': {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3},
'8c': {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3},
'8d': {'Blocks': 2, 'Name': 'Mijnenveger', 'uuid': 3},
'd3': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'd4': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'd5': {'Blocks': 3, 'Name': 'Fregatten', 'uuid': 5},
'j3': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'j4': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'j5': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7},
'j6': {'Blocks': 4, 'Name': 'Kruiser', 'uuid': 7}}

uuid are overwritten, but where? It seems like a Python bug, but don't really 
know to be sure, so sorry if it isn't one.

--
files: 1.py
messages: 219090
nosy: beta990
priority: normal
severity: normal
status: open
title: Overwritten (custom) uuid inside dictionary
versions: Python 3.4
Added file: http://bugs.python.org/file35350/1.py

___
Python tracker 

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



[issue19925] Add unit test for spwd module

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed with some changes. geteuid() is used instead getuid(), and checked 
that os.geteuid exists (see test_shutil). Checked deprecated attributes sp_nam 
and sp_pwd. Added tests for the calling getspnam() with wrong number of 
arguments and with bytes (on 3.x) or unicode (2.7) name.

Thank you Vajrasky for your contribution.

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

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-05-25 Thread Andy Maier

Andy Maier added the comment:

The pydoc.py of Python 3.4 that supposedly has been fixed has a lot of changes 
compared to 2.7, but the place where I applied my "fix" in TextDoc.docclass() 
is unchanged.

So it seems that my fix should be regarded only to be a quick fix, and the real 
fix would be somewhere in the 3.4 pydoc.py. I tried to understand the changes 
but gave up after a while. My quick fix (with a better text than one that 
contains "TBD") is still better than not having it fixed, but more ideally the 
real fix should be rolled back to the 2.7 pydoc.py.

Is there anything else I can do to help with this bug?

--

___
Python tracker 

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



[issue19925] Add unit test for spwd module

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c35274fe5b35 by Serhiy Storchaka in branch '2.7':
Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/c35274fe5b35

New changeset 9bdbe0b08dff by Serhiy Storchaka in branch '3.4':
Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/9bdbe0b08dff

New changeset 4b187f5aa960 by Serhiy Storchaka in branch 'default':
Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/4b187f5aa960

--
nosy: +python-dev

___
Python tracker 

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



[issue21565] multiprocessing: use contex-manager protocol for synchronization primitives

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9724eb19f6d0 by Charles-François Natali in branch 'default':
Issue #21565: multiprocessing: use contex-manager protocol for synchronization
http://hg.python.org/cpython/rev/9724eb19f6d0

--
nosy: +python-dev

___
Python tracker 

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



[issue21575] list.sort() should show arguments in tutorial

2014-05-25 Thread Jan-Philip Gehrcke

New submission from Jan-Philip Gehrcke:

Currently, the tutorial for the list sort method does not show allowed 
arguments:


list.sort()
Sort the items of the list in place.

(see e.g. https://docs.python.org/3.4/tutorial/datastructures.html)

Is there a reason why we do not show the arguments there? For simplicity? One 
should note that a web search for Python's list methods ranks that page pretty 
high. We could list the defaults, as in the built-in help:

 L.sort(cmp=None, key=None, reverse=False)

And could link to https://docs.python.org/2/library/functions.html#sorted for 
an explanation.

--
assignee: docs@python
components: Documentation
messages: 219085
nosy: docs@python, eric.araujo, ezio.melotti, georg.brandl, jgehrcke
priority: normal
severity: normal
status: open
title: list.sort() should show arguments in tutorial
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue20766] reference leaks in pdb

2014-05-25 Thread Xavier de Gaye

Xavier de Gaye added the comment:

An improved patch with a test case.

--
Added file: http://bugs.python.org/file35349/refleak_2.patch

___
Python tracker 

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



[issue19385] dbm.dumb should be consistent when the database is closed

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no need to speed up methods which do IO (__getitem__, __setitem__, 
__delitem__). However method which works only with an index (keys, iterkeys, 
__contains__, __len__) can be optimized. In the __contains__ method an 
exception can be raised not only by nen-existent __contains__ of None, but from 
__hash__ or __eq__ methods of a key, so we should distinguish these cases.

--
stage: resolved -> patch review
versions: +Python 3.4
Added file: http://bugs.python.org/file35348/issue19385_speed_2.patch

___
Python tracker 

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



[issue19925] Add unit test for spwd module

2014-05-25 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Thanks, Serhiy, for the review! Here is the updated patch.

--
Added file: http://bugs.python.org/file35347/unittest_for_spwd_v3.patch

___
Python tracker 

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



[issue18918] help('FILES') finds no documentation

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed in Python 3. Thanks Claudiu.

But it is not clear why this topic is absent in 2.7.

--
nosy: +serhiy.storchaka
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue18918] help('FILES') finds no documentation

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3fa76139c908 by Serhiy Storchaka in branch '3.4':
Issue #18918: Removed non-existing topic from a list of available topics.
http://hg.python.org/cpython/rev/3fa76139c908

New changeset e5bac5b2f38d by Serhiy Storchaka in branch 'default':
Issue #18918: Removed non-existing topic from a list of available topics.
http://hg.python.org/cpython/rev/e5bac5b2f38d

--
nosy: +python-dev

___
Python tracker 

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



[issue19925] Add unit test for spwd module

2014-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
type:  -> enhancement
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue21574] Port image types detections from PIL to the imghdr module

2014-05-25 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Sounds good, I'll create a patch.

--

___
Python tracker 

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



[issue21574] Port image types detections from PIL to the imghdr module

2014-05-25 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

It would be good to add support of all image types which are supported in PIL 
to the imghdr module.

--
components: Library (Lib)
keywords: easy
messages: 219078
nosy: Claudiu.Popa, effbot, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Port image types detections from PIL to the imghdr module
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue20197] Support WebP image format detection in imghdr module

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Fabrice and Claudiu.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue20197] Support WebP image format detection in imghdr module

2014-05-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4fd17e28d4bf by Serhiy Storchaka in branch 'default':
Issue #20197: Added support for the WebP image type in the imghdr module.
http://hg.python.org/cpython/rev/4fd17e28d4bf

--
nosy: +python-dev

___
Python tracker 

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



[issue8743] set() operators don't work with collections.Set instances

2014-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Attaching a draft patch with tests.

--
Added file: http://bugs.python.org/file35346/fix_set_abc.diff

___
Python tracker 

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



[issue20197] Support WebP image format detection in imghdr module

2014-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue21331] Reversing an encoding with unicode-escape returns a different result

2014-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue21343] os.path.relpath returns inconsistent types

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Why you should check the type? There is no difference between '.' and u'.'.

--

___
Python tracker 

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



[issue21552] String length overflow in Tkinter

2014-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a little simpler patch. Instead of checking string length in custom 
converter, it is checked after invocation of PyArg_ParseTuple. Also added 
bigmem tests.

--
Added file: http://bugs.python.org/file35345/tkinter_strlen_overflow_alt.patch

___
Python tracker 

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