[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread eryksun

eryksun added the comment:

bytes.__str__ can already raise either a warning (-b) 

 str('abcäöü'.encode('utf-8'))
__main__:1: BytesWarning: str() on a bytes instance
b'abc\\xc3\\xa4\\xc3\\xb6\\xc3\\xbc'

or error (-bb), which applies equally to implicit conversion by print():

 print('abcäöü'.encode('utf-8'))
Traceback (most recent call last):
  File stdin, line 1, in module
BytesWarning: str() on a bytes instance

--
nosy: +eryksun

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



[issue22785] range docstring is less useful than in python 2

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aa6b73823685 by Benjamin Peterson in branch '3.4':
improved range docstring (closes #22785)
https://hg.python.org/cpython/rev/aa6b73823685

New changeset c031fa8e6884 by Benjamin Peterson in branch 'default':
merge 3.4 (#22785)
https://hg.python.org/cpython/rev/c031fa8e6884

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

In Python 2, the unicode() constructor does not accept bytes arguments, unless 
an encoding argument is given:

 unicode(u'abcäöü'.encode('utf-8'))
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal 
not in range(128)

In Python 3, the str() constructor masks this programming error by returning 
the repr() of the bytes object:

 str('abcäöü'.encode('utf-8'))
b'abc\\xc3\\xa4\\xc3\\xb6\\xc3\\xbc'

I think it would be more helpful to point the programmer to the most probably 
missing encoding argument by raising an error.

Also note that you get a different output with encoding argument set:

 str('abcäöü'.encode('utf-8'), 'utf-8')
'abcäöü'

I know this is documented, but it is still not very helpful and can easily hide 
errors.

--
components: Interpreter Core, Unicode
messages: 241800
nosy: ezio.melotti, haypo, lemburg
priority: normal
severity: normal
status: open
title: str(bytes_obj) should raise an error
versions: Python 3.5, Python 3.6

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



[issue24027] IMAP library lacks documentation about expected parameter types

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

Documentation patches are welcome.  imaplib has not seen much attention for 
quite some time (though there is currently someone interested in working on it, 
so that may change).

Please open a separate issue for the utf7 enhancement proposal.

--
components: +email
nosy: +barry, r.david.murray
versions: +Python 3.5

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



[issue16840] Tkinter doesn't support large integers

2015-04-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


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

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



[issue24023] Django tutorial 2 not able to create a superuser on Windows 7

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 23995.

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - msvcrt could not be imported

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



[issue24026] Python hangs forever in wait() of threading.py

2015-04-22 Thread appidman

New submission from appidman:

I use paramiko to create SSH sessions to Linux machines, which works great 95% 
of the time. But sometimes, the Python process which creates the SSH session 
hangs forever in wait() of threading.py (see attachment 'gdb.txt' for full 
output).

{code}
(gdb) py-list
 239waiter.acquire()
 240self.__waiters.append(waiter)
 241saved_state = self._release_save()
 242try:# restore state no matter what (e.g., 
KeyboardInterrupt) 
 243if timeout is None:
244waiter.acquire()
 245if __debug__:
 246self._note(%s.wait(): got it, self)
 247else:
 248# Balancing act:  We can't afford a pure busy loop, so 
we
 249# have to sleep; but if we sleep the whole timeout time,


(gdb) py-bt
#5 Frame 0xb459a5c, for file /usr/lib/python2.7/threading.py, line 244, in wait 
(self=_Condition(_Verbose__verbose=False, _Condition__lock=thread.lock at 
remote 0xaf7e3a0, acquire=built-in method acquire of thread.lock object at 
remote 0xaf7e3a0, _Condition__waiters=[thread.lock at remote 0xaf7e100], 
release=built-in method release of thread.lock object at remote 0xaf7e3a0) at 
remote 0xb73708c, timeout=None, waiter=thread.lock at remote 0xaf7e100, 
saved_state=None)
waiter.acquire()
#9 Frame 0xb66118c, for file 
/usr/lib/python2.7/dist-packages/paramiko/buffered_pipe.py, line 137, in read 
(self=BufferedPipe(_closed=False, _lock=thread.lock at remote 0xaf7e3a0, 
_buffer=array.array at remote 0xb737ea0, _event=None, 
_cv=_Condition(_Verbose__verbose=False, _Condition__lock=thread.lock at 
remote 0xaf7e3a0, acquire=built-in method acquire of thread.lock object at 
remote 0xaf7e3a0, _Condition__waiters=[thread.lock at remote 0xaf7e100], 
release=built-in method release of thread.lock object at remote 0xaf7e3a0) at 
remote 0xb73708c) at remote 0xb737a4c, nbytes=8192, timeout=None, out='', 
then=float at remote 0xb57efe4)
self._cv.wait(timeout)
{code}

--
components: Library (Lib)
files: gdb.txt
messages: 241806
nosy: appidman
priority: normal
severity: normal
status: open
title: Python hangs forever in wait() of threading.py
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file39167/gdb.txt

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



[issue24024] str.__doc__ needs an update

2015-04-22 Thread Marc-Andre Lemburg

New submission from Marc-Andre Lemburg:

In Python 3.4.3, the doc string of the str() builtin still reads:

str(object='') - str\nstr(bytes_or_buffer[, encoding[, errors]]) - 
str\n\nCreate a new string object from the given object. If encoding or\nerrors 
is specified, then the object must expose a data buffer\nthat will be decoded 
using the given encoding and error handler.\nOtherwise, returns the result of 
object.__str__() (if defined)\nor repr(object).\nencoding defaults to 
sys.getdefaultencoding().\nerrors defaults to 'strict'.

This no longer matches what str() does. sys.getdefaultencoding() always returns 
'utf-8' and str() accepts bytes, bytearray or buffer-like objects as input when 
using an encoding, any object with .__str__() method defined or repr(obj) 
otherwise.

--
components: Interpreter Core, Unicode
messages: 241798
nosy: ezio.melotti, haypo, lemburg
priority: normal
severity: normal
status: open
title: str.__doc__ needs an update
versions: Python 3.4, Python 3.5, Python 3.6

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-04-22 Thread Cyd Haselton

Cyd Haselton added the comment:

Still working at this; I can't get the readline module to work.  It is built 
successfully but importing it produces the following error:

Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: dlopen failed: could not load library libreadline.so.6 needed by 
readline.cpython-35m-arm-linux-gnueabi.so; caused by cannot locate symbol 
tgetnum referenced by libreadline.so.6...

tgetnum is undefined in libreadline but defined in -libncurses and libtinfo. 
I've built and re-built readline (--with-curses and -without that 
option...linking -lncurses, then -lncurses and -ltinfo) in the KBOX 
environment. I've edited Modules/Setup and setup.py so as to specify the 
readline library plus a combination of others (-ncurses, -tinfo) to no avail.

--

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



[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

Sounds like we should close this as rejected, then.  Serhiy's point is a good 
one.  Maybe not the way we'd design the api from scratch, but it's what we've 
got and it serves a purpose.

--

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



[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

Just saw this on x86 Tiger 3.x:

==
FAIL: test_imap_unordered_handle_iterable_exception 
(test.test_multiprocessing_fork.WithProcessesTestPool)
--
Traceback (most recent call last):
  File 
/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/_test_multiprocessing.py,
 line 1805, in test_imap_unordered_handle_iterable_exception
self.assertEqual(next(it), i*i)
AssertionError: 1 != 0

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9559/steps/test/logs/stdio

The patch looks good to me. I'm not familiar with the test code, but Serhiy's 
suggestion also looks good to me.

--
nosy: +berker.peksag

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



[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I agree with closing this as won't fix.

It is true that the encoding keyword argument is only useful when passing in 
byte strings or (and that's also where it originated in Python 2: the default 
string type is a byte string), but even in Python 3, this is still one of the 
main uses of the str() constructor.

Note that it's not uncommon to have arguments only be useful for certain types 
of input objects. See e.g. the int() constructor base argument for similar 
example.

--
nosy: +lemburg

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



[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In Python 2, the unicode() constructor accepts bytes argument if it is 
decodeable with sys.getdefaultencoding().

 unicode(b'abc')
u'abc'
 import sys
 reload(sys)
module 'sys' (built-in)
 sys.setdefaultencoding(utf-8)
 unicode(u'abcäöü'.encode('utf-8'))
u'abc\xe4\xf6\xfc'

In Python 3, the str() constructor does not accept bytes arguments if Python is 
ran with -bb option.

--
nosy: +serhiy.storchaka

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



[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

str accepting bytes and returning the repr was a conscious design choice, as 
evidenced by the -bb option, and I'm sure there is code that is both 
unintentionally and *intentionally* using this, despite the warning.  Unless we 
want to discuss making the -bb behavior the default in a future version of 
python, this issue should be closed.

--
nosy: +r.david.murray

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



[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 22.04.2015 15:52, R. David Murray wrote:
 str accepting bytes and returning the repr was a conscious design choice, as 
 evidenced by the -bb option, and I'm sure there is code that is both 
 unintentionally and *intentionally* using this, despite the warning.  Unless 
 we want to discuss making the -bb behavior the default in a future version of 
 python, this issue should be closed.

I guess that would be helpful, yes.

Here's the original patch which introduced -b and -bb:

http://bugs.python.org/issue1392

This was Guido's answer back then:


I'll look at the patches later, but we've gone over this before on the
list. str() of *any* object needs to return *something*. Yes, it's
unfortunate that this masks bugs in the transitional period, but it
really is the best thing in the long run. We had other exceptional
treatement for str vs. bytes (e.g. the comparison was raising TypeError
for a while) and we had to kill that too.


I'm not sure what the transitional period refers to, though.
It's 8 years later now and doesn't look like str(bytes_object) will
go away a source of subtle bugs anytime soon :-)

--

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



[issue24026] Python hangs forever in wait() of threading.py

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

This could easily be a programming error.  We'd need a cut down reproducer to 
know if it is a python bug and be able to fix it if so.  Have you reported this 
to paramiko?

--
nosy: +r.david.murray

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



[issue20851] Update devguide to cover testing from a tarball

2015-04-22 Thread Brett Cannon

Brett Cannon added the comment:

I don't know if Larry is planning to do tarball releases for 3.5 (added him to 
the nosy to see).

As for the install step, it would be best to suggest people install to a temp 
directory so they don't accidentally end up with a beta release stuck on their 
machines, e.g. `make --prefix=/tmp/cpython`.

--
nosy: +larry

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



[issue24027] IMAP library lacks documentation about expected parameter types

2015-04-22 Thread Pablo

New submission from Pablo:

I used the IMAP library and I feel it lacks a lot of documentation regarding 
types and encoding.

Example:
IMAP4.list([directory[, pattern]]):
It doesn't state if it expects the directory argument to be an string (unicode) 
or a imap_utf7 encoded string or bytes.
It also expects names with spaces to be between double quotation marks and it 
doesn't state that it returns a bytes raw output.

This is valid for every function that receives a directory or mailbox argument. 
Also for most return values.

Documentation aside, I think it would be a nice improvement in the 
implementation to add an imap_utf7 convertion function, and check every 
directory or mailbox argument to see if it has characters outside the imap_utf7 
charset and attempts to convert them automatically.

--
assignee: docs@python
components: Documentation
messages: 241812
nosy: docs@python, pmoleri
priority: normal
severity: normal
status: open
title: IMAP library lacks documentation about expected parameter types
type: enhancement
versions: Python 3.4

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



[issue17570] Improve devguide Windows instructions

2015-04-22 Thread Steve Dower

Steve Dower added the comment:

Right at the end of the patch, .hg/hgrc also exists on Windows and is not the 
same as mercurial.ini - hgrc here is per-repo and it seems from the context 
that this is relevant here.

Otherwise, the rest looks good to me. I'll merge it in when I get a chance, 
unless someone else gets there first.

--

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



[issue17570] Improve devguide Windows instructions

2015-04-22 Thread Carol Willing

Carol Willing added the comment:

This patch addresses Ezio's original issue in msg185482 to improve the Windows 
instructions on the committing page of the devguide.

I have tried to match the style of the Getting Started page when 
distinguishing UNIX (Mac OS X) commands from Windows commands. Please take 
extra care during review that the Windows commands documented are correct.

Barring reviewer changes, this patch should close this issue.

--
assignee:  - willingc
nosy: +willingc
stage: needs patch - patch review
Added file: http://bugs.python.org/file39168/iss17570.patch

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



[issue24025] str(bytes_obj) should raise an error

2015-04-22 Thread R. David Murray

R. David Murray added the comment:

Yeah, that's why I run tests with -bb myself.  Except that there was a bug in 
-W/-bb handling that meant I wasn't really...and that bit me because there is 
at least one buildbot that really does, and it complained...

(Although in that case the 'bug' was really benign, since it was just optional 
debug print output for which the repr of the bytes was actually fine.)

--

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



[issue23917] please fall back to sequential compilation when concurrent doesn't exist

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Claudiu.

--
nosy: +berker.peksag
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue23917] please fall back to sequential compilation when concurrent doesn't exist

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 572dc6bdc0a3 by Berker Peksag in branch 'default':
Issue #23917: Fall back to sequential compilation when ProcessPoolExecutor 
doesn't exist.
https://hg.python.org/cpython/rev/572dc6bdc0a3

--
nosy: +python-dev

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



[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Please don't deprecate the encoding parameter in str. It has a use case. str 
constructor works with any bytes-like objects, even with these that don't have 
the decode method. It raises more appropriate TypeError instead of 
AttributeError, so often you don't need to wrap an error.

--
nosy: +serhiy.storchaka

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



[issue24028] Idle: add doc subsection on calltips

2015-04-22 Thread Terry J. Reedy

New submission from Terry J. Reedy:

The doc currently says, in the Edit menu section,

Show call tip
After an unclosed parenthesis for a function, open a small window with 
function parameter hints.

I propose to add the additional information I gave in answer to 
https://stackoverflow.com/questions/29784273/python-idle-wont-show-docstring, 
in a subsubsection before or after the current one on completions 
https://docs.python.org/3/library/idle.html#completions  

'''
Calltips are shown when one types '(' after the name of an *acccessible* 
function.  The calltip should stay displayed until one types ')' or clicks the 
mouse or otherwise moves the cursor to dismiss it.  Cntl-\ brings it back.

A calltip consists of the function signature and the first line of the 
docstring.  For builtins without an accessible signature (such as, in 3.4.3, 
`int` or `bytes`), the calltip consists of all lines up the fifth line or the 
first blank line.

The set of *accessible* functions depends on what modules have been imported 
into the user process (where your code is executed), including those imported 
by Idle itself, and what code has been run (since the last restart).  For 
example, restart the Shell (Cntl-F6), open a new editor window, and enter

itertools.count(

A calltip appears because Idle imports itertools into the user process for its 
own use.  Enter

turtle.write(

and nothing appears, because the Idle does not import turtle.  Cntl-\ does 
nothing either.  Entering

import turtle

above the function call does not immediately help, but if one runs the file to 
perform the import, calltips for turtle functions become available.

The suggests that one might want to run a file after writing the import 
statements at the top, or immediately run an existing file before editing.
'''

--
assignee: terry.reedy
messages: 241815
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle: add doc subsection on calltips
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2015-04-22 Thread Tal Einat

Tal Einat added the comment:

Attaching new patch for unicodeobject.c, which supersedes the previous patches.

I've changed the name of the parameter of str.join() to iterable to match the 
docs. (In the previous patch I had changed it from seq to 
iterable_of_strings.)

I also fixed two minor comments on the doc strings from Martin.

With this, AFAIK, unicodeobject.c should be good to go.

--
Added file: http://bugs.python.org/file39169/unicodeobject.c.v3.patch

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

More rationale from the thread:

 The surprising part is that it also happens for explicit relative
 imports.  I'm guessing that part was unintentional and simply not
 noticed when PEP 328 was implemented.
  

No, that must also have been intentional, because even when you use
relative import, the module you imported knows its full name, and that full
name is used as its key in sys.modules. If someone else uses absolute
import for the same module they should still get the same module object.

--

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

As described here: 
http://news.gmane.org/find-root.php?message_id=20150422115959.1ff2ee58%40limelight.wooz.org

Importing a submodule binds the submodule's name in the parent module's 
namespace.  This is surprising, but it seems intentional and it's relied upon 
by existing code, e.g. asyncio/__init__.py in the stdlib.

It's also not documented afaict.  It should be documented in the Language 
Reference's section on the import system.  After a little more discussion on 
import-sig, I plan on doing that.

--
assignee: barry
components: Documentation
messages: 241816
nosy: barry, brett.cannon
priority: normal
severity: normal
status: open
title: Surprising name binding behavior of submodule imports needs documenting
type: behavior
versions: Python 3.4, Python 3.5

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

From Guido:

It's definitely intentional, and it's fundamental to the package import
design. We've had many implementations of package import (remember ni.py?
last seen as knee.py) and it was always there, because this is done as
part of *submodule loading*. For better or for worse (and because I didn't
know Java at the time :-) Python declares that if you write `import
foo.bar` then later in your code you can use `foo.bar` to reference to the
bar submodule of package foo. And the way this is done is to make each
submodule an attribute of its parent package. This is done when the
submodule is first loaded, and because of the strict separation between
loading and importing, it is done no matter what form of import was used to
load bar.

I guess another thing to realize is that the globals of __init__.py are
also the attribute namespace of the package.

I'm not surprised it's in the reference manual -- that hasn't been updated
thoroughly in ages, and I sometimes cry when I see it. :-) So please do
clarify this for the benefit of future implementers.

--

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



[issue20851] Update devguide to cover testing from a tarball

2015-04-22 Thread Larry Hastings

Larry Hastings added the comment:

I don't plan on doing tarball-only drops during the 3.5 beta/rc period like I 
did during 3.4.  However, when I do a release (e.g. 3.5.0a4), I release Windows 
binaries (built by Steve Dower), OS X binaries (built by Ned Deily), and source 
in tarballs.  If you're on anything but Windows or OS X you have to build it 
yourself, from a tarball.  So it probably makes sense to have instructions in 
the dev guide on how to do it.

--

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



[issue23992] multiprocessing: MapResult shouldn't fail fast upon exception

2015-04-22 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


Removed file: http://bugs.python.org/file39171/mp_map_fail_fast_default.diff

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



[issue23992] multiprocessing: MapResult shouldn't fail fast upon exception

2015-04-22 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


Removed file: http://bugs.python.org/file39170/mp_map_fail_fast_27.diff

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



[issue23992] multiprocessing: MapResult shouldn't fail fast upon exception

2015-04-22 Thread Charles-François Natali

Changes by Charles-François Natali cf.nat...@gmail.com:


Added file: http://bugs.python.org/file39172/mp_map_fail_fast_27.diff
Added file: http://bugs.python.org/file39173/mp_map_fail_fast_default.diff

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



[issue24030] IMAP library encoding enhancement

2015-04-22 Thread Pablo

New submission from Pablo:

IMAP library doesn't encode parameters to the required charset.
The library is useful, but when it comes to complex mailbox names, the user 
needs to convert strings to and from the custom imap_utf7 encoding.
I think this conversion could be implemented in the library and applied 
transparently to all the arguments that need it.

Example:
IMAP4.select(mailbox='INBOX', readonly=False):
For the method to work, the mailbox argument needs to be encoded to imap_utf7 
and if it has spaces it needs to be double quoted. All this hassle could be 
handled by the library.

The same applies to every function that uses a mailbox or directory argument.

When it comes to the mailbox argument I can identify the following cases:
a. bytes: It should be treated as an already imap_utf7 encoded string. If 
necessary it can be converted to string using ascii charset.
b. string:
  b.1: It's a valid imap_utf7 string without '' - doesn't need encoding. Eg.: 
INBOX
  b.2: An already encoded imap_utf7 string with '' character - doesn't need 
encoding. Eg.: TestAOk-
  b.3: Any other case (invalid imap_utf7 string) - needs to be encoded

Proposal:
1. Impelement an imap_utf7_encode() method
2. Implement a strict imap_utf7_decode() method, it must return an error if the 
input doesn't conform to imap_utf7 encoding.
3. Implement a method to ensure arguments are in imap_utf7 encoding:
   * bytes - arg.decode('ascii')
   * string  imap_utf7_decode(arg) - arg
   * otherwise - imap_utf7_encode(arg)
   * In every case if it has spaces double quote the whole string
5. In every method that receives a mailbox or directory argument call this new 
method to ensure it's imap_utf7 encoded.

--
components: Library (Lib), email
messages: 241821
nosy: barry, pmoleri, r.david.murray
priority: normal
severity: normal
status: open
title: IMAP library encoding enhancement
type: enhancement
versions: Python 3.6

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Eric Snow

Eric Snow added the comment:

Guido describes the global invariant for *all* the forms of importing a 
submodule, including explicit relative imports:

 I just mean that for relative import
 there is no need to bind the submodule to the parent, is there?

But there *is* a reason. The submodule must still be an attribute of the parent 
package, because of the invariant that if you have sys.modules['foo'] and 
sys.modules['foo.bar'], the latter must appear as the 'bar' attribute of the 
former. This is an invariant of module loading, and (I feel I'm repeating 
myself) the form of import used does not affect loading.

--
nosy: +eric.snow

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



[issue23992] multiprocessing: MapResult shouldn't fail fast upon exception

2015-04-22 Thread Charles-François Natali

Charles-François Natali added the comment:

Patches for 2.7 and default.

--
keywords: +patch
Added file: http://bugs.python.org/file39170/mp_map_fail_fast_27.diff
Added file: http://bugs.python.org/file39171/mp_map_fail_fast_default.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23992
___diff -r 5576c8240963 Lib/multiprocessing/pool.py
--- a/Lib/multiprocessing/pool.py   Wed Apr 15 19:30:38 2015 +0100
+++ b/Lib/multiprocessing/pool.py   Wed Apr 22 19:34:48 2015 +0100
@@ -599,10 +599,10 @@
 self._number_left = length//chunksize + bool(length % chunksize)
 
 def _set(self, i, success_result):
+self._number_left -= 1
 success, result = success_result
-if success:
+if success and self._success:
 self._value[i*self._chunksize:(i+1)*self._chunksize] = result
-self._number_left -= 1
 if self._number_left == 0:
 if self._callback:
 self._callback(self._value)
@@ -615,15 +615,17 @@
 self._cond.release()
 
 else:
-self._success = False
-self._value = result
-del self._cache[self._job]
-self._cond.acquire()
-try:
-self._ready = True
-self._cond.notify()
-finally:
-self._cond.release()
+if self._success:
+self._success = False
+self._value = result
+if self._number_left == 0:
+del self._cache[self._job]
+self._cond.acquire()
+try:
+self._ready = True
+self._cond.notify()
+finally:
+self._cond.release()
 
 #
 # Class whose instances are returned by `Pool.imap()`
diff -r 5576c8240963 Lib/test/test_multiprocessing.py
--- a/Lib/test/test_multiprocessing.py  Wed Apr 15 19:30:38 2015 +0100
+++ b/Lib/test/test_multiprocessing.py  Wed Apr 22 19:34:48 2015 +0100
@@ -1123,6 +1123,12 @@
 time.sleep(wait)
 return x*x
 
+
+def raise_large_valuerror(wait):
+time.sleep(wait)
+raise ValueError(x * 1024**2)
+
+
 class SayWhenError(ValueError): pass
 
 def exception_throwing_generator(total, when):
@@ -1262,6 +1268,27 @@
 p.close()
 p.join()
 
+def test_map_no_failfast(self):
+# Issue #23992: the fail-fast behaviour when an exception is raised
+# during map() would make Pool.join() deadlock, because a worker
+# process would fill the result queue (after the result handler thread
+# terminated, hence not draining it anymore).
+
+t_start = time.time()
+
+with self.assertRaises(ValueError):
+p = self.Pool(2)
+try:
+p.map(raise_large_valuerror, [0, 1])
+finally:
+time.sleep(0.5)
+p.close()
+p.join()
+
+# check that we indeed waited for all jobs
+self.assertGreater(time.time() - t_start, 0.9)
+
+
 def unpickleable_result():
 return lambda: 42
 
diff -r 21ae8abc1af3 Lib/multiprocessing/pool.py
--- a/Lib/multiprocessing/pool.py   Mon Apr 13 12:30:53 2015 -0500
+++ b/Lib/multiprocessing/pool.py   Wed Apr 22 19:35:31 2015 +0100
@@ -638,22 +638,24 @@
 self._number_left = length//chunksize + bool(length % chunksize)
 
 def _set(self, i, success_result):
+self._number_left -= 1
 success, result = success_result
 if success:
 self._value[i*self._chunksize:(i+1)*self._chunksize] = result
-self._number_left -= 1
 if self._number_left == 0:
 if self._callback:
 self._callback(self._value)
 del self._cache[self._job]
 self._event.set()
 else:
-self._success = False
-self._value = result
-if self._error_callback:
-self._error_callback(self._value)
-del self._cache[self._job]
-self._event.set()
+if self._success:
+self._success = False
+self._value = result
+if self._number_left == 0:
+if self._error_callback:
+self._error_callback(self._value)
+del self._cache[self._job]
+self._event.set()
 
 #
 # Class whose instances are returned by `Pool.imap()`
diff -r 21ae8abc1af3 Lib/test/_test_multiprocessing.py
--- a/Lib/test/_test_multiprocessing.py Mon Apr 13 12:30:53 2015 -0500
+++ b/Lib/test/_test_multiprocessing.py Wed Apr 22 19:35:31 2015 +0100
@@ -1660,6 +1660,10 @@
 def mul(x, y):
 return x*y
 
+def raise_large_valuerror(wait):
+time.sleep(wait)
+raise ValueError(x * 1024**2)
+
 class SayWhenError(ValueError): pass
 
 def 

[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-22 Thread Christie

Christie added the comment:

Hey @berker.peksag, @r.david.murray!

Here's another change set where script_helpers.py is moved with an hg mv (still 
looks in the patch like the file was deleted and re-added, not sure if that's 
expected).

I've ALSO removed some unused imports from script_helpers.py - temp_dir was 
being imported from script_helpers in a few places tho, so I had to fix that. 
If you guys would rather not include that change here, please let me know!

--
Added file: http://bugs.python.org/file39176/iss9517_move_script_helpers.patch

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



[issue10886] Unhelpful backtrace for multiprocessing.Queue

2015-04-22 Thread A.M. Kuchling

A.M. Kuchling added the comment:

neologix: did you intend to re-open this ticket when you made your 2013-03-05 
comment?  It seems to me that you didn't intend to -- your comment doesn't say 
're-opening because reason'.  I'll close it again; if you want, please 
re-open it and just explain why.

--
nosy: +akuchling
resolution:  - wont fix
stage:  - resolved
status: open - closed

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



[issue23887] HTTPError doesn't have a good repr representation

2015-04-22 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: patch review - resolved

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



[issue24031] Add git support to make patchcheck

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

LGTM

--
nosy: +berker.peksag
stage: patch review - commit review

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



[issue22848] Subparser help does not respect SUPPRESS argument

2015-04-22 Thread paul j3

paul j3 added the comment:

A similar Stackoverflow question

http://stackoverflow.com/questions/21692395/hiding-selected-subcommands-using-argparse/21712058#21712058

--

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



[issue24033] Update _test_multiprocessing.py to use script helpers

2015-04-22 Thread Christie

New submission from Christie:

As described in Issue9517, many test modules do not make use of the helpers in 
script_helpers.py to invoke the python interpreter in a subprocess. Issue9517 
will be broken down into several smaller issues so we can address smaller 
change sets.

This issue is to update _test_multiprocessing.py to use script_helpers.py.

--
components: Tests
messages: 241837
nosy: bobcatfish
priority: normal
severity: normal
status: open
title: Update _test_multiprocessing.py to use script helpers
versions: Python 3.5

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



[issue24033] Update _test_multiprocessing.py to use script helpers

2015-04-22 Thread Christie

Christie added the comment:

I am working on this!

--

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-22 Thread Christie

Christie added the comment:

Created issue24033. If it and issue23981 could be added as dependencies of this 
issue (or I could get permission to add them?) that would be swell!

--

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



[issue23713] intermittent failure of multiprocessing unit test test_imap_unordered_handle_iterable_exception

2015-04-22 Thread Davin Potts

Davin Potts added the comment:

Serhiy:  If my comments on your questions make sense, should we go ahead with 
the patch as it is?

--

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



[issue23887] HTTPError doesn't have a good repr representation

2015-04-22 Thread Facundo Batista

Changes by Facundo Batista facu...@taniquetil.com.ar:


--
resolution:  - fixed
status: open - closed

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



[issue23227] Generator's finally block not run if close() called before first iteration

2015-04-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks logical to me. The finally block is only entered if the try 
block is ever entered, but if you don't consume anything in the generator then 
the generator's code is never actually executed.

--
nosy: +pitrou

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



[issue23887] HTTPError doesn't have a good repr representation

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9ea679a92fa by Facundo Batista in branch 'default':
Issue #23887: urllib.error.HTTPError now has a proper repr() representation.
https://hg.python.org/cpython/rev/e9ea679a92fa

--
nosy: +python-dev

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



[issue22501] Optimise PyLong division by 1 or -1

2015-04-22 Thread A.M. Kuchling

A.M. Kuchling added the comment:

From reading the discussion thread, it looks like the consensus is to not 
apply this set of patches because the speed-up is unfortunately small.  
Closing as won't-fix; please re-open if someone wishes to pursue this again.

--
nosy: +akuchling
resolution:  - wont fix
stage: patch review - resolved
status: open - closed

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



[issue23979] Multiprocessing Pool.map pickles arguments passed to workers

2015-04-22 Thread Davin Potts

Davin Potts added the comment:

@Luis:  Before closing this bug, could you give a quick description of the fix 
you put in place?

Two reasons:
1) Someone else encountering this frustration with similar needs might well 
benefit from hearing what you did.
2) To provide evidence that there is demand for a more efficient means of 
communication, demonstrated through workarounds.

Nothing fancy required -- not even code necessarily.

--

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Here's some new text for the Language Reference.

--
Added file: http://bugs.python.org/file39175/issue24029-1.txt

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3968e7a9614c by Barry Warsaw in branch '3.4':
Issue #24029: Document the name binding behavior for submodule imports.
https://hg.python.org/cpython/rev/3968e7a9614c

New changeset 351ad8c4f3a6 by Barry Warsaw in branch '3.4':
Issue #24029: Document the name binding behavior for submodule imports.
https://hg.python.org/cpython/rev/351ad8c4f3a6

New changeset 6295f207dfaa by Barry Warsaw in branch 'default':
Issue #24029: Document the name binding behavior for submodule imports.
https://hg.python.org/cpython/rev/6295f207dfaa

--
nosy: +python-dev

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Cool, thanks!  I'll commit it and we can always clean it up/add to it later if 
needed.

--

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
resolution:  - fixed
status: open - closed

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



[issue24032] urlparse.urljoin does not add query part

2015-04-22 Thread albertsmuktupavels

New submission from albertsmuktupavels:

From documentation:
Construct a full (“absolute”) URL by combining a “base URL” (base) with 
another URL (url). Informally, this uses components of the base URL, in 
particular the addressing scheme, the network location and (part of) the path, 
to provide missing components in the relative URL.

base = http://www.example.com/example/foo.php?param=10
url = bar.php

I am expecting this result:
http://www.example.com/example/bar.php?param=10

But real result is:
http://www.example.com/example/bar.php

This should be easy fixable. Right now query= bquery is done only in one case - 
when path and params are empty.

I think that
if not query:
query = bquery
should be moved before query might be used for first time. that means above 
code should be right after these lines:
if scheme != bscheme or scheme not in uses_relative:
return url

--
messages: 241827
nosy: albertsmuktupavels
priority: normal
severity: normal
status: open
title: urlparse.urljoin does not add query part
type: behavior
versions: Python 2.7

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Christie. Review comments: 
http://bugs.python.org/review/9517/

 (still looks in the patch like the file was deleted and re-added, not sure if 
 that's expected).

I don't know if it's important. I'm using a very old version of Mercurial 
(2.0.2 :)), so it can be related to different Mercurial versions. Attaching a 
patch for reference.

--
dependencies: +Update _test_multiprocessing.py to use script helpers, Update 
test_unicodedata.py to use script_helpers
Added file: http://bugs.python.org/file39177/issue9517.diff

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



[issue24034] Make fails Objects/typeslots.inc

2015-04-22 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

I wrote the patch to replace $(PYTHON).

Changes:
Add TYPESLOTSGEN to configure.ac.  TYPESLOTSGEN values is the built-in python.
If the built-in python is not found, TYPESLOTSGEN echoes message that is 
skipping like ASDLGEN.
Generated the configure script using autoreconf.
Modify Makefile.pre.in to replace $(PYTHON) to $(TYPESLOTSGEN).
And remove $(PYTHON) that isn't used anywhere.  It seems already needless.

Although I understand that the generated file touch can avoid to fail 
regenerate, I want to check built-in python to generate safer the 
Objects/typeslots.inc.

--
keywords: +patch
Added file: 
http://bugs.python.org/file39178/3.4-issue24034-make-fails-typeslots.inc.patch

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



[issue24034] Make fails Objects/typeslots.inc

2015-04-22 Thread Masayuki Yamamoto

New submission from Masayuki Yamamoto:

Objects/typeslots.inc is broken, and make stop on cygwin-1.7.35-i686.

If built-in python is not found in make processing, Objects/typeslots.inc 
generating will fail.
Because Objects/typeslots.inc is generated using $(PYTHON) in Makefile, but  
$(PYTHON) variable is a hard-coding value that isn't check a built-in python 
existent.

make steps to fail and error message:
$ ./configure --prefix=/opt/py34
$ touch Include/typeslots.h
$ make
...
python.exe ./Objects/typeslots.py  ./Include/typeslots.h  
Objects/typeslots.inc
/bin/sh: python.exe: command not found
Makefile:851: recipe for target 'Objects/typeslots.inc' failed
make: *** [Objects/typeslots.inc] Error 127

Cygwin python executable files:
$ find /usr/bin/ -name 'python*.exe'
/usr/bin/python2.7.exe
/usr/bin/python3.2m.exe

--
components: Build, Interpreter Core
messages: 241843
nosy: masamoto
priority: normal
severity: normal
status: open
title: Make fails Objects/typeslots.inc
type: compile error
versions: Python 3.4, Python 3.5

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



[issue24035] When Caps Locked, Shift + alpha-character still displayed as uppercase

2015-04-22 Thread James

New submission from James:

Referring to Python 2.7 running on Windows (7/8): 

At the interactive interpreter, if either 1) Caps are Locked OR 2) Shift is 
held while an alpha-character is selected, the character is output and 
displayed as uppercase, as one would expect. However, in Python 2.7, when Caps 
are Locked AND Shift is held while an alpha-character is selected, the output 
is still uppercase, when it should be lowercase.

This behavior seems to be limited to Python 2(.7), and only when Python is run 
interactively using the Windows console. When Python 2.7 is started through 
Cygwin using mintty on Windows 7/8, the behavior is not reproducible. The same 
goes for IDLE, as well as when running python interactively on Ubuntu. The 
behavior is reproducible using IPython when run in the standard Windows 
console, but is not reproducible when Python is run using the IPython QtConsole.

To summarize:

-   ---
AFFECTED|  |NOT AFFECTED |
--  ---
python 2 via cmd (Windows 7/8) python 3 via cmd(Windows 7/8)
ipython via cmd  (Windows 7/8) IDLE python 2  3   (Windows 7/8) 
   python 2 via mintty (Windows 7/8)
   python 2 via bash  (Ubuntu 14.04)
   ipython qtconsole   (Windows 7/8)

--
components: IO
messages: 241845
nosy: principia1687
priority: normal
severity: normal
status: open
title: When Caps Locked, Shift + alpha-character still displayed as uppercase
type: behavior
versions: Python 2.7

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



[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-22 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
resolution:  - rejected
status: open - closed

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



[issue24031] Add git support to make patchcheck

2015-04-22 Thread Christian Heimes

New submission from Christian Heimes:

'make patchcheck' supports only Mercurial checkouts. The tool uses the 'hg 
status' command to find modified files. My patch implements 'git status' 
support in order to make the patch check tool available on git checkouts.

--
components: Build
files: patchcheck_git.patch
keywords: patch
messages: 241824
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Add git support to make patchcheck
type: enhancement
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file39174/patchcheck_git.patch

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



[issue24029] Surprising name binding behavior of submodule imports needs documenting

2015-04-22 Thread Eric Snow

Eric Snow added the comment:

LGTM.  You've covered all the key points and the example is good.

--

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



[issue22137] Test imaplib API on all methods specified in RFC 3501

2015-04-22 Thread Maciej Szulik

Maciej Szulik added the comment:

Thanks Milan for the info, I was about to ping you about that. I have a working 
prototype for the tests that I've been working on during PyCon sprints with 
David. I'll try to submit new patch within a couple of next days.

--

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



[issue16840] Tkinter doesn't support large integers

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4bf210f59ac6 by Serhiy Storchaka in branch '2.7':
Issue #16840: Skip bignum tests on minor releases where they are not supported.
https://hg.python.org/cpython/rev/4bf210f59ac6

New changeset 97519d85b5c8 by Serhiy Storchaka in branch '3.4':
Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 
8.5.8
https://hg.python.org/cpython/rev/97519d85b5c8

New changeset 701b830abbf0 by Serhiy Storchaka in branch 'default':
Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 
8.5.8
https://hg.python.org/cpython/rev/701b830abbf0

--

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



[issue24023] Django tutorial 2 not able to create a superuser on Windows 7

2015-04-22 Thread Johan Pretorius

New submission from Johan Pretorius:

When running the $python manage.py createsuperuser command the following is 
returned:
C:\Users\johanP\mysitepython manage.py cre
Username (leave blank to use 'johanp'):
Email address: jar...@gmail.com
Traceback (most recent call last):
  File manage.py, line 10, in module
execute_from_command_line(sys.argv)
  File C:\Program Files\Python 3.5\lib\site-packages\djan
nit__.py, line 338, in execute_from_command_line
utility.execute()
  File C:\Program Files\Python 3.5\lib\site-packages\djan
nit__.py, line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv
  File C:\Program Files\Python 3.5\lib\site-packages\djan
e.py, line 390, in run_from_argv
self.execute(*args, **cmd_options)
  File C:\Program Files\Python 3.5\lib\site-packages\djan
ment\commands\createsuperuser.py, line 50, in execute
return super(Command, self).execute(*args, **options)
  File C:\Program Files\Python 3.5\lib\site-packages\djan
e.py, line 441, in execute
output = self.handle(*args, **options)
  File C:\Program Files\Python 3.5\lib\site-packages\djan
ment\commands\createsuperuser.py, line 124, in handle
password = getpass.getpass()
  File C:\Program Files\Python 3.5\lib\getpass.py, line
msvcrt.putwch(c)
AttributeError: module 'msvcrt' has no attribute 'putwch'

The command picks up my AD credentials and doesn't request a password. I can 
create a super user in python using the following 
link:https://docs.djangoproject.com/en/1.8/topics/auth/default/
But the admin site won't start using this method.
I'm running Python 3.5, Django 1.8 on Windows 7 Professional.

--
components: Demos and Tools
messages: 241787
nosy: JohanPretorius
priority: normal
severity: normal
status: open
title: Django tutorial 2 not able to create a superuser on Windows 7
type: compile error
versions: Python 3.5

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



[issue21483] Skip os.utime() test on NFS?

2015-04-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aa60f4d1a569 by Berker Peksag in branch 'default':
Issue #21483: Skip test_timestamp_overflow on NFS.
https://hg.python.org/cpython/rev/aa60f4d1a569

--
nosy: +python-dev

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



[issue21483] Skip os.utime() test on NFS?

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

Thanks Isaac.

--
nosy: +berker.peksag
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows

2015-04-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The file preset is default now, but if you will consider Argument Clinic as 
general tool for use in third-party software, the bug still is here.

--
priority: normal - low

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



[issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows

2015-04-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - remind
versions: +Python 3.6 -Python 3.4, Python 3.5

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



[issue11587] METH_KEYWORDS alone gives METH_OLDARGS is no longer supported!

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

issue 15657 is actually a duplicate of this issue, but since there's more 
information there I'm closing this. Please take a look the patch at issue 
15657. Thank you all!

--
nosy: +berker.peksag
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - Error in Python 3 docs for PyMethodDef

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



[issue15657] Error in Python 3 docs for PyMethodDef

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

Here is a patch for Python 3.5.

--
components: +Interpreter Core -Documentation
keywords: +patch
nosy: +berker.peksag, serhiy.storchaka
type:  - behavior
versions: +Python 3.5 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file39164/issue15657.diff

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



[issue15216] Support setting the encoding on a text stream after creation

2015-04-22 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +berker.peksag
stage: needs patch - patch review

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



[issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows

2015-04-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, if the two-pass preset is gone, then of course the bug is gone too.

--

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



[issue20323] Argument Clinic: docstring_prototype output causes build failure on Windows

2015-04-22 Thread Larry Hastings

Larry Hastings added the comment:

I thought the bug only happened with the two-pass preset.  The two-pass 
preset is gone, because I broke it, and nobody was using it anyway, so I 
removed it.

(I don't even remember what two-pass was trying to do.  It's possible the 
same effect could be achieved with the modern every destination has an 
arbitrary number of separate numbered buffers you can put text into 
technology.)

--

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




[issue24019] str/unicode encoding kwarg causes exceptions

2015-04-22 Thread Martin Panter

Martin Panter added the comment:

I thought it might be okay to use codecs.decode() instead for those cases, 
though it doesn’t check for text encodings. And support for arbitrary 
bytes-like object doesn’t seem to be documented (though seems to work in 
reality).

--

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



[issue23227] Generator's finally block not run if close() called before first iteration

2015-04-22 Thread Marco Paolini

Marco Paolini added the comment:

I think there is an issue in the way you designed your cleanup logic. So I 
think this issue is invalid.

Usually, the code (funcion, class, ...) that *opens* the file should also be 
resposible of closing it.

option 1) the caller opens and closes the file and wrapping the logged lines in 
a try/finally


def logged_lines(f):
try:
for line in f:
logging.warning(line.strip())
yield line
finally:
logging.warning('closing')


f = open('yyy', 'r')
try:
for l in logged_lines(f):
   print(l)
finally:
f.close()


option 2) the funcion opens and closes the file

def logged_lines(fname):
f = open('yyy', 'r')
try:
for line in f:
logging.warning(line.strip())
yield line
finally:
logging.warning('closing')
f.close()

for l in logged_lines('yyy'):
   print(l)

--
nosy: +mpaolini

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



[issue23275] Can assign [] = (), but not () = []

2015-04-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

About the patch: I'm sure there are other tests to change,
in test_syntax.py for example::

It's a syntax error to assign to the empty tuple.  Why isn't it an
error to assign to the empty list?  It will always raise some error  at
runtime.

 () = 1
Traceback (most recent call last):
  File doctest test.test_syntax[3], line 1
SyntaxError: can't assign to ()

--
nosy: +amaury.forgeotdarc

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2015-04-22 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

It's only been six years, no need to rush.

--
nosy: +Jean-Paul Calderone

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2015-04-22 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -Jean-Paul Calderone, exarkun

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



[issue22619] Possible implementation of negative limit for traceback functions

2015-04-22 Thread Dmitry Kazakov

Changes by Dmitry Kazakov jsb...@gmail.com:


Added file: http://bugs.python.org/file39166/traceback_limit_doc_rev3.diff

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



[issue23275] Can assign [] = (), but not () = []

2015-04-22 Thread Berker Peksag

Berker Peksag added the comment:

I don't have a strong opinion on this, but here is a patch to make () = [] a 
valid assignment.

--
keywords: +patch
nosy: +berker.peksag
stage:  - patch review
versions: +Python 3.5
Added file: http://bugs.python.org/file39165/issue23275.diff

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



[issue24021] document urllib.urlretrieve

2015-04-22 Thread Karl Richter

Karl Richter added the comment:

 I suspect the complaint might be about the lack of doc string
Exactly. It'd be helpful to figure out the return value and the means of the 
function arguments in a more compact form than the referenced website docs and 
to have it available in the interpreter (with `help`), i.e. with docstring 
documentation.

--

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