[issue18533] Avoid error from repr() of recursive dictview

2013-07-24 Thread Ben North

Ben North added the comment:

New patch, fixing nit noted in msg193624:

non-error-recursive-dictview-3.3-1.patch

Otherwise same as previous

non-error-recursive-dictview-3.3.patch

--
Added file: 
http://bugs.python.org/file31025/non-error-recursive-dictview-3.3-1.patch

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



[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread anatoly techtonik

anatoly techtonik added the comment:

I've made my own monster, attached.

--
Added file: http://bugs.python.org/file31026/DictRecord.py

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



[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

You need a better use case though.
termios awful constant names ('TIOCGWINSZ') and values ('\x1b') won't become 
more easy with a nametuple.

--
resolution:  - works for me
status: open - closed

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



[issue791968] Arguments tooltip wrong if def contains tuple

2013-07-24 Thread ariel brunner

ariel brunner added the comment:

I will, sorry. I thought it's possible reopen an issue. Since all the relevant 
information is already contained here, and since the problem is with the fix to 
the issue, I figured it's best to reopen this one.

--

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2013-07-24 Thread Matt Hickford

Matt Hickford added the comment:

( Upstreamed from Pip https://github.com/pypa/pip/issues/942 )

There are lot of Python users on Windows. If they succeed in installing a 
package manager (a struggle), this is typically their first experience with it

$ pip install numpy

blah blah blah

Error: Unable to find vcvarsall.bat

The misery is compounded by the cryptic error message. They don't know whether 
the problem with their computer, the specific package, or pip generally. Let 
alone how to fix it.

You and I know this happens because the package install involves building some 
C code from source and the user doesn't have a C compiler installed. The fix is 
to install mingw32 (or Visual Studio) and edit distutils.cfg to specify to use 
that compiler. 

Thus, it would be really helpful to print a message after 'error: unable to 
find vcvarsall.bat' such as

 Installing this package requires a C compiler. To fix this error, follow 
 http://stackoverflow.com/q/2817869/284795

--
nosy: +Matt.Hickford

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



[issue18539] Arguments tooltip wrong if def contains fractional default value

2013-07-24 Thread ariel brunner

New submission from ariel brunner:

When defining a function with factional default arguments, the tuple text 
replaces the correct values in the tooltip.

Here's an example -

 def f(a=0.5):
pass
 f(

tooltip shows - (a=0tuple), i.e. replaces the .5 with tuple.

This was found to happen on IDLE with python 2.7.3 and 2.7.5 (the latter was on 
64 bit python installation on a windows 7 machine).

The problem was discussed here - 
http://stackoverflow.com/questions/17053492/pythons-idle-behavior-while-defining-fractional-default-values-to-function-para
and the problem was found to stem from the CallTips.py file (exact code lines 
in the link).

I believe this is the result of a fix to issue791968.

--
components: IDLE
messages: 193631
nosy: ariel_bruner
priority: normal
severity: normal
status: open
title: Arguments tooltip wrong if def contains fractional default value
type: behavior
versions: Python 2.6, Python 2.7

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



[issue18539] Arguments tooltip wrong if def contains fractional default value

2013-07-24 Thread ariel brunner

Changes by ariel brunner ariel...@mail.tau.ac.il:


--
versions:  -Python 2.6

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



[issue18540] imaplib.IMAP4() ends with Name or service not known on Fedora 18

2013-07-24 Thread Matěj Stuchlík

New submission from Matěj Stuchlík:

Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib64/python2.7/imaplib.py, line 163, in __init__
self.open(host, port)
  File /usr/lib64/python2.7/imaplib.py, line 229, in open
self.sock = socket.create_connection((host, port))
  File /usr/lib64/python2.7/socket.py, line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known

Steps to Reproduce:
1. run python interpreter
2. import imaplib
3. imaplib.IMAP4()

Expected behavior would be, as per documentation, for imaplib to try to connect 
to localhost.

The root cause is, I believe, this:

socket.py::create_connection states An host of '' [...] tells the OS to use 
the default. and thus imaplib uses '' as the default value for host, however 
from getaddrinfo (to which function the host variable is passed) documentation 
and source it seems to me that it expect None, not '' as the default value.

Substituting '' for None as the default value for host in imaplib.py seems to 
resolve this issue, I've included a tentative patch that does just that.

In case this will need patching I'd be more than happy to work on a more 
complete patch! :)

--
components: Library (Lib)
files: imaplib.patch
keywords: patch
messages: 193632
nosy: sYnfo
priority: normal
severity: normal
status: open
title: imaplib.IMAP4() ends with Name or service not known on Fedora 18
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file31027/imaplib.patch

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Antoine Pitrou

New submission from Antoine Pitrou:

The idiomatic way to use a LoggerAdapter is to override the process() method. 
However, the example in the cookbook (*) is some gobbledegook code overriding 
__getitem__ and __iter__ on a separate class. It's a pity that users are 
directed to use an insane and impractical idiom while the sane way is simple 
and powerful.

(*) http://docs.python.org/2/howto/logging-cookbook.html#context-info

--
assignee: docs@python
components: Documentation
messages: 193633
nosy: docs@python, pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: LoggerAdapter example is counter-productive
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue18542] httpd memory consuption increasing continously due to mod_python

2013-07-24 Thread Sumitinder

New submission from Sumitinder:

Mod_python is used in our application and continous load of mod_python result 
in increase in httpd memory usage i.e upto 1.6 Gb.

Packets used:
mod_python-3.2.8-3.1
httpd-2.2.3-43.el5.centos
Centos 5.5 OS

Is there any memory leak in mod_python which is resulting in increase in memory 
?

--
messages: 193634
nosy: sumitinder
priority: normal
severity: normal
status: open
title: httpd memory consuption increasing continously due to mod_python
type: performance
versions: Python 3.2

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



[issue18542] httpd memory consuption increasing continously due to mod_python

2013-07-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

mod_python isn't part of the cpython std lib. As such, this isn't the right 
tracker to report problems with mod_python.

You may have more success by asking the project itself 
(http://www.modpython.org).

--
nosy: +ronaldoussoren
resolution:  - invalid
status: open - pending

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



[issue2066] Adding new CNS11643, a *huge* charset, support in cjkcodecs

2013-07-24 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue3453] PyType_Ready doesn't ensure that all bases are ready

2013-07-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I don't know if multiple inheritance is explicitly supported at the C level, 
but it is possible to create an extension type with multiple base classes in 
tp_bases.

--
nosy: +ronaldoussoren

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



[issue10131] deepcopying an xml.dom.minidom.Document generates an invalid XML document

2013-07-24 Thread Bohuslav Slavek Kabrda

Changes by Bohuslav Slavek Kabrda bkab...@redhat.com:


--
nosy: +bkabrda

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



[issue4708] os.pipe should return inheritable descriptors (Windows)

2013-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Changing the default inheritance value of os.pipe() is not acceptable because 
it would break backward compatibility.

Giving access to Windows extra parameter is nice, but we have to find a way to 
propose a portable API. That's what I'm trying to do with the PEP 446 (and it's 
previous version, the PEP 433).

--

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



[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread anatoly techtonik

anatoly techtonik added the comment:

Do not hijack the issue - value interpretation is the next step, which better 
keep out of scope for this improvement. termios is a C interface, which 
documents the meaning of TIOCGWINSZ and has defined names for structure 
entries, such as lflag. This issue is to make Python code at least as readable 
as C.

C doesn't allow you to revert value meaning from ('\x1b') to text form.

--
status: closed - open

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



[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread anatoly techtonik

anatoly techtonik added the comment:

If you need a better use case for DictRecord, urlparse is another one.

--

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



[issue18543] urllib.parse.urlopen shouldn't ignore installed opener when called with any ca* argument

2013-07-24 Thread Moritz Sichert

New submission from Moritz Sichert:

If you pass any of cafile, capath or cadefault to urllib.parse.urlopen it 
creates a new opener that contains the HTTPSHandler that was according to the 
ca* arguments. It then uses this new opener to execute the request.
If you installed a custom opener with urllib.parse.install_opener it won't be 
used.

urlopen should either add a HTTPSHandler to the installed opener or not accept 
any Handler specific arguments at all.

--
components: Library (Lib)
messages: 193640
nosy: moritzs
priority: normal
severity: normal
status: open
title: urllib.parse.urlopen shouldn't ignore installed opener when called with 
any ca* argument
type: behavior
versions: Python 3.2, Python 3.3, Python 3.4

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



[issue18078] threading.Condition to allow notify on a specific waiter

2013-07-24 Thread João Bernardo

João Bernardo added the comment:

ping.

--

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



[issue18078] threading.Condition to allow notify on a specific waiter

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Charles-François's point about the algorithmic complexity is legitimate, so I 
think he was actually waiting for you to amend your patch ;)

--

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



[issue18078] threading.Condition to allow notify on a specific waiter

2013-07-24 Thread João Bernardo

João Bernardo added the comment:

 Charles-François's point about the algorithmic complexity is 
 legitimate, so I think he was actually waiting for you to amend
 your patch ;)

This doesn't seems to be the actual issue as it would require a big change for 
something that wasn't proven important... The old behavior is still O(1) in the 
new implementation. 

I might change that, but can someone give me an actual idea to implement that? 
Also, this can be done on another patch.


** The real problem **

I pointed out one issue about which conditions should be considered when waking 
up and there was no answer: http://bugs.python.org/msg190556

Also, Richard Oudkerk wrote he was expecting wait_for_any() return a list: 
http://bugs.python.org/msg190597

I need to get feedback about the first one to change the second one.

--

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



[issue6627] threading.local() does not work with C-created threads

2013-07-24 Thread Ronald Oussoren

Changes by Ronald Oussoren ronaldousso...@mac.com:


--
nosy: +ronaldoussoren

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Vinay Sajip

Vinay Sajip added the comment:

That's not quite right. The recommended way *is* to override the process() 
method. From the page you linked to:

If you need a different method, e.g. if you want to prepend or append the 
contextual information to the message string, you just need to subclass 
LoggerAdapter and override process() to do what you need.

That does not have a specific example, as it seems simple enough to understand 
as stated.

The example you mention shows something else - how you would adapt an existing 
class (which might have information to go into the log) so that it could be 
passed (instead of a dict) to the LoggerAdapter initialiser. Possibly I could 
put this example into a separate section Adapting an existing class to provide 
context information for logging - this would make it clear that it's a 
separate use case and not the primary use case when using LoggerAdapter. The 
text seems clear enough,

illustrates what dict-like behaviour is needed from an arbitrary ‘dict-like’ 
object for use in the constructor, but splitting it out into a separate 
section will make it easier for those who are speed-reading the docs.

--

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 That does not have a specific example, as it seems simple enough to
 understand as stated.

I think we should acknowledge that people often have difficulties
with the rather simple functionalities of the logging module,
not only the advanced ones.

 The example you mention shows something else - how you would adapt an
 existing class (which might have information to go into the log) so
 that it could be passed (instead of a dict) to the LoggerAdapter
 initialiser.

But how is that necessary for the use case? Your LoggerAdapter-derived
class could take the existing class as a constructor parameter (*), then
inject the required info in its overriden process() method.

(*) either by overriding the constructor, or simply by passing the
existing class as an entry in the extra dict.

If I had trusted your doc blindly, I would have thought it necessary
to go through the complicated scheme, while the simple scheme is 
actually sufficient to add per-connection info to log messages.

--

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



[issue18544] subprocess.Popen support for redirection of arbitrary file descriptors

2013-07-24 Thread Robert O'Callahan

New submission from Robert O'Callahan:

Popen() ought to support redirection to/from more file descriptors than 0, 1, 
and 2 when spawning processes. A clear use case is here: 
http://stackoverflow.com/questions/6050187/write-to-file-descriptor-3-of-a-python-subprocess-popen-object

Instead of messing around with os.open() and os.close() calls, my proposed API 
for Popen would be to accept keyword arguments fdN that would take the same 
type of values as the stdin, stdout, stderr arguments. Conflicting fd0 and 
stdin arguments would throw an exception.

So the smelly code in the above SO question would be changed to:


cmd='gpg --passphrase-fd {fd} -c'.format(fd=fd)
with open('passphrase.txt','r') as fd3_fh:
with open('filename.txt','r') as stdin_fh:
with open('filename.gpg','w') as stdout_fh:
proc=subprocess.Popen(shlex.split(cmd),
  stdin=stdin_fh,
  stdout=stdout_fh,
  fd3=fd3_fh)
proc.communicate()

--
components: Library (Lib)
messages: 193646
nosy: ropoctorix
priority: normal
severity: normal
status: open
title: subprocess.Popen support for redirection of arbitrary file descriptors
type: enhancement

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

Unless I'm misunderstanding something, the current implementation does match 
the current documentation: if buffer-size  n, returning buffer-size bytes 
is returning up to n.  Up to means it could be less than.

So you are advocating a change in behavior...but I believe there is a reason 
read1 is implemented the way it is, so I suspect that isn't going to happen.  
Probably what you want to do is change the buffer size when you open the file 
so that it is greater than your 'n'.

--
nosy: +r.david.murray

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



[issue18545] enum always runs member_type when use_args is True

2013-07-24 Thread Chris Lambacher

New submission from Chris Lambacher:

Starting at line 153 in enum.py there is:

   153 if not use_args:
   154 enum_member = __new__(enum_class)
   155 original_value = value
   156 else:
   157 enum_member = __new__(enum_class, *args)
   158 original_value = member_type(*args)
   159 if not hasattr(enum_member, '_value_'):
   160 enum_member._value_ = original_value

When use_args is True, the member_type is always called with the arguments even 
if the return value from enum_member has a _value_ attr. If the __new__ 
function transforms the the *args then the call to member_type(*args) can fail 
even thought the value would not be used. I've attached a patch with a fix and 
a test to demonstrate the problem.

The use case for the test in the attached patch is to populate Django ORM 
choices to a field. The first value in the tuple is the value used in the 
database (and as the Enum value) and the second value in the tuple is the label 
that Django shows in select boxes.

--
files: enum_value_transform.patch
keywords: patch
messages: 193648
nosy: lambacck
priority: normal
severity: normal
status: open
title: enum always runs member_type when use_args is True
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file31028/enum_value_transform.patch

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Vinay Sajip

Vinay Sajip added the comment:

 I think we should acknowledge that people often have difficulties
 with the rather simple functionalities of the logging module,
 not only the advanced ones.

Perhaps some people do have difficulties, but that's always going to be the 
case no matter what you do. A cookbook should explore different things, both 
simple and less simple.

 But how is that necessary for the use case? Your LoggerAdapter-
 derived class could take the existing class as a constructor
 parameter (*), then inject the required info in its overriden
 process() method.

If you can adapt an existing class to look sufficiently like a dict, that's all 
you need to do - there's no need to subclass LoggerAdapter and override 
process(). There might be cases where that's the easier option.

It's surprising how resistant people can be to subclassing and overriding. For 
example, for issue #18345 which you raised (which I haven't yet addressed as 
you said it was low-priority), one straightforward approach would be to 
subclass the relevant FileHandler classes.

 If I had trusted your doc blindly, I would have thought it necessary
 to go through the complicated scheme

It depends on how carefully you read it - I don't think it's *actually* 
misleading, and I quoted in my earlier response the sentence, which comes 
before the example, which says that overriding process() is what you'd normally 
do.

What about my suggestion about a separate section for the example, to make it 
clearer that it's just another approach which might be more suitable in some 
scenarios?

--

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



[issue18533] Avoid error from repr() of recursive dictview

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

I'm in favor of treating this a bugfix.  It is a bug for repr to raise a 
recursion error, IMO.

--
nosy: +r.david.murray

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 This means that read1() will only return up to n bytes if n is smaller
 than the buffer size, otherwise it will return at most buffer-size
 bytes.

Did you actually observe such behaviour? If so, this is a bug.

--

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



[issue18535] termios.tcgetattr should return namedtuple

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

Anatoly: FYI Do not hijack the issue is not a collaborative conversation 
style in English.  A more collaborative conversation style would be to leave 
out that part of the sentence, and just say that you think value interpretation 
should be a separate, later issue (with your reasons, of course).

--
nosy: +r.david.murray

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

  But how is that necessary for the use case? Your LoggerAdapter-
  derived class could take the existing class as a constructor
  parameter (*), then inject the required info in its overriden
  process() method.
 
 If you can adapt an existing class to look sufficiently like a dict,
 that's all you need to do - there's no need to subclass
 LoggerAdapter and override process(). There might be cases where
 that's the easier option.

I am not talking about adapting a class. I am taking about overriding
process() to do the adapting in a simpler way than in your example.

--

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



[issue18546] ssl.get_server_certificate like addition for cert chain

2013-07-24 Thread Derek Wilson

New submission from Derek Wilson:

the ssl.get_server_certificate function is very useful for just requesting a 
cert. It would also be very useful to have a parallel function, possibly 
ssl.get_server_cert_chain that does the same thing except but provides a tuple 
of PEM encoded certs comprising the chain provided by the peer.

It would also be very useful, given that we have the ability to collect certs 
and cert chains without validating them, to have a separate convenience method 
for validation of certs given a cert (or chain) and the file/path to trusted CA 
root certs.

This way we could collect a cert chain once and validate against different ca 
cert stores, or collect a set of cert chains and do batch validation.

oh, and I'd love to see the _ssl._decode_certificate function exposed so that 
we can get easily get python data structure from certs.

If any of this sounds useful I would be happy to submit patches.

--
components: Extension Modules
messages: 193654
nosy: underrun
priority: normal
severity: normal
status: open
title: ssl.get_server_certificate like addition for cert chain
type: enhancement
versions: Python 3.4

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



[issue18543] urllib.parse.urlopen shouldn't ignore installed opener when called with any ca* argument

2013-07-24 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray

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



[issue18540] imaplib.IMAP4() ends with Name or service not known on Fedora 18

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

So this represents a change in behavior of the socket library on Fedora 18 vs 
earlier versions?  Do any of the impalib tests fail?

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

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2013-07-24 Thread Nick Coghlan

Nick Coghlan added the comment:

Just noting for the record (since it appears it was never brought back to the 
comments): it is expected that programs that manipulate the AST may require 
updates before they will work on a new version of Python. Preserving AST 
backwards compatbility is too limiting to the evolution of the language, so 
only source compatibility is promised.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2013-07-24 Thread Nick Coghlan

Nick Coghlan added the comment:

(That was the outcome of the suggested AST discussions on python-dev that were 
mentioned earlier)

--

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



[issue18546] ssl.get_server_certificate like addition for cert chain

2013-07-24 Thread Christian Heimes

Christian Heimes added the comment:

I'm already working on the issue and I have a couple of patches in my work 
queue, e.g. #18369, #18233, #18147, #16487 and #18293

--
nosy: +christian.heimes
stage:  - needs patch
superseder:  - SSLSocket.getpeercertchain()

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



[issue18545] enum always runs member_type when use_args is True

2013-07-24 Thread Ethan Furman

Changes by Ethan Furman et...@stoneleaf.us:


--
assignee:  - ethan.furman
nosy: +ethan.furman

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



[issue18546] ssl.get_server_certificate like addition for cert chain

2013-07-24 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
assignee:  - christian.heimes

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



[issue18078] threading.Condition to allow notify on a specific waiter

2013-07-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

IMHO

1) It should check all predicates.
2) It should return a list of ready conditions.
3) It should *not* accept a list of conditions.
4) from_condition() should be removed.

Also notify() should try again if releasing a waiter raises RuntimeError 
because it has already been released.  Otherwise notify() can be a noop even 
when there are threads waiting on the condition.

I would also put

for cond in conditions:
cond._remove_waiter(waiter)

in wait_for_any() in to a finally clause in case the wait was interrupted by 
KeyboardInterrupt.  (Accounting for KeyboardInterrupt everywhere is not 
feasible, but for blocking calls which can be interrupted I think we should 
try.)

--

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



[issue18078] threading.Condition to allow notify on a specific waiter

2013-07-24 Thread João Bernardo

João Bernardo added the comment:

 1) It should check all predicates.
OK. Maybe later there could be an option for customization?

 2) It should return a list of ready conditions.
OK.

 3) It should *not* accept a list of conditions.
The list option would be to simplify the wait method... Avoiding things like: 
 {cond: (lambda: True)}

 4) from_condition() should be removed.
OK. Could the Lock object be made part of the api, then? like self.lock 
instead of self._lock

I'm OK with the rest of your post. Will make new patch

--

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



[issue18546] ssl.get_server_certificate like addition for cert chain

2013-07-24 Thread Derek Wilson

Derek Wilson added the comment:

very cool - i had seen a couple of those patches and they look good. Most of 
what I asked for is implemented in supporting bits for those issues.

Is their anything you could use some help on? I'm very interested in seeing 
better ssl support in python.

--

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



[issue18547] os.path.dirname() does not behave as expected for path without /:es

2013-07-24 Thread Jonas Eriksson

New submission from Jonas Eriksson:

Only tested on marked python versions. Checked the code in hg (a5681f50bae2) 
and did not see anything related to this in the current development version.

Essentially, what I see is this:
 os.path.dirname(asdf)
''
 os.path.dirname(./asdf)
'.'
 

What I expect is the same output as from the unix command dirname:
$ dirname asdf
.
$ dirname ./asdf
.
$ 

The change is quite straight forwards, Lib/posixpath.py needs something like if 
head = : head = ., and Lib/ntpath.py something similar.

Now, this bug is a tricky one since it alters the behavior of dirname. However, 
I cannot see any case where  would be useful and have seen at least one bug 
because of this behaviour because the return value  is treated like an error. 
So I gracefully hand over the final decision to you :)

--
components: Library (Lib)
messages: 193662
nosy: Jonas.Eriksson
priority: normal
severity: normal
status: open
title: os.path.dirname() does not behave as expected for path without /:es
type: behavior
versions: Python 2.7, Python 3.2

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



[issue18540] imaplib.IMAP4() ends with Name or service not known on Fedora 18

2013-07-24 Thread Matěj Stuchlík

Matěj Stuchlík added the comment:

So this represents a change in behavior of the socket library on Fedora 18 vs 
earlier versions?

I don't believe so. This happens on my Fedora 18 system, my Debian box with 
Python 2.6.6, on Fedora 19 
(https://bugzilla.redhat.com/show_bug.cgi?id=987340), another Debian system 
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=591471) and python compiled 
from the default branch does the same thing.

The documentation for imaplib.IMAP4 says:
If host is not specified, '' (the local host) is used.

My point is that imaplib.IMAP4 without any arguments should try to connect to 
localhost, however this is not what is currently happening, at least on the 
systems mentioned above. Why I think this is happening I've tried to explain in 
my previous comment.

Do any of the impalib tests fail?
Nope.

--

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



[issue18541] LoggerAdapter example is counter-productive

2013-07-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16c15d7d4480 by Vinay Sajip in branch '2.7':
Issue #18541: simplified LoggerAdapter example.
http://hg.python.org/cpython/rev/16c15d7d4480

New changeset adaecee37745 by Vinay Sajip in branch '3.3':
Issue #18541: simplified LoggerAdapter example.
http://hg.python.org/cpython/rev/adaecee37745

New changeset f931ee89cc1c by Vinay Sajip in branch 'default':
Closes #18541: merged update from 3.3.
http://hg.python.org/cpython/rev/f931ee89cc1c

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

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



[issue18540] imaplib.IMAP4() ends with Name or service not known on Fedora 18

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

OK, yeah, this seems to be long standing, untested behavior.  I will take a 
look at what should be done here.

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

On 07/24/2013 07:35 AM, Antoine Pitrou wrote:
 
 Antoine Pitrou added the comment:
 
 This means that read1() will only return up to n bytes if n is smaller
 than the buffer size, otherwise it will return at most buffer-size
 bytes.
 
 Did you actually observe such behaviour? If so, this is a bug.

Yes, that's what I see:

$ python3 bug.py
Read 20 bytes using read()
Read 10 bytes using read1()

$ cat bug.py
#!/usr/bin/env python3

import io

raw = io.BytesIO(bytes(200))
buffered = io.BufferedReader(raw, 10)

data = buffered.read(20)
print('Read %d bytes using read()' % len(data))

data = buffered.read1(20)
print('Read %d bytes using read1()' % len(data))

There should be no problem reading 20 bytes with a single call to
BytesIO.read(), yet the buffered reader returns only 10 bytes.

--

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



[issue18548] In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()

2013-07-24 Thread py.user

New submission from py.user:

http://docs.python.org/3/library/unittest.html#organizing-test-code

def suite():
suite = unittest.TestSuite()
suite.addTest(WidgetTestCase('test_default_size'))
suite.addTest(WidgetTestCase('test_resize'))
return suite


--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 193667
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In unittest doc change WidgetTestCase to SimpleWidgetTestCase in suite()
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31029/issue.diff

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



[issue18547] os.path.dirname() does not behave as expected for path without /:es

2013-07-24 Thread R. David Murray

R. David Murray added the comment:

Oh, it would definitely be a backward compatibility issue.  Imagine code that 
does a dirname and branches like this:

   d = dirname(somepath)
   if d:
   handle directory
else:
   no directory case

Or to give a more concrete example:

   path = fn if dirname(fn) else os.path.join(defaultdir, fn)

As you can see, the current behavior has significant value in Python.  So I 
think it is behaving correctly.  Python is not the shell, even though it does 
have many functions that provide APIs very similar to the corresponding shell 
functions.

See issue 17545 for a related issue, and specifically msg189401 for another 
reason why the current behavior of dirname is correct within the logic of 
Python.

Based on the above I'm going to go ahead and close this.  If other developers 
disagree they can reopen.  If they don't, and you disagree, I would suggest 
that talking about it on python-ideas would be your next step.

--
nosy: +r.david.murray
resolution:  - rejected
stage:  - committed/rejected
status: open - closed

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



[issue18549] Dead code in socket_ntohl()

2013-07-24 Thread Christian Heimes

New submission from Christian Heimes:

http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l4642

The code has two checks if (x == (unsigned long) -1  PyErr_Occurred()). 
Coverity claims that the second time is dead code and I agree. It looks like an 
artifact from the time the function didn't check for integer overflow. CID 
982369

--
messages: 193669
nosy: christian.heimes, haypo, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Dead code in socket_ntohl()
type: behavior
versions: Python 3.3, Python 3.4

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



[issue18550] internal_setblocking() doesn't check return value of fcntl()

2013-07-24 Thread Christian Heimes

New submission from Christian Heimes:

http://hg.python.org/cpython/file/96d817f41c4c/Modules/socketmodule.c#l614

CID 715331 (#1 of 1): Unchecked return value from library (CHECKED_RETURN)
5. check_return: Calling function fcntl(s-sock_fd, 4, delay_flag) without 
checking return value. This library function may fail and return an error code.

It's rather tedious to fix the issue. No function checks the return value of 
internal_setblocking()...

--
messages: 193670
nosy: christian.heimes, haypo
priority: low
severity: normal
stage: needs patch
status: open
title: internal_setblocking() doesn't check return value of fcntl()
type: behavior
versions: Python 3.3, Python 3.4

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



[issue18489] IDLE Unit test for SearchEngine.py

2013-07-24 Thread Phil Webster

Phil Webster added the comment:

Added tests for the rest of the SearchEngine module. I used the mock 
tkMessageBox for testing the error display, but used the tkinter Text widget 
for other tests because mark_set and tag_add/remove haven't been added to the 
mock yet.

--
Added file: http://bugs.python.org/file31030/test_searchengine2.patch

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



[issue18551] child_exec() doesn't check return value of fcntl()

2013-07-24 Thread Christian Heimes

New submission from Christian Heimes:

http://hg.python.org/cpython/file/96d817f41c4c/Modules/_posixsubprocess.c#l384

CID 715330 (#2 of 2): Unchecked return value from library (CHECKED_RETURN)
17. check_return: Calling function fcntl(c2pwrite, 2, old  
0xfffe) without checking return value. This library function may 
fail and return an error code.

Could this cause any kind of trouble or shall I dismiss the issue as 
intentional?

--
messages: 193672
nosy: christian.heimes, haypo
priority: low
severity: normal
stage: needs patch
status: open
title: child_exec() doesn't check return value of fcntl()
type: behavior
versions: Python 3.3, Python 3.4

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



[issue18468] re.group() should never return a bytearray

2013-07-24 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18552] obj2ast_object() doesn't check return value of PyArena_AddPyObject()

2013-07-24 Thread Christian Heimes

New submission from Christian Heimes:

CID 1046712 (#1 of 1): Unchecked return value (CHECKED_RETURN)
3. check_return: Calling function PyArena_AddPyObject(PyArena *, PyObject *) 
without checking return value (as is done elsewhere 5 out of 6 times).
4. unchecked_value: No check of the return value of PyArena_AddPyObject(arena, 
obj).
 708PyArena_AddPyObject(arena, obj);

--
files: asdl.patch
keywords: patch
messages: 193673
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: obj2ast_object() doesn't check return value of PyArena_AddPyObject()
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file31031/asdl.patch

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le mercredi 24 juillet 2013 à 18:24 +, Nikolaus Rath a écrit :
 There should be no problem reading 20 bytes with a single call to
 BytesIO.read(), yet the buffered reader returns only 10 bytes.

Er. Your bug report seems to imply that read1(n) can return *more* than
n bytes, which would be a bug.
That it may return less than n bytes is correct, though.

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

On 07/24/2013 02:28 PM, Antoine Pitrou wrote:
 
 Antoine Pitrou added the comment:
 
 Le mercredi 24 juillet 2013 à 18:24 +, Nikolaus Rath a écrit :
 There should be no problem reading 20 bytes with a single call to
 BytesIO.read(), yet the buffered reader returns only 10 bytes.
 
 Er. Your bug report seems to imply that read1(n) can return *more* than
 n bytes, which would be a bug.
 That it may return less than n bytes is correct, though.

I admit the bug title may not have been chosen carefully enough.

The documentation is correct that read1(n) never returns more than n bytes.

My complaint is that the actual bound is stricter than this, band
read1(n) will never return more than min(n, bufsize) bytes.

To me, this seems unnecessary and counterintuitive. Why am I restricted
by the buffer size if the underlying raw device could provide the
requested amount with one call?

Looking at the source, this restriction seems caused by read1() calling
peek(). I think it would be straightforward to just delegate a read1(n)
call to raw stream's read(n) method.

This would improve performance, and also make the documentation more
accurate.

Did I miss something?

Best,
Nikolaus

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le mercredi 24 juillet 2013 à 21:45 +, Nikolaus Rath a écrit :
 The documentation is correct that read1(n) never returns more than n bytes.
 
 My complaint is that the actual bound is stricter than this, band
 read1(n) will never return more than min(n, bufsize) bytes.

That's not really true. If the buffer is empty, read1(n) will try to
read at most n bytes from the raw stream. So:
- if the buffer is not empty, the whole buffer is returned and 0 raw I/O
call is issued
- if the buffer is empty, 1 raw I/O call is issued and at most 1 byte is
returned

Therefore, if you call read1(n) in a loop, all calls but the first will
really try to read *n* bytes from the raw stream (because the first call
will have emptied the buffer).

(one implicit goal is to minimize the number of memory copies when
returning data to the application; a well-known consumer of read1()
calls is TextIOWrapper when it fills its internal buffer)

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le mercredi 24 juillet 2013 à 21:51 +, Antoine Pitrou a écrit :
 - if the buffer is empty, 1 raw I/O call is issued and at most 1 byte is
 returned

Make that at most n bytes are returned, of course.

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

On 07/24/2013 02:51 PM, Antoine Pitrou wrote:
 
 Antoine Pitrou added the comment:
 
 Le mercredi 24 juillet 2013 à 21:45 +, Nikolaus Rath a écrit :
 The documentation is correct that read1(n) never returns more than n bytes.

 My complaint is that the actual bound is stricter than this, band
 read1(n) will never return more than min(n, bufsize) bytes.
 
 That's not really true. If the buffer is empty, read1(n) will try to
 read at most n bytes from the raw stream. So:
 - if the buffer is not empty, the whole buffer is returned and 0 raw I/O
 call is issued
 - if the buffer is empty, 1 raw I/O call is issued and at most 1 byte is
 returned
 
 Therefore, if you call read1(n) in a loop, all calls but the first will
 really try to read *n* bytes from the raw stream (because the first call
 will have emptied the buffer).

I agree that this is how it *should* work. But that's not what's
happening in practice:

 $ python3
Python 3.2.3 (default, Feb 20 2013, 14:44:27)
[GCC 4.7.2] on linux2
Type help, copyright, credits or license for more information.
 import io
 raw = io.BytesIO(bytes(200))
 buffered = io.BufferedReader(raw, 10)
 while True:
... buf = buffered.read1(20)
... print('Read %d bytes' % len(buf))
... if not buf:
...break
...
Read 10 bytes
Read 10 bytes
Read 10 bytes
Read 10 bytes
Read 10 bytes
Read 10 bytes
Read 10 bytes
Read 10 bytes
[...]

--

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, well. This is already fixed, then:

Python 3.4.0a0 (default:ae769deb45b2, Jul 20 2013, 19:28:41) 
[GCC 4.7.3] on linux
Type help, copyright, credits or license for more information.
 import io
 raw = io.BytesIO(bytes(200))
 buffered = io.BufferedReader(raw, 10)
 while True:
...   buf = buffered.read1(20)
...   print(Got %d bytes % len(buf))
...   if not buf:
... break
... 
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 20 bytes
Got 0 bytes


However, 3.2 didn't get that improvement, sorry. See changeset 27bf3d0b8e5f and 
issue #13393.

--
resolution:  - duplicate
status: open - closed

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
superseder:  - Improve BufferedReader.read1()

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



[issue18524] BufferedReader.read1() documentation/implementation difference

2013-07-24 Thread Nikolaus Rath

Nikolaus Rath added the comment:

On 07/24/2013 03:04 PM, Antoine Pitrou wrote:
 However, 3.2 didn't get that improvement, sorry. See changeset 27bf3d0b8e5f 
 and issue #13393.
 
 --
 resolution:  - duplicate
 status: open - closed

Duh. So much back and forth just to find it's already fixed. Python is
moving too fast these days... :-).

-Nikolaus

--

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



[issue16937] -u (unbuffered I/O) command line option documentation mismatch for sys.stdin

2013-07-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4b33f74ab0f1 by Ezio Melotti in branch '3.3':
#16937: document that stdin is always buffered, even when -u is used.  Patch by 
Elena Oat.
http://hg.python.org/cpython/rev/4b33f74ab0f1

New changeset 52f0aa0d552a by Ezio Melotti in branch 'default':
#16937: merge with 3.3.
http://hg.python.org/cpython/rev/52f0aa0d552a

--
nosy: +python-dev

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



[issue16937] -u (unbuffered I/O) command line option documentation mismatch for sys.stdin

2013-07-24 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
assignee: docs@python - ezio.melotti
nosy: +ezio.melotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - enhancement

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



[issue14853] test_file.py depends on sys.stdin being unseekable

2013-07-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 17542d36effd by Ezio Melotti in branch '2.7':
#14853: remove test that was making too many assumptions about stdin.  Patch by 
Elena Oat.
http://hg.python.org/cpython/rev/17542d36effd

New changeset c5d847ee354a by Ezio Melotti in branch '3.3':
#14853: remove test that was making too many assumptions about stdin.  Patch by 
Elena Oat.
http://hg.python.org/cpython/rev/c5d847ee354a

New changeset 1d0ff57e392e by Ezio Melotti in branch 'default':
#14853: merge with 3.3.
http://hg.python.org/cpython/rev/1d0ff57e392e

--
nosy: +python-dev

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



[issue14853] test_file.py depends on sys.stdin being unseekable

2013-07-24 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the patch!

--
assignee:  - ezio.melotti
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.3, Python 3.4

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



[issue5262] PythonLauncher considered harmfull

2013-07-24 Thread Ezio Melotti

Ezio Melotti added the comment:

FWIW more than once I tried to open a .py file on Windows just to see a black 
box flashing by and promptly disappear.  I agree that opening the file in an 
editor (e.g. IDLE) is a better option, but I realize some users might prefer to 
launch a script when they double-click on it (I always launch them by doing 
python file.py).

--
nosy: +ezio.melotti

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



[issue18376] show the effective count of process when running the testsuite

2013-07-24 Thread Ezio Melotti

Ezio Melotti added the comment:

LGTM.
This could go in 2.7 and 3.3 too IMHO.

--
nosy: +pitrou

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



[issue9495] argparse unittest tracebacks are confusing if an error is raised when not expected

2013-07-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords:  -easy
nosy: +ezio.melotti
stage: needs patch - patch review
versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2

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



[issue7982] extend captured_output to simulate different stdout.encoding

2013-07-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue18529] Use long dash

2013-07-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-24 Thread Phil Webster

Phil Webster added the comment:

This patch moves the comment_header code to reformat_comment, adds tests for 
reformat_comment, and implements the fix that Todd mentioned in #18429. In 
addition, I changed the get_comment_header and get_indent regular expressions 
to only look for spaces and tabs, rather than any whitespace ('\s'). These 
functions should only ever get single lines, but I don't think characters like 
newline would ever need to be part of the comment header.

--
Added file: 
http://bugs.python.org/file31032/18226IDLEUnitTestFormatParagraph6.patch

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