[issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method

2014-10-23 Thread Vova

New submission from Vova:

At my workplace I have to use corporate Internet proxy server with 
AD/domain/ntlm authorization. I use local cntlm proxy server to authorize 
myself on corporate proxy. Programs are send requests to cntlm proxy without 
any authorization information. Cntlm proxy communicate with corporate proxy and 
handle all authorization stuff and return response to programs. 

But programs which use httplib, like pip, and want to open https url can't work 
in my network scheme. Because to open https connection httplib send to cntlm 
proxy 

CONNECT encrypted.google.com:443 HTTP/1.0\r\n

HTTP/1.0 does not assume persistent connection so corporate proxy return http 
response 407 (need authorization) and close connection. Cntlm proxy detect 
closed connection and return http response 407 to pip/httplib which can't 
handle this response or begin ntlm negotiation, throw exception 

ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 
Proxy Authentication Required',))  

and close.

So I suggest change HTTP CONNECT method to 

CONNECT %s:%d HTTP/1.1\r\n

This change allow cntlm proxy keep alive connection to corporate proxy do all 
authorization stuff and return proper response. 

And also in header of httplib is stated what it is HTTP/1.1 client library

--
components: Library (Lib)
files: py2.7.httplib.patch
keywords: patch
messages: 229856
nosy: vova
priority: normal
severity: normal
status: open
title: httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file36996/py2.7.httplib.patch

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



[issue22683] bisect index out of bounds issue

2014-10-23 Thread Paul Ianas

Paul Ianas added the comment:

Sure, it is your call. As said, this is rather an enhancement.

Still, if I were to decide, I would chose:
1. not to break the API = raise IndexError instead of ValueError in case hi 
is invalid.
2. to protect against illegal values: as said, if hi  0 bisect_* always 
returns 0 (whatever the searched value).
3. I would implement a single _range_check(_len, lo, hi) method to do this 
logic (DRY).

That being said, from my point of view this ticket can be closed.

--

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



[issue19217] Calling assertEquals for moderately long list takes too long

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

A few thoughts.

Adding a new public symbol seems inappropriate here: this is a performance 
issue that is well predictable and we should cater for that (given difflibs 
current performance).

I'll note in passing that both bzr and hg have much higher performance 
difference algorithms that we could pick up and includes as a replacement 
SequenceMatcher, which might significantly reduce the threshold at which we 
need to default-cap things - but such a threshold will still exist.

I totally agree that _diffThreshold should apply to non-string sequences - 
anything where we're going to hit high-order complexity outputting the 
difference. That said, I speculate that perhaps we'd be better off outputting 
both objects in some structured fashion and letting a later process render them 
(for things like CI systems and test databases, where fidelity of reproduction 
is more important than having the output fit on one screen. This is a different 
issue though and something we should revisit later.

That suggests to me though that the largest diff we output should be chosen 
based on the textual representation of the diff - we're doing it for human 
readability. Whereas the threshold for calculating a diff at all should be 
based on performance. It can be very expensive to calculate a diff on large 
sequences, but the diff might be much much larger than the sequence length 
indicates [because each item in the sequence may be very large]. Perhaps thats 
over thinking it?

Anyhow- short term, surely just making the threshold apply to any sequenced 
type is sufficient to fix the bug?

--
nosy: +rbcollins

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li

New submission from Akira Li:

The patch for Issue #21075: fileinput.FileInput now reads bytes from standard 
stream if binary mode is specified broke code that used
sys.stdin = sys.stdin.detach() with FileInput(mode='rb') in Python 3.3

I've attached the patch that makes FileInput to accept detached sys.stdin 
(without 'buffer' attribute) in binary mode.

--
components: Library (Lib)
files: fileinput-detached-stdin.diff
keywords: patch
messages: 229859
nosy: akira
priority: normal
severity: normal
status: open
title: restore accepting detached stdin in fileinput binary mode
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file36997/fileinput-detached-stdin.diff

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

Just to note that unittest2 tip (unreleased)had michaels proposed fix, which is 
different to that here. I'm going to back that out before doing a release, 
because they should be harmonisious.

--
nosy: +rbcollins

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

My take on this, FWIW, is that any methods in the under-test API - setUp, 
tearDown, test_* and anything registered via addCleanup should all support the 
same protocol as much as possible, whatever it is.

That is, raising a skip in setUp should skip the test. raising a skip in 
tearDown should skip the test, and raising a skip from a cleanup should skip 
the test.

This is complicated by the case where some code is called after exceptions- 
teardown and cleanups. Thats fairly straight forward: errors are higher 
precedence than failure than skips than anything which resolved as a pass.

--

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-23 Thread Nick Coghlan

Nick Coghlan added the comment:

While I agree with Robert's comments in general, the main question to be 
resolved here is the scope of the expectedFailure decorator.

Yes, it's applied specifically to the test execution phase when writing the 
code, but the question is how the following scenarios should be handled when 
the test is marked that way:

- setUp throws an exception
- test passes, tearDown or cleanUp throw an exception
- test fails, tearDown or cleanUp throw an exception
- test throws an exception, tearDown or cleanUp throw an exception

From my perspective, those cases represent:

- error
- unexpected success OR error
- expected failure
- expected failure

If the test itself fails as expected, then I'm OK with cleanup code also 
failing as a consequence.

However, I'd also be OK with the simpler model that treats the decorator as 
covering the whole setUp/test/cleanUp/tearDown cycle, in which case an 
exception from *any* of those methods would be categorised as satisfying the 
expected failure decorator.

--

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

I'd argue for 
 - An error - its not covered by the decorator.
 - An error - the last two are not covered by the decorator.
 - An error - the last two are not covered by the decorator.
 - An error - the exception isn't a 'failure' [today - we should revisit this 
but its a separate issue to the code coverage aspect and the last two aren't 
covered by the decorator.

Perhaps I'm infected by knowing too much about the plumbing, but we can make 
things *super* complex (both implementation and reasoning-about-for-users) if 
we are too clever - and making the decorator affect multiple different methods 
is very much across that line IMO.

If the test itself fails as expected, then I'm OK with cleanup code also 
failing as a consequence.

I'm not unless we've got a really specific reason to be OK with it - in my 
experience that will mask nasty things like leaked temp files which can have 
bad consequences - and because its masked its then hard for developers to 
diagnose. So its bad all around.

However, I'd also be OK with the simpler model that treats the decorator as 
covering the whole setUp/test/cleanUp/tearDown cycle, in which case an 
exception from *any* of those methods would be categorised as satisfying the 
expected failure decorator.

So - I think a simpler still model which is that the decorator covers the 
decorated code is better still, as it doesn't need any explanation about how 
its different to regular python decorators.

--

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



[issue22710] doctest exceptions include nondeterministic namespace

2014-10-23 Thread David Barnett

New submission from David Barnett:

doctests includes special exception processing support (described in 
https://docs.python.org/3/library/doctest.html#what-about-exceptions), but in 
python3 it seems to print the fully-qualified class name even for exception 
classes in the same module, which makes the expected output vary between py2 
and py3.

For instance, given a file spam/eggs.py with these contents:
  class Error(Exception):
  Spam, Bacon, and Spam
  
   raise Error()
  Traceback (most recent call last):
  ...
  Error
  
running the command
  python3 -m doctest spam/eggs.py
will fail expecting eggs.Error instead of just Error.

If you instead invoke it with the command
  nosetests3 --with-doctest spam/eggs.py
it will fail expecting yet another name, spam.eggs.Error.

It may be possible to work around issues like this using ELLIPSIS, but it makes 
the doctests harder to read and it really seems like at least exception classes 
defined in the same file should be able to match by just their short class name.

--
components: Library (Lib)
messages: 229864
nosy: mu_mind
priority: normal
severity: normal
status: open
title: doctest exceptions include nondeterministic namespace
type: behavior
versions: Python 3.2, Python 3.4

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The code

sys.stdin = sys.stdin.detach()

is incorrect because sys.stdin should be text stream, but detach() returns 
binary stream.

--
nosy: +serhiy.storchaka

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



[issue17293] uuid.getnode() MAC address on AIX

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are updated patches for 3.5 (using subprocess) and 3.4 (using os.popen) 
which addresses Victor's comments.

--
Added file: http://bugs.python.org/file36998/uuid_netstat_getnode-3.5_2.patch
Added file: http://bugs.python.org/file36999/uuid_netstat_getnode-3.4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17293
___diff -r f2ce9603346c Lib/test/test_uuid.py
--- a/Lib/test/test_uuid.py Wed Oct 22 12:33:23 2014 +0200
+++ b/Lib/test/test_uuid.py Thu Oct 23 12:57:55 2014 +0300
@@ -320,6 +320,24 @@ class TestUUID(unittest.TestCase):
 if node is not None:
 self.check_node(node, 'ifconfig')
 
+@unittest.skipUnless(os.name == 'posix', 'requires Posix')
+def test_arp_getnode(self):
+node = uuid._arp_getnode()
+if node is not None:
+self.check_node(node, 'arp')
+
+@unittest.skipUnless(os.name == 'posix', 'requires Posix')
+def test_lanscan_getnode(self):
+node = uuid._lanscan_getnode()
+if node is not None:
+self.check_node(node, 'lanscan')
+
+@unittest.skipUnless(os.name == 'posix', 'requires Posix')
+def test_netstat_getnode(self):
+node = uuid._netstat_getnode()
+if node is not None:
+self.check_node(node, 'netstat')
+
 @unittest.skipUnless(os.name == 'nt', 'requires Windows')
 def test_ipconfig_getnode(self):
 node = uuid._ipconfig_getnode()
@@ -377,7 +395,7 @@ eth0  Link encap:Ethernet  HWaddr 12
 return_value=popen):
 mac = uuid._find_mac(
 command='ifconfig',
-arg='',
+args='',
 hw_identifiers=[b'hwaddr'],
 get_index=lambda x: x + 1,
 )
diff -r f2ce9603346c Lib/uuid.py
--- a/Lib/uuid.py   Wed Oct 22 12:33:23 2014 +0200
+++ b/Lib/uuid.py   Thu Oct 23 12:57:55 2014 +0300
@@ -304,7 +304,7 @@ class UUID(object):
 if self.variant == RFC_4122:
 return int((self.int  76)  0xf)
 
-def _find_mac(command, arg, hw_identifiers, get_index):
+def _popen(command, *args):
 import os, shutil, subprocess
 executable = shutil.which(command)
 if executable is None:
@@ -312,28 +312,32 @@ def _find_mac(command, arg, hw_identifie
 executable = shutil.which(command, path=path)
 if executable is None:
 return None
+# LC_ALL=C to ensure English output, stderr=DEVNULL to prevent output
+# on stderr (Note: we don't have an example where the words we search
+# for are actually localized, but in theory some system could do so.)
+env = dict(os.environ)
+env['LC_ALL'] = 'C'
+proc = subprocess.Popen((executable,) + args,
+stdout=subprocess.PIPE,
+stderr=subprocess.DEVNULL,
+env=env)
+return proc
 
+def _find_mac(command, args, hw_identifiers, get_index):
 try:
-# LC_ALL=C to ensure English output, stderr=DEVNULL to prevent output
-# on stderr (Note: we don't have an example where the words we search
-# for are actually localized, but in theory some system could do so.)
-env = dict(os.environ)
-env['LC_ALL'] = 'C'
-cmd = [executable]
-if arg:
-cmd.append(arg)
-proc = subprocess.Popen(cmd,
-stdout=subprocess.PIPE,
-stderr=subprocess.DEVNULL,
-env=env)
+proc = _popen(command, *args.split())
+if not proc:
+return
 with proc:
 for line in proc.stdout:
-words = line.lower().split()
+words = line.lower().rstrip().split()
 for i in range(len(words)):
 if words[i] in hw_identifiers:
 try:
-return int(
-words[get_index(i)].replace(b':', b''), 16)
+word = words[get_index(i)]
+mac = int(word.replace(b':', b''), 16)
+if mac:
+return mac
 except (ValueError, IndexError):
 # Virtual interfaces, such as those provided by
 # VPNs, do not have a colon-delimited MAC address
@@ -346,27 +350,50 @@ def _find_mac(command, arg, hw_identifie
 
 def _ifconfig_getnode():
 Get the hardware address on Unix by running ifconfig.
-
 # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.
 for args in ('', '-a', '-av'):
 mac = _find_mac('ifconfig', args, [b'hwaddr', b'ether'], lambda i: i+1)
 if mac:
 

[issue22691] A Better Help File

2014-10-23 Thread James

James added the comment:

I've written several languages, I'm no novice but, I also know when to brush 
up.Its just how I started, it looks like an opening for others.

-Original Message- 
From: R. David Murray
Sent: Wednesday, October 22, 2014 6:25 AM
To: geek.mo...@gmail.com
Subject: [issue22691] A Better Help File

R. David Murray added the comment:

The help isn't targeted at teaching you to use the module.  The help is 
targeted at *reminding* you how to use the module after you've read the full 
documentation, which usually does contain examples (though generally not at 
the top of the page...they are usually at the bottom or interspersed...it is 
a *reference* guide after all, the tutorial is a separate thing with yet a 
different target).  I'm afraid, though, that if you find the help to be a 
wall of words, you'll find the library reference worse.  You might be best 
serve by checking out the book/website Python Module of the Week 
(pymotw.com), which has a more tutorial style and more examples.

I've never see the Quick Basic style docs.  I don't know if that style would 
be applicable to Python modules.

Bottom line right now, though, is that this isn't really a useful issue for 
the bug tracker.  If you want to discuss strategies for making overall 
improvements in the documentation, that's something that should be done with 
the group of people who focus on documentation.  Their mailing list is 
d...@python.org if you want to join the team and advocate for a change (your 
suggestion has already been posted to that mailing list by the bug tracker, 
FYI).

--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22691
___

--

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li

Akira Li added the comment:

It is incorrect that sys.stdin is *always* a text stream. It often is,
but not always.

There are cases when it is not e.g., 

   $ tar zcf - stuff | gpg -e | ssh user@server 'cat -  stuff.tar.gz.gpg'

tar's stdout is *not* a text stream.
gpg's stdin/stdout are *not* text streams.
ssh's stdin is *not* a text stream.
etc.

If any of the steps are implemented in Python then it is useful to
consider sys.stdin as a binary stream.

Any script written before Python 3.4.1 (#21075) that used FileInput binary mode
*had to* use sys.stdin = sys.stdin.detach()

A bugfix release should not break working code.

--

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 It is incorrect that sys.stdin is *always* a text stream. It often is,
 but not always.
 
 There are cases when it is not e.g.,
 
$ tar zcf - stuff | gpg -e | ssh user@server 'cat -  stuff.tar.gz.gpg'
 
 tar's stdout is *not* a text stream.
 gpg's stdin/stdout are *not* text streams.
 ssh's stdin is *not* a text stream.
 etc.

This is not related to Python. Terms character, string, text, file can 
have different meaning in different domains. In Python we use Python 
terminology. There is no such thing as sys.stdin in Posix-compatible shell, 
because Posix-compatible shell has no the sys module and doesn't use a dot to 
access attributes.

 Any script written before Python 3.4.1 (#21075) that used FileInput binary
 mode *had to* use sys.stdin = sys.stdin.detach()
 
 A bugfix release should not break working code.

Correct solution in this case would be to use the workaround sys.stdin = 
sys.stdin.detach() conditionally, only in Python versions which have a bug.

--

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread Akira Li

Akira Li added the comment:

 This is not related to Python. Terms character, string, text, file 
 can have different meaning in different domains. In Python we use Python 
 terminology. There is no such thing as sys.stdin in Posix-compatible shell, 
 because Posix-compatible shell has no the sys module and doesn't use a dot to 
 access attributes.

I use Python terminology (text - Unicode string, binary data - bytes).

Though text vs. binary data distinction is language independent (
it doesn't matter how Unicode type is called in a particular language).

Python can be used to implement `tar`, `gpg`, `ssh`, `7z`, etc. I don't
see what POSIX has anything to do with that fact.

It is very simple actually: 

  text - encode character encoding - bytes
  bytes - decode character encoding - text

In most cases text should be human readable.

It doesn't make sense to encode/decode input/output of gpg-like utilities using 
a character encoding. *Therefore* the notion of 
sys.stdin being a bytes stream (io.BufferedReader) can be useful
in this case.

The lines produced by FileInput are often (after optional processing)
written to sys.stdout. If binary mode is used then FileInput(mode='rb') 
yields bytes therefore it is also useful to consider sys.stdout
a binary stream (io.BufferedWriter) in this case.

It introduces a nice symmetry:

  text FileInput mode - text streams
  binary FileInput mode - binary streams

By design, FileInput treats stdin as any other file. It
even supports a special name for it: '-'. A file may be in
binary mode; stdin should be able too.

sys.stdout is used outside of FileInput therefore no changes in 
FileInput itself are necessary but sys.stdin is used inside FileInput
that is why the change is needed.

 Correct solution in this case would be to use the workaround sys.stdin = 
sys.stdin.detach() conditionally, only in Python versions which have a bug.

Do you mean every Python 3 version before Python 3.4.1?

Correct solution is to avoid blaming users 
(your fault - you change your programs) for our mistakes  
and fix the bug in Python itself. The patch is attached.

--

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Antoine Pitrou

New submission from Antoine Pitrou:

I just noticed that access to the normal distutils docs has become difficult. 
They are hidden as legacy while a link to the packaging user guide 
(https://packaging.python.org/en/latest/) is prominently displayed.

The problem is that the packaging user guide is an unreadable mess of 
recommandations, which is both tedious and unhelpful when you want a detailed 
documentation of e.g. the setup() function.

I would ask to revert to the old distutils docs until the packaging guide 
becomes up to the task.

--
assignee: docs@python
components: Documentation
messages: 229871
nosy: docs@python, dstufft, eric.araujo, ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: legacy distutils docs better than packaging guide
versions: Python 3.4, Python 3.5

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



[issue22552] ctypes.CDLL returns singleton objects, resulting in usage conflicts

2014-10-23 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

Here's the warnings patch. No sure if the `copy.copy' recipe is officially 
supported.

--
nosy: +native_api
Added file: http://bugs.python.org/file37000/add-warnings.diff

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



[issue22690] importing Gtk breaks strptime

2014-10-23 Thread Sigz

Sigz added the comment:

Ok seems you were right, I was not applying any locale, forcing to 
locale.setlocale(locale.LC_ALL, 'en_US.utf8') resolved the issue.

--

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



[issue22690] importing Gtk breaks strptime

2014-10-23 Thread Sigz

Changes by Sigz d...@sgzdev.net:


--
status: open - closed

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



[issue22709] restore accepting detached stdin in fileinput binary mode

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

I actually agree that this should be applied not only for backward 
compatibility reasons, but because it is better duck typing.  It unfortunately 
leaves code still having to potentially deal with if python version is 3.4.1 
or 3.4.2, but there is nothing that can be done about that.

--
nosy: +r.david.murray
versions:  -Python 3.6

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

I agree with Robert.  I'd rather get notified of a failure in the cleanup...if 
the test is an *expected* failure, then its cleanup should be designed to 
succeed when the test fails; anything else would be a bug in the design of the 
test, IMO.

--

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



[issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

See issue 21224 and issue 9740.  It's not 100% clear to me from reading those 
issues, but it *sounds* like the support is there, you just have to turn it on. 
 So I'm closing this issue as not a bug...either it already works (and you just 
have to set your code to use 1.1) or this is a duplicate of one of those two 
issues, and you should comment on whichever one is more appropriate.

Your point about PIP is a good one, though...that might be worth a specific 
issue for 1.1 support in pip, if it doesn't already have a way to switch it on.

--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Nick Coghlan

Nick Coghlan added the comment:

The old distutils docs are actively wrong in some areas, which is why they have 
been moved from their previous location.

They can't be deleted yet because they contain info that needs to be moved to 
either the distutils module docs, the setuptools docs, or the Python Packaging 
User Guide (although the latter is generally not the right place for detailed 
API references).

Assistance salvaging the information that still needs to be retained out of the 
middle of the now deprecated legacy docs would be greatly appreciated.

--
resolution:  - rejected
status: open - closed

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 The old distutils docs are actively wrong in some areas

Yet they are actively useful in others.

--
resolution: rejected - 
status: closed - open

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



[issue22710] doctest exceptions include nondeterministic namespace

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

It is not possible to work around it with ELLIPSIS.  Look for the flag 
'IGNORE_EXCEPTION_DETAIL', which is mentioned in the section you reference.

--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue22705] Idle extension configuration: add option-help option

2014-10-23 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Would like to check if a tooltip would be appropriate for this?
If yes, I would like to work on it.

--
nosy: +sahutd

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Nick Coghlan

Nick Coghlan added the comment:

For reference, issue #19407 covered the PEP 453 docs updates.

I tried fixing them in place, and judged it utterly impractical to do so - 
moving them out of the way, but keeping them available (including via existing 
deep links) was the resulting compromise.

If you're prepared to help extract the needed data, great, but putting them 
back where they were is *not* going to happen.

--
resolution:  - rejected
status: open - closed

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



[issue13769] json.dump(ensure_ascii=False) return str instead of unicode

2014-10-23 Thread Martijn Pieters

Martijn Pieters added the comment:

I'd say this is a bug in the library, not the documentation. The library varies 
the output type, making it impossible to use `json.dump()` with a `io.open()` 
object as the library will *mix data type* when writing. That is *terrible* 
behaviour.

--
nosy: +mjpieters

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, can you stop closing this issue?

 I tried fixing them in place, and judged it utterly impractical to do so

Why?

 If you're prepared to help extract the needed data, great, but putting them 
 back where they were is *not* going to happen.

Why?

--
status: closed - open

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



[issue22710] doctest exceptions include nondeterministic namespace

2014-10-23 Thread David Barnett

David Barnett added the comment:

But… that doesn't help. It completely changes the semantics of the doctests. I 
have a bunch of doctests demonstrating different failures of the same exception 
class, and with IGNORE_EXCEPTION_DETAIL running my doctests to verify they're 
still correct is next to useless. Plus it's very noisy to slap # doctest: 
+IGNORE_EXCEPTION_DETAIL everywhere just to get not-pathological behavior.

And this isn't even just about py2/py3 interoperability. It's a problem for my 
py3-only project, which fails depending on how I invoke doctests. So it's not 
just something we can hack around until py2 goes away and be fine.

Can't a separate option be added for just the module name and enabled by 
default?

--

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



[issue22710] doctest exceptions include nondeterministic namespace

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

Not to 2.7, since that would be a new feature.

In Python we do not consider the content of an error message (as opposed to the 
exception class itself) to be part of the API, so it is not surprising that 
doctest does not really support checking it across versions.  That said, I 
agree that it would be nice to have.  If you want to propose a feature patch 
you can reopen the issue and update the title.

A workaround would be to capture the exception and display its str.  This would 
have the advantage of not cluttering your doctests with the Traceback lines, at 
the cost of having a try/except in your code sample.

--

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



[issue13769] json.dump(ensure_ascii=False) return str instead of unicode

2014-10-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The revised doc admits the problem: If *ensure_ascii* is False, some chunks 
written to *fp* may be unicode instances.  Unless fp.write() explicitly 
understands unicode (as in codecs.getwriter) this is likely to cause an error.

Making text be unicode in 3.x is our attempt at a generic fix to the problems 
resulting from the bug-prone 2.x 'text may be bytes or unicode' design.  Since 
continued 2.7 support is aimed at supporting legacy code, we are very reluctant 
to make behavior changes that could break working code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13769
___
___
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

2014-10-23 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

I think the reason this patch hasn't been discussed well is that it only 
changes the behavior for traceback.*_tb functions that only deal with 
tracebacks. I commented on the review page that we don't have to change the 
behavior of traceback.*_stack functions to make it obvious. Let me show an 
example:

import sys

def a():
b()

def b():
c()

def c():
d()

def d():
def e():
print_stack(limit=2) # Last 2 entries
''' Output:
File file, line 331, in d 

  
  e()   

  
File file, line 328, in e
  print_stack(limit=2) # Last 2 entries '''
raise Exception
e()

try:
a()
except Exception:
print_exc(limit=2) # 2 entries from the caller
''' Output:
Traceback (most recent call last):
  File file, line 336, in module
a()
  File file, line 318, in a
b()
Exception '''

If we decide to unify the behavior of *_tb and *_stack functions, the change 
will break some existing code, although the breakage will be purely cosmetic.

--

___
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



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

More likely the lack of discussion is just that Serhiy is busy :)

Breaking code is to be avoided if possible.  Can you give an example of the 
cosmetic change?

I haven't fully reviewed the patch, but a more meaningful name than 'condition' 
might make the code more readable.  Perhaps 'handling_negative_limit'?

--
nosy: +r.david.murray

___
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



[issue22712] Add 'input' argument to subprocess.check_call and subprocess.call

2014-10-23 Thread zodalahtathi

New submission from zodalahtathi:

Python 3.4 added a 'input' argument to the subprocess.check_output function to 
send bytes to stdin, but it was surprisingly not added to other subprocess 
helpers.

The same functionality should be added to subprocess.check_call and 
subprocess.call.

--
components: Library (Lib)
messages: 229889
nosy: zodalahtathi
priority: normal
severity: normal
status: open
title: Add 'input' argument to subprocess.check_call and subprocess.call
type: enhancement
versions: Python 3.5

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



[issue22713] print()

2014-10-23 Thread Garry Smith

New submission from Garry Smith:

Problem with print()
I did the following by accident while in the python console, print = 10, which 
it let me do, to horror.after that I could not use the print() command without 
getting the following error:-

Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'int' object is not callable

This is what I type in the console.

print = 33
a = 34
print(a)

Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'int' object is not callable.

The only way to get the print command back was close and reopen the console.

--
messages: 229890
nosy: gazza7364
priority: normal
severity: normal
status: open
title: print()
type: behavior
versions: Python 3.4

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



[issue22698] Add constants for ioctl request codes

2014-10-23 Thread Charles-François Natali

Charles-François Natali added the comment:

Adding ioctl constants is fine.
However, I think that if we do this, it'd be great if we could also
expose this information in a module (since psutil inclusion was
discussed recently), but that's probably another issue.

--

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



[issue22713] print()

2014-10-23 Thread Georg Brandl

Georg Brandl added the comment:

This is as expected; the new global name print overrides the builtin name 
print.

(What you could also have done to remove your binding is del print, which 
removes the global binding.)

--
nosy: +georg.brandl
resolution:  - not a bug
status: open - closed

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



[issue6818] remove/delete method for zipfile/tarfile objects

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with Martin and Lars, this issue is not so easy at looks at first 
glance.

For ZIP files we should distinct two different operations.

1. Remove the entry from the central directory (and may be mark local file 
header as invalid if it is possible). This is easy, fast and safe, but it 
doesn't change the size of ZIP file.

2. Physical remove the content of the file from ZIP file. This is so easy as 
remove a line from the text file. In worst case it has linear complexity from 
the size of ZIP file.

2a. The safer way is to create temporary file in the same directory, copy the 
content of original ZIP file excluding deleted file, and then replace original 
ZIP file by modified copy. Be aware about file and parent directory 
permissions, owners, and disk space.

2b. The faster but less safe way is to shift the content of the ZIP file 
after deleted file by reading it and writing back in the same ZIP file at 
different position. This way is not safe because when something bad happen at 
writing, we can lost all data. And of course there are crafty ZIP files in 
which the order of files doesn't match the order in central directory or even 
files data overlap.

For performance may be we should implement (2) not as a method to remove single 
file, but as a method which takes the filter function and then left in the ZIP 
file only files for which it returns true.

Or may be implement (1) and then add a method which cleans up the ZIP archive 
be removing all files removed from the central directory. We should discuss 
alternatives.

And as for concrete patch, zipfile.remove.2.patch can read the content of all 
ZIP file in the memory. This is not appropriate, because ZIP file can be very 
large.

--
stage: patch review - 

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



[issue22712] Add 'input' argument to subprocess.check_call and subprocess.call

2014-10-23 Thread R. David Murray

R. David Murray added the comment:

call and check_call are designed as APIs that do *not* manage the standard 
streams of the commands called.  If you want to manage the streams, either use 
check_output or Popen directly.

Internally, call and check call do *not* use communicate, and it is communicate 
that supports the input parameter.  The better way to support input for call 
and check_call would be to implement the full proposal advanced by Serhiy in 
issue 16624 (and deprecate 'input' entirely).

So, I think this should either be rejected, or turned into an enhancement 
request for Serhiy's proposal.

--
nosy: +r.david.murray, serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22712
___
___
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

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Last patch is more complicated and needs more time to review.

I suppose the code would be more clear if split _extract_tb_or_stack_iter() to 
parts. One generator just generates (filename, lineno, name, f.f_globals) 
tuples. Then these tuples either handled directly or passed through a deque 
with fixed size.

And some tests would be good.

--

___
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



[issue21344] save scores or ratios in difflib get_close_matches

2014-10-23 Thread Michael Ohlrogge

Michael Ohlrogge added the comment:

This is my first time posting here, so apologies if I'm breaking rules.

I'd like to put in a vote in favor of this patch to get the matching scores.

I am a researcher at Stanford University using this tool to match up about 
100,000 different names of companies/entities in two different datasets that I 
have.  The names reflect the same underlying entities but because they come 
from different datasets, the spellings, abbreviations, etc. differ.

It would be helpful to me to be able to run the get_scored_close_matches() 
function and then sort the results by how close the matches were.  If I could 
for instance determine, based on some spot checking / sampling of the results, 
that everything with a match above a certain threshold is almost certainly 
correct, whereas those below a certain threshold need to be reviewed by hand, 
that would be helpful for me.  

I suppose I can accomplish something similar by playing around with setting the 
matching threshold at different levels.  Nevertheless, with as many possible 
matches as I am doing, the algorithm takes a decent amount of time to run, and 
I don't have a good way to know ex-ante what a reasonable threshold would be.

Just in general, I think it can be useful information for users to know how 
much confidence to have in the matches produced by the algorithm.  Users could 
choose to formulate this confidence either as a direct function of the score or 
perhaps based on some other factors, such as a statistical analysis procedure 
that takes the score into account.  

Thanks to everyone who put this package together and who suggested the patch.

--
nosy: +michaelohlrogge
versions: +Python 2.7 -Python 3.5

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



[issue22712] Add 'input' argument to subprocess.check_call and subprocess.call

2014-10-23 Thread zodalahtathi

zodalahtathi added the comment:

I think the 'stdin argument can be any file like or stream for all subprocess 
functions' approach would be the best solution, because it is misleading to 
differentiate behavior based on internal implementation details (the use of 
communicate), when the function names are so close and are expected to have a 
similar behavior.

It's not that I really need or miss the input argument for check call and call 
(as you said it is easy to circumvent). 
The issue IMO is that it is unintuitive that it is available for check_output 
and not others.

--

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



[issue22712] Add 'input' argument to subprocess.check_call and subprocess.call

2014-10-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Then I'm closing this issue.

--
resolution:  - rejected
stage:  - resolved
status: open - closed

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



[issue22594] Add a link to the regex module in re documentation

2014-10-23 Thread Serhiy Storchaka

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


--
components: +Regular Expressions

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you! The patch looks good to me, I'm going to apply it.

--

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



[issue7940] re.finditer and re.findall should support negative end positions

2014-10-23 Thread Serhiy Storchaka

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


--
components: +Regular Expressions
priority: normal - low
stage: needs patch - patch review
versions: +Python 3.5 -Python 3.4

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



[issue22676] _pickle's whichmodule() is slow

2014-10-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e5ad1f27fb54 by Antoine Pitrou in branch 'default':
Issue #22676: Make the pickling of global objects which don't have a __module__ 
attribute less slow.
https://hg.python.org/cpython/rev/e5ad1f27fb54

--
nosy: +python-dev

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Done. Thank you for your contribution!

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

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread Roundup Robot

Roundup Robot added the comment:

New changeset aee097e5a2b2 by Antoine Pitrou in branch 'default':
Issue #13918: Provide a locale.delocalize() function which can remove
https://hg.python.org/cpython/rev/aee097e5a2b2

--
nosy: +python-dev

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread STINNER Victor

STINNER Victor added the comment:

+:const:'LC_NUMERIC`settings.

a space is missing before settings, no?

--
nosy: +haypo

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



[issue22676] _pickle's whichmodule() is slow

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Now applied. As Georg said, though, the definitive fix is to add a __module__ 
attribute to your global objects.

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

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



[issue10076] Regex objects became uncopyable in 2.5

2014-10-23 Thread Serhiy Storchaka

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


--
components: +Regular Expressions
versions: +Python 3.4, Python 3.5 -Python 3.1

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, right, thank you.

--

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



[issue13918] locale.atof documentation is missing func argument

2014-10-23 Thread Georg Brandl

Georg Brandl added the comment:

And the first quote is wrong.

--

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



[issue21344] save scores or ratios in difflib get_close_matches

2014-10-23 Thread Michael Ohlrogge

Michael Ohlrogge added the comment:

Another way the scores could be useful would be to write an algorithm that 
would give you a number of possible answers based on the scores that you get.  
In other words, for example, perhaps if one of the possible matches has a score 
about .9, then it would only give you one, but if all were below .8, it would 
give you several.  Or, if the highest score were at least .1 greater than the 
next highest, it would only give you one, but if there were a bunch that were 
close together, it would return those.  

I'm not saying these specific applications should be part of the package, they 
are just more examples of how you could productively use the scores.

--

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2014-10-23 Thread Berker Peksag

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


--
nosy: +berker.peksag

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Nick Coghlan

Nick Coghlan added the comment:

No, I won't stop closing this issue, because reverting to advertising the 
legacy installation and distribution docs through a top level docs home page 
link is *never going to happen* (although I'll note again that direct links 
into the legacy docs have been explicitly preserved).

If you have concerns that the API reference docs for distutils and setuptools 
are too hard to locate from packaging.python.org, then the appropriate place to 
file an issue is at https://github.com/pypa/python-packaging-user-guide/issues

If you have concerns with the setuptools docs, then the place to file issues is 
https://bitbucket.org/pypa/setuptools/issues. pip injects setuptools into all 
of its setup.py invocations in order to ensure modern metadata is generated, 
even on older versions of Python. This is one of the reasons the legacy docs 
are thoroughly misleading - vanilla distutils will be used only if you run 
setup.py directly (without pip), and the script itself imports distutils rather 
than setuptools. If you *do* run setup.py that way, then many now expected 
features of the Python packaging ecosystem like API entry point declarations, 
command line wrapper generation and packaging dependency declarations won't be 
available, as they're setuptools features, rather than distutils ones.

If you'd like more detail on all the things that are sufficiently outdated in 
the legacy distribution and installation docs to make them actively misleading, 
then the place to ask for that information is the distutils-sig mailing list, 
not the CPython issue tracker.

--
status: open - closed

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



[issue22592] Drop support of Borland C compiler

2014-10-23 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/issue22592
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22695] open() declared deprecated in python 3 docs

2014-10-23 Thread Berker Peksag

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


--
nosy: +berker.peksag

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



[issue22711] legacy distutils docs better than packaging guide

2014-10-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Surely, if you think you are right, you can still wait for the discussion to 
happen without aggressively trying to shut it down.

Besides, you are not the docs dictator, nor the distutils maintainer. We are a 
community, this isn't your private territory.

 If you have concerns that the API reference docs for distutils and
 setuptools are too hard to locate from packaging.python.org

No, I'm having concerns that they are too hard to locate *from docs.python.org* 
(which is most people's landing point, as well). Which is why I'm opening this 
issue here.

--
resolution: rejected - 
status: closed - open

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



[issue19217] Calling assertEquals for moderately long list takes too long

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

Oh, I got a profile from the test case for my own interest.

6615 seconds ..

some highlights that jumped out at me

200010.1270.000 6610.0250.330 difflib.py:868(compare)

which means we're basically using ndiff, which is cubic rather than quadratic - 
the same performance issue the html module had.

I think we'll probably make a better tradeoff by using unified_diff instead 
which is quadratic.

--
Added file: http://bugs.python.org/file37001/issue19217-profile.txt

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2014-10-23 Thread Robert Collins

Robert Collins added the comment:

Thanks for the review, updated patch here - I'll let this sit for a day or two 
for more comments then commit it Monday.

--
Added file: http://bugs.python.org/file37002/issue7559.patch

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



[issue22705] Idle extension configuration: add option-help option

2014-10-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was originally thinking of displaying 'option-help' beside a read-only text 
widget containing the value, just under the enable key-value pairs.  But I can 
imagine that tooltips attached to the label (on the left) might be a better 
alternative.  This would avoid having half the text in the page being help text 
that would just be noise to someone who already knew what it says.  It would 
also allow reformatting of data parsed from the option-help text.  So go ahead 
and give it a try.  I have lots else to do ;-).

I want to restore / add the [Help] button to both dialogs.  For the main 
dialog, it could contain info about which options have a delayed effect (see 
#22707).  For extensions, it could display the raw option-help text and mention 
how to get tool tips.

ToolTip.py (and CallTipWindow.py, with an expanded version of the tooltip 
code), use a Toplevel with its window frame and title bar surpressed.  An 
alternate way to get a popup box with a simple thin-line frameis a menu and its 
tk_popup method. I believe the command associated with each 'menu' item could 
just be lambda: pass to close the popup when clicked.  (One thing not clear 
to me is why tooltip (and calltip) create a new Toplevel for each display 
rather than just changing the text of the widget it displays.)

--

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



[issue22707] Idle: changed options should take effect immediately

2014-10-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For Idle preferences, a Help text could list options that do not take effect 
immediately.  For extensions, there should be an indication in an extension's 
option-help (#22705).

--

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



[issue22714] target of 'import statement' entry in general index for 'i' is wrong

2014-10-23 Thread Van Ly

New submission from Van Ly:

The target points to within '__import__()' but should point to 'import()' 
method function.

For example,

# 'import statement' entry at index for 'i' on the following page
python-2.7.5-docs-html/genindex-I.html

# points to
python-2.7.5-docs-html/library/functions.html#index-8

# but should point to
python-2.7.5-docs-html/reference/simple_stmts.html#import

--
assignee: docs@python
components: Documentation
messages: 229914
nosy: docs@python, vy0123
priority: normal
severity: normal
status: open
title: target of 'import statement' entry in general index for 'i' is wrong
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.5

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



[issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method

2014-10-23 Thread Vova

Vova added the comment:

The issue http://bugs.python.org/issue21224 is about http server 
implementations. The issue http://bugs.python.org/issue9740 is more relevant 
for what I talking about, but not exactly.

Look, in this line 

https://hg.python.org/cpython/file/6a2f74811240/Lib/http/client.py#l786

http protocol version is setted and in this line 

https://hg.python.org/cpython/file/6a2f74811240/Lib/http/client.py#l1036

variable used to send http method (GET, PUT etc) and it work for direct 
connection or proxy with http connections. But if required to use CONNECT 
method through proxy (usually used for https connection) will be used _tunnel() 
method from http.client (py3k) or httplib (py2.7)

https://hg.python.org/cpython/file/6a2f74811240/Lib/http/client.py#l871

and here version off http is hardcoded to HTTP/1.0

PIP use urllib3, but urllib3 for actual network working (work with socket and 
send request) use httplib or http.client. So I think it would be better to make 
changes in httplib than override _tunnel() method in urllib3.

P.S. I'm not sure about rules how to open/close issues, so I open this issue 
again. I'm sorry if this causes some inconvenience.

--
resolution: not a bug - 
status: closed - open

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