[issue20079] Add support for glibc supported locales

2013-12-29 Thread Berker Peksag

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


--
nosy: +berker.peksag

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman

Ethan Furman added the comment:

In issue19995, in msg206339, Guido exhorted:

 [Ethan claimed] it is possible to want a type that can be used as an
 index or slice but that is still not a number

 I'm sorry, but this requirement is absurd. An index *is* a number. You
 have to make up your mind. (I know, in the context of the example that
 started this, this is funny, but I still stand by it.)

 Finally, the correct name should perhaps have been __integer__ but I don't
 see enough reason to change it now.

The de facto API that is forming is that if an actual int is needed from an 
actual integer type (not float, not complex, not etc.), then __index__ is used. 
 If __index__ is not defined by some numeric type then it will not be 
considered a true int in certain key places in Python, such as as indices, 
arguments to hex(), etc.

Making the change suggested in the title would help solidify the API.

--

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



[issue19995] %c, %o, %x, %X accept non-integer values instead of raising an exception

2013-12-29 Thread Ethan Furman

Ethan Furman added the comment:

Ran full test suite; some errors came up in test_format from the following test 
lines:

testformat(%#x, 1.0, 0x1)
testformat(%x, float(big), 123456___, 6)
testformat(%o, float(big), 123456__, 6)
testformat(%x, float(0x42), 42)
testformat(%o, float(0o42), 42)

Removed as float() is not supposed to be valid input.

Also fixed two memory leaks in unicodeobject from my changes, and a float-oct 
bug in tarfile.

--
Added file: http://bugs.python.org/file33286/issue19995.stoneleaf.02.patch

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



[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It is used, see countTestCases().

--

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



[issue20084] smtplib: support for UTF-8 encoded headers (SMTPUTF8)

2013-12-29 Thread Freek Dijkstra

Freek Dijkstra added the comment:

 we want our message to get delivered regardless of whether or not smtputf8 is 
 available.

This is not possible if the user specifies an (sender or recipient) email 
address with non-ASCII characters and the first-hop mail system does not 
support SMTPUTF8. Section 8 of RFC 6530 seems to suggest that in that case 
either an all-ASCII email address should be used, and if that is not available, 
the mail should bounce. In my interpretation smtplib should fail by raising an 
Exception.

 [...] a Message object, which can be automatically serialised as utf8 if 
 smtputf8 is available [...]

I hadn't given the mail body much thought. I think that this is covered by the 
existing 8BITMIME extension, in which case the client can add the header 
'Content-Type: text/plain; charset=utf-8'. From what I understand SMTPUTF8 
only concerns the encoding of the header. I prefer that this particular issue 
(enhancement request) only concerns the mail headers, not the mail body. (I see 
that you also have some ideas on this, perhaps this is for a different issue?)

PS: I planned to use smtplib to see if I could understand the standard for 
international email addresses. Turns out I'm not reading the standard to see 
how smtplib should work. Also nice, but not what I had intended to do. :). It 
seems that STMPUTF8 is not yet implemented that much. I've learned that my 
production MTA does not support it.

--

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread R. David Murray

R. David Murray added the comment:

Ah, I see.  A link to that issue would have been helpful :).

To summarize for anyone like me who didn't follow that issue: __index__ means 
the object can be losslessly converted to an int (is a true int), while __int__ 
may be an approximate conversion.  Thus it makes sense for an object to have an 
__int__ but not __index__, but vice-versa does not make sense.

Is someone updating the docs to reflect this, or should that be spun off as a 
separate issue as well?

--

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



[issue20084] smtplib: support for UTF-8 encoded headers (SMTPUTF8)

2013-12-29 Thread R. David Murray

R. David Murray added the comment:

Yeah, I've been doing a lot of reading of standards while trying to hide all 
the messy details from users of the new API I've added to the email package.  I 
haven't gotten to smtplib yet :)

But, this stuff is messy.  If you want to understand a standard, you really 
have to read it, and lots of others standards besides, and then look at what 
various packages have chosen to implement, and figure out all the ways you 
think they did it wrong :)  As you have observed, implementations of SMTPUTF8 
are scarce on the ground so far.

SMTPUTF8 may be about headers, but because the natural way of representing 
non-ascii headers in Python is as a (unicode) string, and SEND takes a single 
string (or bytes) argument, you can't separate dealing with the encoding of the 
headers from dealing with the encoding of the body unless you *parse* the 
payload as an email message so you can do the right thing with the body.  Thus 
you can't address adding SMTPUTF8 to smtplib without figuring out the API for 
the whole message, not just the headers.

So yes, the client can 'add Content-Type: text/plain; charset=utf-8', but the 
process of doing that is exactly what I was talking about :)

Now, one option, as I said, it to put the burden on the application: it can 
check to see if SMTPUTF8 is available, and if so provide a DATA formatted with 
utf8 headers and charset='utf-8' bodies, and if it is not available, provide a 
DATA formatted with RFC2047 headers and charset=utf-8 bodies.  But I'd rather 
make smtplib (with the help of the email package) do the hard work, rather than 
have every application have to do it.  

Still, we could start with a patch that just makes it possible for an 
application to do it itself.  That would just need to accept non-ascii in the 
RCPT etc commands, pass it through as utf8 if SMTPUTF8 is available, and raise 
an error otherwise.

You are correct that the more convenient API I'm talking about also needs to be 
enhanced to provide a way to specify the alternate ASCII-only address.  I'd 
forgotten about that detail.  That's going to be very annoying from a clean-API 
point of view :(

And yes, it should raise an exception if SMTPUTF8 is not available and no ascii 
address was provided.

--

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



[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Nick Coghlan

Nick Coghlan added the comment:

I think we need to look seriously at the frame annotations idea discussed in 
other issues. Eliminating noise from tracebacks and correctly reporting user 
code rather than infrastructure could should be achievable through local state 
rather than needing global registries.

The workaround we put in place for importlib is an awful hack, and there's a 
problem where PEP 3144 allows the creation of exception *trees*, but we can 
currently only record stacks properly.

--

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman

Ethan Furman added the comment:

I have the following as part of the patch for that issue:
-
diff -r b668c409c10a Doc/reference/datamodel.rst
--- a/Doc/reference/datamodel.rst   Sat Dec 28 20:37:58 2013 +0100
+++ b/Doc/reference/datamodel.rst   Sun Dec 29 06:55:11 2013 -0800
@@ -2073,23 +2073,31 @@ left undefined.
   builtin: float
   builtin: round
 
Called to implement the built-in functions :func:`complex`,
:func:`int`, :func:`float` and :func:`round`.  Should return a value
of the appropriate type.
 
 
 .. method:: object.__index__(self)
 
-   Called to implement :func:`operator.index`.  Also called whenever Python 
needs
-   an integer object (such as in slicing, or in the built-in :func:`bin`,
-   :func:`hex` and :func:`oct` functions). Must return an integer.
+   Called to implement :func:`operator.index`, and whenever Python needs to
+   losslessly convert the numeric object to an integer object (such as in
+   slicing, or in the built-in :func:`bin`, :func:`hex` and :func:`oct`
+   functions). Presence of this method indicates that the numeric object is
+   an integer type.  Must return an integer.
+
+   .. note::
+
+  When :meth:`__index__` is defined, :meth:`__int__` should also be 
defined,
+  and both shuld return the same value, in order to have a coherent integer
+  type class.
-

If for some reason that patch doesn't make it into 3.4 I'll split the doc 
change off to its own issue, unless you think it should be split off anyway?

--

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



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2013-12-29 Thread Jason R. Coombs

Jason R. Coombs added the comment:

The bug as reported against setuptools: 
https://bitbucket.org/pypa/setuptools/issue/127/unicodedecodeerror-when-install-in-windows

--
nosy: +jason.coombs

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



[issue20093] Wrong OSError message from os.rename() when dst is a non-empty directory

2013-12-29 Thread Dmitry Shachnev

Dmitry Shachnev added the comment:

This is a result of http://hg.python.org/cpython/rev/6903f5214e99.

Looks like we should check the error code and conditionally set the file name 
to either src or dst.

--
nosy: +haypo, mitya57

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



[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Vinay Sajip

Vinay Sajip added the comment:

 the frame annotations idea discussed in other issues

If you mean #19585 and #18861, they seem to be related to exceptions - the 
logging use case is not exception-related. I couldn't find any other 
discussions about frame annotations.

--

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



[issue19890] Typo in multiprocessing docs

2013-12-29 Thread Mike Short

Changes by Mike Short bmsh...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file33287/multiprocessing.patch

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



[issue19890] Typo in multiprocessing docs

2013-12-29 Thread Mike Short

Changes by Mike Short bmsh...@gmail.com:


--
nosy: +Mike.Short

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



[issue20094] intermitent failures with test_dbm

2013-12-29 Thread Ethan Furman

New submission from Ethan Furman:

Following errors occur about half the time:

==
ERROR: test_anydbm_creation (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 75, in 
test_anydbm_creation
self.read_helper(f)
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 117, 
in read_helper
self.assertEqual(self._dict[key], f[key.encode(ascii)])
KeyError: b'0'

==
ERROR: test_anydbm_modification (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 90, in 
test_anydbm_modification
self.read_helper(f)
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 117, 
in read_helper
self.assertEqual(self._dict[key], f[key.encode(ascii)])
KeyError: b'0'

==
ERROR: test_anydbm_read (test.test_dbm.TestCase-dbm.ndbm)
--
Traceback (most recent call last):
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 96, in 
test_anydbm_read
self.read_helper(f)
  File /home/ethan/source/python/issue19995/Lib/test/test_dbm.py, line 117, 
in read_helper
self.assertEqual(self._dict[key], f[key.encode(ascii)])
KeyError: b'0'

--
messages: 207079
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: intermitent failures with test_dbm
versions: Python 3.4

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



[issue20094] intermitent failures with test_dbm

2013-12-29 Thread Ethan Furman

Ethan Furman added the comment:

Actually, make that about 1/5 of the time.

--

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



[issue11798] Test cases not garbage collected after run

2013-12-29 Thread Michael Foord

Michael Foord added the comment:

Ah yes, I see - sorry.

--

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



[issue19732] python fails to build when configured with --with-system-libmpdec

2013-12-29 Thread Matthias Klose

Matthias Klose added the comment:

your current repo doesn't create and install the .so symlink, and thus won't be 
used for linking.

Also the sphinx docs are missing, which were included in 2.3.

--

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



[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2013-12-29 Thread gudge

gudge added the comment:

Can you please provide some hints on how to handle
http://bugs.python.org/issue19940#msg205860.

The value of format_regex

1) Without locale set:
re.compile('(?Pbjan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\s+(?Pd3[0-1]|[1-2]\\d|0[1-
9]|[1-9]| 
[1-9])\\s+(?PH2[0-3]|[0-1]\\d|\\d):(?PM[0-5]\\d|\\d):(?PS6[0-1]|[0-5]\\d|\\d)\\s
+(?PY\\d\\d\\d\\d, re.IGNORECASE)

2) With locale set:
re.compile('(?Pbsty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa\\ΕΊ|lis|gru)\\s+(?Pd3[0-1]|[1-2]\\d|0[
1-9]|[1-9]| 
[1-9])\\s+(?PH2[0-3]|[0-1]\\d|\\d):(?PM[0-5]\\d|\\d):(?PS6[0-1]|[0-5]\\d|\\d)\
\s+(?PY\\d\\d\\d\, re.IGNORECASE)

The value of months are different.

Thanks

--

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread R. David Murray

R. David Murray added the comment:

Nah, splitting it doesn't seem worth it unless you think the patch won't make 
it in.

(Not that I looked at it earlier, but he patch on the issue doesn't look like 
what you just posted here...and here there's a typo: shuld).

--

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



[issue20092] type() constructor should bind __int__ to __index__ when __index__ is defined and __int__ is not

2013-12-29 Thread Ethan Furman

Ethan Furman added the comment:

I updated it as I liked your wording better.  :)  Doing more testing to see if 
anything else needs fixing before I make the next patch for the tracker on that 
issue.

--

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



[issue20031] unittest.TextTestRunner missing run() documentation.

2013-12-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19464d77ec2e by Michael Foord in branch 'default':
Closes issue 20031. Document unittest.TextTestRunner.run method.
http://hg.python.org/cpython/rev/19464d77ec2e

--
nosy: +python-dev
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

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



[issue18566] In unittest.TestCase docs for setUp() and tearDown() don't mention AssertionError

2013-12-29 Thread Michael Foord

Michael Foord added the comment:

Yep, those docs are just wrong. I'm trying to think of a concise rewording.

--

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



[issue16778] Logger.findCaller needs to be smarter

2013-12-29 Thread Nick Coghlan

Nick Coghlan added the comment:

My idea is to annotate the frames appropriately so they can be *displayed*
differently when showing a traceback (either hiding them entirely or
displaying additional information). This would be another use case -
annotating the frame to say the logging module should skip over it when
looking for the caller.

--

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



[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence

Mark Lawrence added the comment:

Why has this been closed?  I've just run into exactly the same problem.  It 
states here http://docs.python.org/3/library/itertools.html#itertools.tee 
itertools.tee(iterable, n=2) - Return n independent iterators from a single 
iterable.

--
nosy: +BreamoreBoy

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



[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence

Mark Lawrence added the comment:

The docs for tee are the same going right back to its introduction in 2.4.  The 
itertools count function takes start and step keywords, why can't tee take a 
keyword as it's documented to?

--

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



[issue19771] runpy should check ImportError.name before wrapping it

2013-12-29 Thread Anthony Kong

Changes by Anthony Kong anthony.hw.k...@gmail.com:


--
nosy: +Anthony.Kong

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



[issue18310] itertools.tee() can't accept keyword arguments

2013-12-29 Thread Mark Lawrence

Mark Lawrence added the comment:

It's just the docs that need changing to clarify the situation as (say) a,b,c = 
tee(range, 3) works perfectly.  Sorry I didn't have the foresight to check this 
before :(

--
components: +Documentation -Library (Lib)
versions: +Python 2.7

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