[issue12581] Increased test coverage of test_urlparse

2011-07-17 Thread Petter Haggholm

New submission from Petter Haggholm :

Some very trivial tests to increase the test coverage on test_urlparse a bit; 
also changed a single line to use an ABC instead of attempting to use len() to 
verify that an object is "sequence-like" (as the comment put it). Mostly I’m 
trying to get my feet wet in submitting a patch in the manner suggested by the 
guide.

(Curiously, the full test suite coverage report cites 99%, even though the path 
in question does run: coverage.py fails somehow to mark an else branch 
consisting of a lone continue statement.)

Looking at this, I have some questions, but figured I might as well ask them 
along with a patch: First, whether this is appropriate use of ABCs in the 
library; second, whether it’s appropriate to submit related stuff like modified 
tests and (lightly) modified code in one patch, or whether I should rather open 
two issues.

Third, and more generally, I’m wondering whether the tests are appropriate. 
These are trivial in scope and nature, but I would be interested to know for 
future reference (and perhaps it would be useful to mention in the docs?) what 
the policy is on this. Essentially, I encoded expectations of current behaviour 
as “correct” and covered the 30-odd statements in urllib/parse.py that were not 
already covered by a full test run (explicit coverage by test_urlparse is still 
much lower!) on the assumption that, as the coverage guide suggests, more 
coverage is always better – and even without domain expertise assurance that 
current behaviour is correct, it at least provides some assurance that changes 
in behaviour will be discovered. Still, it’s perhaps *too* easy to get hung up 
on those coverage percentages: Is it *always* better to cover more (keeping in 
mind the limitations of once-over coverage), or would contributors be better 
advised not to cover code unless they are very, very confident that current 
behaviour is correct?

--
components: Tests
files: urlparsetest.patch
keywords: patch
messages: 140560
nosy: haggholm
priority: normal
severity: normal
status: open
title: Increased test coverage of test_urlparse
versions: Python 3.3
Added file: http://bugs.python.org/file22684/urlparsetest.patch

___
Python tracker 

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



[issue11055] OS X IDLE 3.2 Save As menu accelerator opens two Save windows

2011-07-17 Thread Ned Deily

Ned Deily  added the comment:

There is now a patch in the Tcl pipeline for this problem.  See:
http://permalink.gmane.org/gmane.comp.lang.tcl.mac/6965

--

___
Python tracker 

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



[issue10271] warnings.showwarning should allow any callable object

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset eaefb34fc3a1 by Brett Cannon in branch 'default':
Add Misc/NEWS entry and relevant doc change for issue 10271.
http://hg.python.org/cpython/rev/eaefb34fc3a1

--

___
Python tracker 

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



[issue12576] urlib.request fails to open some sites

2011-07-17 Thread Santoso Wijaya

Changes by Santoso Wijaya :


--
nosy: +santa4nt
versions: +Python 3.3

___
Python tracker 

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



[issue10271] warnings.showwarning should allow any callable object

2011-07-17 Thread Brett Cannon

Brett Cannon  added the comment:

Committed in 3.3. This cannot be backported as it widens the API and those 
could lead to subtle incompatibilities.

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

___
Python tracker 

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



[issue10271] warnings.showwarning should allow any callable object

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset aaced3dcb858 by Brett Cannon in branch 'default':
Make warnings accept a callable for showwarnings instead of
http://hg.python.org/cpython/rev/aaced3dcb858

--
nosy: +python-dev

___
Python tracker 

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



[issue12540] "Restart Shell" command leaves pythonw.exe processes running

2011-07-17 Thread Ned Deily

Ned Deily  added the comment:

This appears to be a Windows-only issue; I'm not able to readily reproduce it 
on either Linux or OS X.  Taking a quick look at diffs between 3.2 and 3.2.1, 
there aren't a lot of changes in IDLE (Lib/idlelib) and nothing obviously 
related.  There are a number of changes elsewhere in signal handling and 
process handling, though.  The restart_subprocess code is in 
Lib/idlelib/PyShell.py. If there isn't anything obvious elsewhere, perhaps 
someone can try to hg bisect it on Windows.

--

___
Python tracker 

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



[issue12524] change httplib docs POST example

2011-07-17 Thread Bharadwaj

Bharadwaj  added the comment:

Newbie here. Please be patient.

When I tried using the POST form in this page, I ran into minor issues.
1. The form returns a 302 to the actual issue page. Some other example with 200 
may be better.
2. The params are a little weird, with '@' in the names. Might be confusing for 
newbies.
3. Form action param is '#', which is not a great example.

Please suggest if I should continue with this example or find a better one.

Code:
import http.client, urllib.parse
params = urllib.parse.urlencode({'@number': 12524, '@type': 'issue', '@action': 
'show'})
headers = {"Content-type": "application/x-www-form-urlencoded",
   "Accept": "text/plain"}
conn = http.client.HTTPConnection("bugs.python.org")
conn.request("POST", "#", params, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()
conn.close()
data
b'Redirecting to http://bugs.python.org/issue12524";>http://bugs.python.org/issue12524'

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Julian

Changes by Julian :


Removed file: http://bugs.python.org/file22681/format_map_err.patch

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Julian

Julian  added the comment:

Added, updated the patch :). Thank you!

--
Added file: http://bugs.python.org/file22683/format_map_err.patch

___
Python tracker 

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




[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Julian

Changes by Julian :


Removed file: http://bugs.python.org/file22682/format_map_err.patch

___
Python tracker 

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



[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found

2011-07-17 Thread Jeff Blaine

Changes by Jeff Blaine :


--
versions: +Python 2.7

___
Python tracker 

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



[issue12013] file /usr/local/lib/python3.1/lib-dynload/_socket.so: symbol inet_aton: referenced symbol not found

2011-07-17 Thread Jeff Blaine

Jeff Blaine  added the comment:

FWIW, this same problem exists with 2.7.1, compiled by myself, and only on some 
Solaris 10 boxes of ours that have not had a lot of recent patching.

==

On an old-ish Solaris 10 box:

% /tmp/py271test/bin/python -m test.regrtest
Traceback (most recent call last):
  File "/tmp/py271test/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "/tmp/py271test/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/tmp/py271test/lib/python2.7/test/regrtest.py", line 211, in 
from test import test_support
  File "/tmp/py271test/lib/python2.7/test/test_support.py", line 10, in 
import socket
  File "/tmp/py271test/lib/python2.7/socket.py", line 47, in 
import _socket
ImportError: ld.so.1: python: fatal: relocation error: file 
/tmp/py271test/lib/python2.7/lib-dynload/_socket.so: symbol inet_aton: 
referenced symbol not found
==

On a modern Solaris 10 box patched 2 months ago:


% /tmp/py271test/bin/python -m test.regrtest
[ runs, takes too long, so we'll test the stuff that ]
[ imports socket ... ]
^C


Python-2.7.1:cairo> for i in `grep -l "import socket" /tmp/py271test/lib/python
2.7/test/*py | sed 's/\.py//g'`; do echo "RUNNING $i"; /tmp/py271test/bin/pytho
n -m test.`basename $i`; done 2>&1 | /usr/sfw/bin/ggrep -E '(OK|RUNNING)'
RUNNING /tmp/py271test/lib/python2.7/test/test_asyncore
OK (skipped=2)
RUNNING /tmp/py271test/lib/python2.7/test/test_docxmlrpc
OK
RUNNING /tmp/py271test/lib/python2.7/test/test_epoll
RUNNING /tmp/py271test/lib/python2.7/test/test_ftplib
OK
RUNNING /tmp/py271test/lib/python2.7/test/test_httplib
OK (skipped=1)
RUNNING /tmp/py271test/lib/python2.7/test/test_import
OK
RUNNING /tmp/py271test/lib/python2.7/test/test_kqueue
RUNNING /tmp/py271test/lib/python2.7/test/test_logging
OK
RUNNING /tmp/py271test/lib/python2.7/test/test_mailbox
OK
RUNNING /tmp/py271test/lib/python2.7/test/test_multiprocessing
...etc...

--
nosy: +Jeff.Blaine

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

I definitely agree it should be a ValueError.

How about including in your patch adding your name to Misc/ACKS, if it isn't 
already there? I don't have your full name.

I might play with the exception wording and add a few more comments. Thanks for 
your work on this.

--
stage:  -> patch review

___
Python tracker 

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



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

2011-07-17 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

No Python thread is ever fork safe because the Python interpreter itself can 
never be made fork safe. Nor should anyone try to make the interpreter itself 
safe. It is too complex and effectively impossible to guarantee.

There is no general solution to this, fork and threading is simply broken in 
POSIX and no amount of duct tape outside of the OS kernel can fix it. My only 
desire is that we attempt to do the right thing when possible with the locks we 
know about within the standard library.

--
priority: high -> normal

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Julian

Julian  added the comment:

Well you're right :). I appreciate you taking more time to help me with this 
than you could have yourself. I made the change (and changed the TypeError to a 
ValueError as per your discovery that this was just a positional value issue, 
hope you agree with that).

Ran the whole test suite, all passes, other than the one test that fails for me 
without the patch too.

I'm not too happy with the wording on the error, "Format string contained 
positional fields" doesn't sound nearly specific enough, but I was weary to put 
something specifically referencing str.format_map in a function that handles 
str.format as well?

Anyways, appreciate the help again, please let me know if anything needs fixing 
:).

--
Added file: http://bugs.python.org/file22682/format_map_err.patch

___
Python tracker 

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



[issue12478] Possible error in HTTPErrorProcessor documentation

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 70983e8b114a by Senthil Kumaran in branch '3.2':
Fix closes Issue12478 - HTTPErrorProcess 's methods are http_response and 
https_response.
http://hg.python.org/cpython/rev/70983e8b114a

New changeset 04541e33364d by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes Issue12478 - HTTPErrorProcess 's methods are 
http_response and https_response.
http://hg.python.org/cpython/rev/04541e33364d

New changeset edf238312baa by Senthil Kumaran in branch '2.7':
merge from 3.2 - Fix closes Issue12478 - HTTPErrorProcess 's methods are 
http_response and https_response.
http://hg.python.org/cpython/rev/edf238312baa

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

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for format strings with positional arguments

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

Changing the title to reflect the real problem.

You get a SystemError even when using a mapping, if you have a format string 
with positional arguments:
>>> '{}'.format_map({'a':0})
Traceback (most recent call last):
  File "", line 1, in 
SystemError: null argument to internal routine

--
title: str.format_map raises a SystemError for non-mapping -> str.format_map 
raises a SystemError for format strings with positional arguments

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

I think the issue is that it should be an error in any string used for 
format_map() to have a positional argument. So the right thing to do is detect 
this case in get_field_object (index != -1 and args is NULL). So I think a new 
test near line 515 really is the right thing to do. With a good comment 
explaining what's going on.

I'm pretty sure the only case where args is NULL is when used with 
format_map(), but that needs to be verified.

--

___
Python tracker 

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



[issue12479] Add HTTPErrorProcessor class definition

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 8d64d47569cb by Senthil Kumaran in branch '3.2':
Fix closes Issue12479 - Add HTTPErrorProcessor class definition - Patch by 
Sandro Tosi
http://hg.python.org/cpython/rev/8d64d47569cb

New changeset b2125a6deb96 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix closes Issue12479 - Add HTTPErrorProcessor class 
definition - Patch by Sandro Tosi
http://hg.python.org/cpython/rev/b2125a6deb96

New changeset b9ae6be1874d by Senthil Kumaran in branch '2.7':
merge from 3.2 - Fix closes Issue12479 - Add HTTPErrorProcessor class 
definition - Patch by Sandro Tosi
http://hg.python.org/cpython/rev/b9ae6be1874d

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

___
Python tracker 

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



[issue12441] _GLOBAL_DEFAULT_TIMEOUT remains as an object() in HTTPConnection and the connection hangs

2011-07-17 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Would you like to give an example snippet (server+client) which can help 
reproduce this behavior?

--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue12577] Misleading shutil.move docs regarding when os.rename is used

2011-07-17 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Should information on Windows behavior, which you experienced be included too?

How about - 

It uses :func:`os.rename` to perform the move. If that fails, for example
because src and dst are on different filesystems or in case of Windows where 
rename cannot be done if dst exists, fallback to copying src (with 
:func:`copy2`) to the dst and then removing src.

--
nosy: +orsenthil

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Julian

Julian  added the comment:

Fair enough. I suppose I take .format_map to mean, here is a mapping, call 
__getitem__ on it for each of the keys inside the format string, to which 
calling 12["foo"] would get me a TypeError.

I suppose I see both as appropriate, but the fact that it's implemented by 
passing the mapping as kwargs seemed less relevant. Less concerned about that 
part though I guess.

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

I think KeyError for "{foo}".format(12) is correct. It's looking up "foo" in 
the empty dict of **kwargs.

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Julian

Julian  added the comment:

Sorry for the double post, meant to say, in line 506.

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Julian

Julian  added the comment:

Yeah, I saw the line you suggested and didn't think that was it.

To expand on this, perhaps "{foo}".format(12) should raise a TypeError as well? 
I'd expect that more than the current behavior which is a KeyError. That 
KeyError is getting raised in get_field_object, which is where the fix needs to 
be, or at least needs to be changed, I'm just trying not to duplicate code.

--

___
Python tracker 

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



[issue11468] Improve unittest basic example in the doc

2011-07-17 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I would be +1 if the basic example also highlights setUp and tearDown methods. 
Those are useful ones for a new comer to know via an example snippet and not 
just with explanation.

--
nosy: +orsenthil

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

Actually that's probably not the place to catch it. Let me look at it closer. 
Of course, patches welcome!

--

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Steve Holden

Steve Holden  added the comment:

Sorry about that. I was using 3.1, as you will have gathered.

--
status: open -> closed

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

The example is correct and runs as expected:

>>> Decimal(3.14)
Decimal('3.140124344978758017532527446746826171875')

Per the Whatsnew3.2 document:
'''
The decimal.Decimal constructor now accepts float objects directly so there in 
no longer a need to use the from_float() method (issue 8257).
'''

--

___
Python tracker 

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



[issue4277] asynchat's handle_error inconsistency

2011-07-17 Thread Nir Soffer

Nir Soffer  added the comment:

The idea is good, but seems that error handling should be inlined into 
initiate_send.

Also those 3 special exceptions should be defined once in the module instead of 
repeating them.

--
nosy: +nirs

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: georg.brandl -> rhettinger
nosy: +rhettinger
versions: +Python 3.3 -Python 3.1

___
Python tracker 

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



[issue1602133] non-framework built python fails to define environ properly

2011-07-17 Thread Andrew Dalke

Andrew Dalke  added the comment:

I confirm that under Python 2.7.2 while trying to build a 3rd-party package 
(from rdkit.org) I get the error


Linking CXX shared library ../../lib/libRDBoost.dylib
ld: warning: path '/usr/local/lib/libpython2.7.a' following -L not a directory
Undefined symbols:
  "_environ", referenced from:
  _initposix in libpython2.7.a(posixmodule.o)
 (maybe you meant: cstring=ignore_environment)
ld: symbol(s) not found
collect2: ld returned 1 exit status

My Python-2.7 was configured with "./configure" and is not a framework install. 
I applied the patch to my local 2.7 copy and the third party package builds 
without a problem.

--
nosy: +dalke

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Stefan Krah

Stefan Krah  added the comment:

Behavior for mixed operations varies greatly between Python versions.

The first table over here lists the differences and should be valid
for decimal.py:

http://www.bytereef.org/mpdecimal/doc/cdecimal/index.html#floatoperation-signal


As an extension, cdecimal has the FloatOperation signal, which
enforces stricter semantics. The second table on that page lists
the behavior if the signal is enabled.

--
nosy: +skrah

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Steve Holden

Changes by Steve Holden :


--
components: +Documentation

___
Python tracker 

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



[issue12580] Documentation error in Decimal module

2011-07-17 Thread Steve Holden

New submission from Steve Holden :

We see in the "Quick-Start Tutorial" (py3k section 8.4.1) the following example:

>>> Decimal(3.14)
Decimal('3.140124344978758017532527446746826171875')

In actua; fact one would expect an exception from that code, which should 
perhaps instead read

>>> Decimal.from_float(3.14)
Decimal('3.140124344978758017532527446746826171875')

This class method is the recommended way to convert floats to decimal when 
necessary.

--
assignee: georg.brandl
messages: 140531
nosy: georg.brandl, holdenweb
priority: normal
severity: normal
status: open
title: Documentation error in Decimal module
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Eric V. Smith

Eric V. Smith  added the comment:

If you want to look at this, I think there's a missing check for args being 
non-null in string_format.h, line 515.

I'd have to think to see if there are other possible failure scenarios.

Thanks for the report.

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Eric V. Smith

Changes by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2011-07-17 Thread Doug Hellmann

Doug Hellmann  added the comment:

Right. Any program that needs to parse command lines containing filenames or 
other arguments with unicode characters will encounter this problem.

--

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +eric.smith

___
Python tracker 

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



[issue12579] str.format_map raises a SystemError for non-mapping

2011-07-17 Thread Julian

New submission from Julian :

Attached is just a failing test case (just `print("{}".format_map(12))`), 
haven't been able to decipher the chain of calls in the unicodeobject.c code 
yet to see where the best place to put the fix would be (inside do_format_map 
before the pass back upwards maybe?).

Assuming this should be a TypeError obviously, soon as I can figure out where 
to put the fix I'll update the patch.

--
components: Interpreter Core
files: format_map_err.patch
keywords: patch
messages: 140528
nosy: Julian
priority: normal
severity: normal
status: open
title: str.format_map raises a SystemError for non-mapping
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22681/format_map_err.patch

___
Python tracker 

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



[issue7484] smtplib: verify breaks with Postfix servers

2011-07-17 Thread Catalin Iacob

Changes by Catalin Iacob :


Added file: http://bugs.python.org/file22680/88b5c7ab7a03.diff

___
Python tracker 

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



[issue7484] smtplib: verify breaks with Postfix servers

2011-07-17 Thread Catalin Iacob

Catalin Iacob  added the comment:

I looked at the Felipe's patch and hopefully made some improvements.

Unlike Felipe's patch I didn't change the reply of the SMTP server in the tests 
but instead use what VRFY and EXPN actually send to index the users and lists 
dictionaries. If <> would be sent the lookup would fail. Similarly, when VRFY 
return 550 it echoed the address as received and now it's tested to be equal to 
something without <>.

By the way, but I was wondering:
* is the try/except really needed or just a historical artifact (why would 
email.utils.parseaddr raise AttributeError?)
* is the test to None correct? It was added by the fix to issue1430298 but does 
email.utils.parseaddr ever return None for the address? (I could only get it to 
return '')
I kept quoteaddr as is to make it easier to review the patch but if David 
confirms the above points are valid I can create new issues for them and 
simplify/fix quoteaddr.

--
hgrepos: +43

___
Python tracker 

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



[issue12578] Erratic socket.gaierror: [Errno 11004] when using smtplib

2011-07-17 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This sounds rather strange. There haven't been any significant changes in 
smtplib or the socket module between 2.7.1 and 2.7.2.

--
nosy: +pitrou

___
Python tracker 

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



[issue12575] add a AST validator

2011-07-17 Thread Andreas Stührk

Changes by Andreas Stührk :


--
nosy: +Trundle

___
Python tracker 

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



[issue12578] Erratic socket.gaierror: [Errno 11004] when using smtplib

2011-07-17 Thread David Ward

New submission from David Ward :

When migrating from python 2.7.1 to 2.7.2 (or 3.2) I get unpredictable /erratic 
exceptions thrown on constucting smtplib.SMTP:

socket.gaierror: [Errno 11004] getaddrinfo failed 

Here is the call stack:

  File "**\mail.py", line 41, in Mail
server = smtplib.SMTP(MAILSERVER)
  File "c:\python27\lib\smtplib.py", line 250, in __init__
(code, msg) = self.connect(host, port)
  File "c:\python27\lib\smtplib.py", line 306, in connect
self.sock = self._get_socket(host, port, self.timeout)
  File "c:\python27\lib\smtplib.py", line 284, in _get_socket
return socket.create_connection((host, port), timeout)
  File "c:\python27\lib\socket.py", line 380, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 11004] getaddrinfo failed

MAILSERVER is a local address. There are no known DNS issues on our local 
network. 

If I try to reduce the code to a small repro (e.g. sending mail in a loop or 
calling getaddrinfo), I cannot reproduce the problem.

This code had worked unchanged for many years and many previous python releases 
all the way back to 2.3.

Platform is Windows 7 x64, AMD64 build of python 2.7.2 (or 3.2).

Reverting back to 2.7.1 solves the problem.

--
components: Library (Lib)
messages: 140525
nosy: David.Ward
priority: normal
severity: normal
status: open
title: Erratic socket.gaierror: [Errno 11004] when using smtplib
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue10403] Use "member" consistently

2011-07-17 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
status: open -> closed

___
Python tracker 

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



[issue10403] Use "member" consistently

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3935a1fb1db2 by Senthil Kumaran in branch '2.7':
merge from 3.2 - Issue10403  - datetime module documentation changes based on 
review.
http://hg.python.org/cpython/rev/3935a1fb1db2

--

___
Python tracker 

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



[issue10403] Use "member" consistently

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 05f0ffe4e0b3 by Senthil Kumaran in branch '3.2':
Fix Issue10403 - datetime documentation clarification based on review in the 
reitveld by Alexendar belopolsky.
http://hg.python.org/cpython/rev/05f0ffe4e0b3

--

___
Python tracker 

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



[issue11436] Clarify struct doc for format 's', when it is mentioned without numeric prefix

2011-07-17 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 90cdf403132e by Senthil Kumaran in branch '3.2':
Fix closes Issue11436 - Minor clarification to struct documentation for 's' 
format character.
http://hg.python.org/cpython/rev/90cdf403132e

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

___
Python tracker 

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



[issue12577] Misleading shutil.move docs regarding when os.rename is used

2011-07-17 Thread Catalin Iacob

Catalin Iacob  added the comment:

Attached patch which clarifies that the copy fallback is used whenever 
os.rename fails not just for the different filesystems case.

--
keywords: +patch
Added file: http://bugs.python.org/file22679/clarify-shutil.move-docs.patch

___
Python tracker 

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



[issue12577] Misleading shutil.move docs regarding when os.rename is used

2011-07-17 Thread Catalin Iacob

New submission from Catalin Iacob :

I recently tried to answer the question: "When moving a file to a destination 
that is an already existing file, is the destination overwritten?"

>From the current docs I understood that if src and dst are on the same 
>filesystem then os.rename is used, if they are on different filesystems then 
>copy + remove is used instead. Since os.rename fails on Windows if the 
>destination exists I concluded that shutil.move would fail on Windows and 
>overwrite dst on Unix.

--
assignee: docs@python
components: Documentation
messages: 140520
nosy: catalin.iacob, docs@python
priority: normal
severity: normal
status: open
title: Misleading shutil.move docs regarding when os.rename is used
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue12381] refactor slice checks made by methods that take "slice like" arguments

2011-07-17 Thread anand jeyahar

anand jeyahar  added the comment:

I started working on this. But found sliceobject.c. Think it would be a good 
idea to add the refactored functions there. Anyway, i was trying to figure out 
the functionality of sliceobject.c. Can someone put up a use/test case example 
for it? Thanks for patience with my newbieness to python source

--
nosy: +anand.jeyahar

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2011-07-17 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy:  -cvrebert

___
Python tracker 

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



[issue1170] shlex have problems with parsing unicode

2011-07-17 Thread Santiago Romero

Santiago Romero  added the comment:

> It would be good to hear a strong argument from
> the user that how did he end up passing
> unicode to shlex.split? It is for parsing command
> line args for programs and personally have not
> seen those cases.

 I'm from Spain: I personally write programs and python/bash scripts that 
accept unicode input arguments. And I'm currently writing a wxpython gui 
program (SSH/rdesktop launcher, in Spanish) that needs (and cannot) do 
shlex.split in of a given text string.

 Remember that English is NOT the most spoken language on the world. It's the 
THIRD most spoken language, after Chinese and Spanish, languages that need and 
use unicode support.

--

___
Python tracker 

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