[issue20841] asyncio.StreamReader.readline() lack lines limit optional parameter

2014-03-03 Thread Alexandre JABORSKA

Alexandre JABORSKA added the comment:

Well,

  You're right, I'm confused, and I cannot use the http.client.parse_headers(). 
I made a workaround by reading all lines in a BytesIO and parse this one.

  Anyway, if it not possible to use a file like object with the asyncio module, 
which is absolutly fantastic (I installed the 3.4RC just for it), a lot a 
modules will need a rewrite/adaptation to be useable. I guess every module that 
use any kind of IO is the list : logging, servers, parsers, etc.

  Thanks !

Alexandre

--

___
Python tracker 

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



[issue18943] argparse: default args in mutually exclusive groups

2014-03-03 Thread paul j3

paul j3 added the comment:

I need to tweak the last patch so 'using_default' is also set when an 
"nargs='*'" positional is set to the '[]' default.

 if action.default is not None:
 value = action.default
+using_default = True
 else:
 value = arg_strings
+using_default = True  # tweak

--

___
Python tracker 

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



[issue20849] add exist_ok to shutil.copytree

2014-03-03 Thread Elias Zamaria

Elias Zamaria added the comment:

Here is a patch that adds the option.

I am not very familiar with the internals of shutil and os so I would recommend 
that someone else review it.

I haven't added any tests. I can try to if anyone wants but I am not sure how 
long it will take me or if I will find the time any time soon.

--
keywords: +patch
nosy: +mikez302
Added file: http://bugs.python.org/file34282/shutil-copytree-exist_ok.patch

___
Python tracker 

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



[issue20849] add exist_ok to shutil.copytree

2014-03-03 Thread Alexander Mohr

New submission from Alexander Mohr:

it would be REALLY nice (and REALLY easy) to add a parameter: exist_ok and pass 
this to os.makedirs with the same parameter name so you can use copytree to 
append a src dir to an existing dst dir.

--
components: Library (Lib)
messages: 212691
nosy: thehesiod
priority: normal
severity: normal
status: open
title: add exist_ok to shutil.copytree
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue19980] Improve help('non-topic') response

2014-03-03 Thread Elias Zamaria

Elias Zamaria added the comment:

Here is a patch that addresses the empty string problem described by 
@BreamoreBoy. I am not sure if this is the best way to handle it but it is 
better than what we have now.

--
Added file: http://bugs.python.org/file34281/empty-help-response.patch

___
Python tracker 

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



[issue20847] asyncio docs should call out that network logging is a no-no

2014-03-03 Thread Yury Selivanov

Yury Selivanov added the comment:

> If you really need network logging you should be able to configure a handler 
> that puts things in a queue whose other end is serviced by an asyncio task. 
> There should be no need to mess with the type of the logger object.

It's something that is easy to misconfigure. Having [logger+queue+logging 
thread] combination mitigates the risk a bit, but yeah, at the cost of 
increased complexity...

> Anyway, in 3.4 it is what it is. :-)

Right.

--

___
Python tracker 

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



[issue20840] AttributeError: 'module' object has no attribute 'ArgumentParser'

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Please show the output from

   print(argparse.__file__)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman

Ethan Furman added the comment:

Ah, thanks!  Docs are built, fixed, and built again.

Larry, the two cherries to pick for this are:

b637064cc696: bulk of doc changes
54ab95407288: fixes for ReST markup

Thanks.

--

___
Python tracker 

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



[issue20840] AttributeError: 'module' object has no attribute 'ArgumentParser'

2014-03-03 Thread bsduni

bsduni added the comment:

Unfortunately it is not that case, ie, no argparse in my current working 
directory /home/bsduni/pytests/ (on a FreeBSD 9.2 system).

The following are the locations I can find argparse in my system:

/usr/local/lib/python2.7/argparse.py
/usr/local/lib/python2.7/argparse.pyo
/usr/local/lib/python2.7/argparse.pyc

/usr/ports/lang/python27/work/Python-2.7.6/Doc/howto/argparse.rst
/usr/ports/lang/python27/work/Python-2.7.6/Doc/library/argparse.rst
/usr/ports/lang/python27/work/Python-2.7.6/Lib/argparse.py

/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.py
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.pyc
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.pyo

/usr/local/lib/python2.7/site-packages/IPython/external/argparse

/usr/local/lib/python2.7/site-packages/argparse.py
/usr/local/lib/python2.7/site-packages/argparse.pyc
/usr/local/lib/python2.7/site-packages/argparse-1.1-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse
/usr/local/lib/python2.7/site-packages/argparse_actions
/usr/local/lib/python2.7/site-packages/argparse_actions-0.4.4-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse_config
/usr/local/lib/python2.7/site-packages/argparse_config-0.5.1-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse.extra-0.0.2-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse.extra-0.0.2-py2.7-nspkg.pth


The the files in /usr/local/lib/python2.7/site-packages/ are from the 'pip 
install' which I tried when argparse didnot work after the installation of 
Python in full (ie, with argparse files in /usr/local/lib/python2.7/)

--

___
Python tracker 

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



[issue20653] Pickle enums by name

2014-03-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 54ab95407288 by Ethan Furman in branch 'default':
Issue20653: fix ReST for Enum
http://hg.python.org/cpython/rev/54ab95407288

--

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Ned Deily

Ned Deily added the comment:

This is existing behavior.  The error messages are coming from Distutils doing 
a byte compile (producing .pyc) on .py files it is installing.  AFAIK, that has 
always been treated as a warning in all versions of Distutils; changing that 
behavior now could break the installation of existing packages (yes, I have 
seen packages, usually tests, that produce these messages).  As is the case 
with much of Distutils, its exact behavior with regard to byte-compiling has 
never been documented.   

Note that while pyttsx uses setuptools in its setup.py, even if you edit it to 
call distutils directly, you still get the same behavior (neither pip nor 
setuptools nor python3.4 is involved):

curl -O https://pypi.python.org/packages/source/p/pyttsx/pyttsx-1.1.tar.gz
tar -xfz ./pyttsx-1.1.tar.gz
cd ./pyttsx-1.1
python3.3 setup.py install -v
[...]
copying build/lib/pyttsx/voice.py -> 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx
byte-compiling 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx/__init__.py
 to __init__.cpython-33.pyc
byte-compiling 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx/driver.py
 to driver.cpython-33.pyc
  File 
"/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx/driver.py",
 line 105
except Exception, e:
^
SyntaxError: invalid syntax
byte-compiling 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx/voice.py
 to voice.cpython-33.pyc
running install_egg_info
Removing 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx-1.1-py3.3.egg-info
Writing 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/pyttsx-1.1-py3.3.egg-info
$ echo $?
0

--

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Éric Araujo

Éric Araujo added the comment:

Can you assume good faith from the people involved and stay civil in the 
discussion?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Mark Lawrence

Mark Lawrence added the comment:

>From PEP 453 "Abstract - This PEP proposes that the Installing Python Modules 
>guide in Python 2.7, 3.3 and 3.4 be updated to officially recommend the use of 
>pip as the default installer for Python packages, and that appropriate 
>technical changes be made in Python 3.4 to provide pip by default in support 
>of that recommendation."  If this is the *RECOMMENDED* default installer what 
>are the bad ones like?  Note the bit "appropriate technical changes be made in 
>Python 3.4".  As this is an officially endorsed product quite specifically 
>targetted at Python 3.4, slap bang in the middle of a release candidate I 
>don't expect to see core devs waffling on about what we'll do the future, I 
>expect to see fixes now or have this product officially withdrawn from 3.4.

--

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Well, the fact that a syntax error can result in a "successful install" message 
is a bug *somewhere*, and like I said I've seen this before with pip (on linux, 
so this issue has nothing to do with windows).

I guess it's a distutils bug, and falls into that category I mentioned of 
packaging bugs "we" will work on in the future...

--

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Ned Deily

Ned Deily added the comment:

It's not a bug and has nothing to do with pip per se. The PyPI entry of this 
package makes no claims that it is supported on Python 3 nor does its README.  
PEP 453 does not make any claims to add new capabilities to pip to 
automatically try to transform packages written for Python 2.  If you installed 
pip with Python 3.3 and tried to install this package, you'd get exactly the 
same result.  If you downloaded the package source and manually installed it 
with "python3 setup.py" (e.g. no pip), you'd still get the same result.

--
nosy: +ned.deily

___
Python tracker 

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



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

You have to install sphinx now.  The doc build tools no longer fetch it from 
svn.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman

Ethan Furman added the comment:

For the past couple weeks everytime I try I get:

sphinx-build -b html -d build/doctrees -D latex_paper_size=  . build/html 
make: sphinx-build: Command not found
make: *** [build] Error 127

--

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Why can't you remove the "= NULL" from the Clinic input for "string"?

Because this will prohibit the use of "pattern" as keyword argument.

--

___
Python tracker 

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



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Larry Hastings

Larry Hastings added the comment:

Why can't you build the docs on your system?  "make html" works for me every 
time--it even downloads the packages it needs.

--

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Nick Coghlan

Nick Coghlan added the comment:

OK, I can add it tonight.

--

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-03 Thread Larry Hastings

Larry Hastings added the comment:

Why can't you remove the "= NULL" from the Clinic input for "string"?

--

___
Python tracker 

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



[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> However, do note that the semantics will end up different from other uses of 
unicode. e.g.:
> >>> "aa".strip(u"b")
> 
> u'aa'

And this behavior is weird.

>>> print 'À\n'.strip('\n')
À
>>> print 'À\n'.strip(u'\n')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: 
ordinal not in range(128)

The self argument of str.strip is variable, but the chars argument is almost  
always a literal and affected by unicode_literals future.

--

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The disadvantage of sre_deprecate_pattern_keyword-3.4.patch is that it creates 
false signature for SRE_Pattern.match(). Default value of first argument is 
exposed as None, but actually this parameter is mandatory and None is not 
valid value for it. I afraid the only way to get rid of false signature (and 
keep backward compatibility) is to revert converting to Argument Clinic.  And 
here is a patch which do this.

--
Added file: 
http://bugs.python.org/file34280/sre_deprecate_pattern_keyword-3.4_2.patch

___
Python tracker 

___diff -r c47cc6351ce7 Modules/_sre.c
--- a/Modules/_sre.cMon Mar 03 21:19:19 2014 +0200
+++ b/Modules/_sre.cMon Mar 03 23:11:13 2014 +0200
@@ -526,59 +526,49 @@
 return sre_ucs4_search(state, pattern);
 }
 
-/*[clinic input]
-module _sre
-class _sre.SRE_Pattern "PatternObject *" "&Pattern_Type"
-
-_sre.SRE_Pattern.match as pattern_match
-
-pattern: object
-pos: Py_ssize_t = 0
-endpos: Py_ssize_t(c_default="PY_SSIZE_T_MAX") = sys.maxsize
-
-Matches zero or more characters at the beginning of the string.
-[clinic start generated code]*/
-
-PyDoc_STRVAR(pattern_match__doc__,
-"match($self, /, pattern, pos=0, endpos=sys.maxsize)\n"
-"--\n"
-"\n"
-"Matches zero or more characters at the beginning of the string.");
-
-#define PATTERN_MATCH_METHODDEF\
-{"match", (PyCFunction)pattern_match, METH_VARARGS|METH_KEYWORDS, 
pattern_match__doc__},
-
 static PyObject *
-pattern_match_impl(PatternObject *self, PyObject *pattern, Py_ssize_t pos, 
Py_ssize_t endpos);
+fix_string_param(PyObject *string, PyObject *string2, const char *oldname)
+{
+if (string2 != NULL) {
+if (string != NULL) {
+PyErr_Format(PyExc_TypeError,
+ "Argument given by name ('%s') and position (1)",
+ oldname);
+return NULL;
+}
+if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "The '%s' keyword parameter name is deprecated.  "
+ "Use 'string' instead.", oldname) < 0)
+return NULL;
+return string2;
+}
+if (string == NULL) {
+PyErr_SetString(PyExc_TypeError,
+"Required argument 'string' (pos 1) not found");
+return NULL;
+}
+return string;
+}
 
 static PyObject *
 pattern_match(PatternObject *self, PyObject *args, PyObject *kwargs)
 {
-PyObject *return_value = NULL;
-static char *_keywords[] = {"pattern", "pos", "endpos", NULL};
-PyObject *pattern;
+static char *_keywords[] = {"string", "pos", "endpos", "pattern", NULL};
+PyObject *string = NULL;
 Py_ssize_t pos = 0;
 Py_ssize_t endpos = PY_SSIZE_T_MAX;
-
-if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-"O|nn:match", _keywords,
-&pattern, &pos, &endpos))
-goto exit;
-return_value = pattern_match_impl(self, pattern, pos, endpos);
-
-exit:
-return return_value;
-}
-
-static PyObject *
-pattern_match_impl(PatternObject *self, PyObject *pattern, Py_ssize_t pos, 
Py_ssize_t endpos)
-/*[clinic end generated code: output=1528eafdb8b025ad input=26f9fd31befe46b9]*/
-{
+PyObject *pattern = NULL;
 SRE_STATE state;
 Py_ssize_t status;
-PyObject *string;
-
-string = state_init(&state, (PatternObject *)self, pattern, pos, endpos);
+
+if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+"|Onn$O:match", _keywords,
+&string, &pos, &endpos, &pattern))
+return NULL;
+string = fix_string_param(string, pattern, "pattern");
+if (!string)
+return NULL;
+string = state_init(&state, (PatternObject *)self, string, pos, endpos);
 if (!string)
 return NULL;
 
@@ -603,12 +593,16 @@
 SRE_STATE state;
 Py_ssize_t status;
 
-PyObject* string;
+PyObject *string = NULL, *string2 = NULL;
 Py_ssize_t start = 0;
 Py_ssize_t end = PY_SSIZE_T_MAX;
-static char* kwlist[] = { "pattern", "pos", "endpos", NULL };
-if (!PyArg_ParseTupleAndKeywords(args, kw, "O|nn:fullmatch", kwlist,
- &string, &start, &end))
+static char* kwlist[] = { "string", "pos", "endpos", "pattern", NULL };
+if (!PyArg_ParseTupleAndKeywords(args, kw, "|Onn$O:fullmatch", kwlist,
+ &string, &start, &end, &string2))
+return NULL;
+
+string = fix_string_param(string, string2, "pattern");
+if (!string)
 return NULL;
 
 string = state_init(&state, self, string, start, end);
@@ -637,12 +631,16 @@
 SRE_STATE state;
 Py_ssize_t status;
 
-PyObject* string;
+PyObject *string = NULL, *string2 = NULL;
 Py_ssize_t start = 0;
 Py_ssize_t end = PY_SSIZE_T_MAX;
-static char* kwlist[] = { "pattern", "pos", "endpos", NULL };
-if (!PyArg_ParseTupleAn

[issue20847] asyncio docs should call out that network logging is a no-no

2014-03-03 Thread Guido van Rossum

Guido van Rossum added the comment:

If you really need network logging you should be able to configure a handler 
that puts things in a queue whose other end is serviced by an asyncio task. 
There should be no need to mess with the type of the logger object. Anyway, in 
3.4 it is what it is. :-)

--

___
Python tracker 

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



[issue20848] 3.4 cherry-pick: b637064cc696 Improve enum subclass behavior

2014-03-03 Thread Ethan Furman

New submission from Ethan Furman:

Two minor code changes addressing the "more pythonic" comments.  Major doc 
enhancement addressing the functional API.  Not sure about the markup as I can 
no longer create the docs on my system.

--
assignee: larry
messages: 212670
nosy: ethan.furman, larry
priority: release blocker
severity: normal
stage: commit review
status: open
title: 3.4 cherry-pick: b637064cc696  Improve enum subclass behavior
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue20653] Pickle enums by name

2014-03-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b637064cc696 by Ethan Furman in branch 'default':
Close issue20653: improve functional API docs; minor code changes
http://hg.python.org/cpython/rev/b637064cc696

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15014] smtplib: add support for arbitrary auth methods

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Oh, sorry.  I meant to start out that message by saying, thanks for the patch.  
Your idea is indeed interesting from the standpoint of not needing to change 
the rest of the API, butand then the rest of my message.

In other words, I appreciate your work and your approach, but I think the 
reasons I outline argue for a different approach.

--

___
Python tracker 

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



[issue15014] smtplib: add support for arbitrary auth methods

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

There is a lot of repeated code in those methods, which becomes a maintenance 
burden.  That is one reason the imaplib authobj approach seems interesting to 
me.  Also, going the authobj route would mean imaplib and smptlib had a 
consistent interface for this, and consistency is good where it makes sense.

--
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue20847] asyncio docs should call out that network logging is a no-no

2014-03-03 Thread Yury Selivanov

Yury Selivanov added the comment:

Can we instead re-engineer asyncio logging to have logger calls in a separate 
thread?

I.e. `logger` is a proxy object, that puts logging calls in a queue, and there 
would be another thread to block on the queue and do the actual logging. This 
way it won't really matter how logging is configured.

--
nosy: +yselivanov

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Mark Lawrence

Mark Lawrence added the comment:

This should have been tested before it got into a release candidate, not left 
to users to find such a blatantly obvious bug.  I'll leave the PEP authors to 
sort this out, I've no intention of spending my time clearing up their mess.

--

___
Python tracker 

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



[issue20847] asyncio docs should call out that network logging is a no-no

2014-03-03 Thread Guido van Rossum

New submission from Guido van Rossum:

The asyncio package uses the logging module. We should remind users that they 
should always configure their logs to go to a file on the local filesystem -- 
using any kind of network logging will block the event loop.

--
assignee: haypo
messages: 212664
nosy: gvanrossum, haypo
priority: normal
severity: normal
status: open
title: asyncio docs should call out that network logging is a no-no
versions: Python 3.4

___
Python tracker 

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



[issue15014] smtplib: add support for arbitrary auth methods

2014-03-03 Thread Milan Oberkirch

Milan Oberkirch added the comment:

I implemented one approach to solve this by writing new member functions for 
each method (see the patch attached). Bonus: It does not change the usage of 
login() in any way (which uses the new functions internally).
Another option would be to make those functions private/put them into login() 
and provide an optional keyarg. Or auth objects, but as far as I can see only 3 
methods are relevant so it might be an overkill?

So that's the easy way to fix it, would be glad if it helps!

--
keywords: +patch
nosy: +zvyn
Added file: http://bugs.python.org/file34279/smtplib.patch

___
Python tracker 

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



[issue4508] distutils compiler not handling spaces in path to output/src files

2014-03-03 Thread Alexandru Gheorghe

Alexandru Gheorghe added the comment:

I am having the same issue on Debian 7 x86-64 (3.2.0-4-amd64)
Python 2.7.3 (default, Jan  2 2013, 13:56:14) // [GCC 4.7.2] on linux2

Not noticing this bug I've opened a duplicate, for which the interesting 
comment can be found here: http://bugs.python.org/issue20824#msg212548

Please let me know if you need any files and I will try hard to provide some in 
my free time (also unittest from what I've read in the comments posted here).

--
nosy: +drunax

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Why?  Before the PEP and its implementation, you would have had to first 
install pip before you could have had the problems you reported.  So, at least 
one annoying step was eliminated.  Now we'll work on the other bugs and issues 
with python packaging.  

The pip folks are responsive when it comes to bug fixes.  More responsive than 
the stdlib can be.  When they fix it, you'll be able to use the existing pip to 
upgrade to the fixed version, instead of having to wait until the next version 
of Python is released to get the fix.

--

___
Python tracker 

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



[issue20744] shutil should not use distutils

2014-03-03 Thread Éric Araujo

Éric Araujo added the comment:

Agreed; this looks like a relic.  zlib is optional, but zipfile is always in 
the standard library.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Mark Lawrence

Mark Lawrence added the comment:

Just awesome, from my viewpoint PEP 453 and #19347 were a complete and utter 
waste of time.

--

___
Python tracker 

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-03-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Vajrasky and Zachary.

--

___
Python tracker 

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



[issue20501] fileinput module will read whole file into memory when using fileinput.hook_encoded

2014-03-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d37f963394aa by Serhiy Storchaka in branch '2.7':
Correct and improve comments in test_fileinput (closes #20501).
http://hg.python.org/cpython/rev/d37f963394aa

New changeset 204ef3bca9c8 by Serhiy Storchaka in branch '3.3':
Correct comments and improve failure reports in test_fileinput (closes #20501).
http://hg.python.org/cpython/rev/204ef3bca9c8

New changeset c47cc6351ce7 by Serhiy Storchaka in branch 'default':
Correct comments and improve failure reports in test_fileinput (closes #20501).
http://hg.python.org/cpython/rev/c47cc6351ce7

--

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

I think I've observed other occasions when PIP claimed a successful install but 
the install had actually failed.  PIP is still an independent project, so this 
should be reported on the PIP tracker at https://github.com/pypa/pip/issues.

As for running 2to3 automatically, that is an issue with the pyttsx package, 
and should be reported to their tracker, wherever that is.

--
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
versions: +3rd party -Python 3.4

___
Python tracker 

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



[issue20846] pip can fail on windows but gives success message

2014-03-03 Thread Mark Lawrence

New submission from Mark Lawrence:

Trying to install pyttsx you get "Successfully installed pyttsx" despite the 
syntax errors and you can't actually do an import.

c:\Users\Mark\CrossCode>c:\Python34\Scripts\pip3.4.exe install pyttsx
Downloading/unpacking pyttsx
  Downloading pyttsx-1.1.tar.gz
  Running setup.py 
(path:C:\Users\Mark\AppData\Local\Temp\pip_build_Mark\pyttsx\setup.py) egg_info 
for package pyttsx

Installing collected packages: pyttsx
  Running setup.py install for pyttsx
  File "C:\Python34\Lib\site-packages\pyttsx\driver.py", line 105
except Exception, e:
^
SyntaxError: invalid syntax

[other syntax errors snipped]

Successfully installed pyttsx
Cleaning up...

c:\Users\Mark\CrossCode>py -3.4
Python 3.4.0rc2 (v3.4.0rc2:a300712ed38c, Feb 23 2014, 10:49:04) [MSC v.1600 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyttsx
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python34\lib\site-packages\pyttsx\__init__.py", line 18, in 
from engine import Engine

Running 2to3 sorts this out.  Can this be done automatically by pip?  If not, 
can we please have this documented?

--
messages: 212655
nosy: BreamoreBoy
priority: normal
severity: normal
status: open
title: pip can fail on windows but gives success message
versions: Python 3.4

___
Python tracker 

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



[issue20845] email.utils.formataddr encodes incorrectly

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Well, the "work around" was how you always had to do it in python2.  So this is 
just a bit you can't port to the easier Python3 interface until you can drop 
python2 support.

--

___
Python tracker 

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



[issue19614] support.temp_cwd should use support.rmtree

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Thanks.  Yes, the fix is in temp_dir.  Patch looks fine, may be a bit before I 
get around to applying it.

--

___
Python tracker 

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

The second test looks correct to me.  I don't understand what 
tset_request_line_trimming is testing (I haven't investigated), so I don't know 
if that one is correct, but it is certainly plausible.

--

___
Python tracker 

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



[issue20845] email.utils.formataddr encodes incorrectly

2014-03-03 Thread Michael JasonSmith

Michael JasonSmith added the comment:

I care enough to lodge an issue, but I lack the conviction in order to belabour 
the point in python-dev! I'll mark this issue as closed.

Hopefully the work-around in my original post will help others :)

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue20845] email.utils.formataddr encodes incorrectly

2014-03-03 Thread R. David Murray

Changes by R. David Murray :


--
components: +email
nosy: +barry
versions:  -Python 3.2

___
Python tracker 

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



[issue20845] email.utils.formataddr encodes incorrectly

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

At the time we introduced this behavior in python3, it was considered an 
enhancement and thus not suitable for backporting.  So you'd have to advocate 
for backporting it on python-dev.  My guess is it won't be approved, especially 
since there are significant other differences in the python2 vs python3 email 
packages (eg: BytesParser/BytesGenerator).

--
nosy: +r.david.murray

___
Python tracker 

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



[issue20841] asyncio.StreamReader.readline() lack lines limit optional parameter

2014-03-03 Thread Guido van Rossum

Guido van Rossum added the comment:

>
> It seems to me that the StreamReader() limit parameter is for buffer size
> while the io.BytesIO.readline() "n" parameter is for maximum number of
> lines to be retreived, I guess.
>

You sound confused. The parameter for io.BytesIO.readline() limits the
number of bytes read in that call. The StreamReader limit parameter also
limits the number of bytes read, in all readline() calls. However, the
effect is different -- if you exceed the limit in io.BytesIO.readline() you
get an unterminated line; if you exceed the limit in
StreamReader.readline(), the call raises an exception.

> And since the StreamReader().readline() does not accept parameter, it
> still cannot be used in other modules (like http.client.parse_headers()).

Since StreamReader.readline() must be used with yield from, you can't use
it in http.client.parse_headers() anyway.

--

___
Python tracker 

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



[issue20845] email.utils.formataddr encodes incorrectly

2014-03-03 Thread Michael JasonSmith

New submission from Michael JasonSmith:

The email.utils.formataddr function is used to encode a name-address 2-tuple 
for use as an email message. If the name contains a non-ASCII character it 
needs to be encoded. This happens correctly in Python 3.3.2, but incorrectly in 
Python 2.7.5. Ideally Python 2 would acquire the Python 3 behaviour, as this 
should make porting easier.

In the following Python 3.3.2 example the name is encoded because of the 
non-ASCII ☢ character:
>>> import email.utils
>>> name = 'Me ☢'
>>> addr = 'mp...@onlinegroups.net'
>>> email.utils.formataddr((name, addr))
'=?utf-8?b?TWUg4pii?= '

In Python 2.7.5 the same name is incorrectly left unaltered:
>>> import email.utils
>>> name = u'Me ☢'
>>> addr = 'mp...@onlinegroups.net'
>>> email.utils.formataddr((name, addr))
u'Me \u2622 '

However, calling the email.header.Header.encode method works around this issue 
in Python 2:
>>> import email.utils
>>> import email.header
>>> name = u'Me ☢'
>>> addr = 'mp...@onlinegroups.net'
>>> h = email.header.Header(name)
>>> email.utils.formataddr((h.encode(), addr))
'=?utf-8?b?TWUg4pii?= '

The example code immediately above also works in Python 3; it is the current 
work-around in GroupServer. However, ideally instances of Unicode objects 
passed to email.utils.formataddr will work the same in both Python 2 and Python 
3.

--
components: Library (Lib)
messages: 212648
nosy: Michael.JasonSmith
priority: normal
severity: normal
status: open
title: email.utils.formataddr encodes incorrectly
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The behavior of str.strip is not what I would expect from reading 
'''str.strip([chars])
Return a copy of the string with the leading and trailing characters 
removed.'''
but I guess it is consistent with a general rule that when mixing bytes and 
unicode (which was not always), the bytes are latin-1 decoded to unicode. 
However, the 'not always' part (str.strip yes, str.ljust no) made Python a bit 
inconsistent with itself.

Adding the unicode_literals import made Python more inconsistent with itself. 
"You can change byte literals to unicode literals, but if you do and you use 
one of the stdlib text apis that are bytes only, your program breaks."  This 
patch moves the inconsistency around a bit but does not remove it.  People who 
stick with 2.7 will have to live with inconsistency one way or another.

The turtle color issue is quite different in that it involve text names ('red') 
or encodings('#aabbcc') for color tuples that are quoted as text in order to be 
passed on to tkinter and tk (which wants unicode anyway).

--

___
Python tracker 

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



[issue20744] shutil should not use distutils

2014-03-03 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue18139] email module should have a way to prepend and insert headers

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

(Aside: I have no idea why I set the stage to needs patch.  The API discussion 
is needed first!)

--
stage: needs patch -> 

___
Python tracker 

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



[issue18139] email module should have a way to prepend and insert headers

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

The patch is a reasonable effort, thanks.  However, before we can really 
evaluate any code, we need to agree on an API.

The Message object presents a hybrid dictionary/sequence API over the headers.  
In the Sequence API, we insert something into the list using 'insert(pos, 
object)`.  dict has no 'insert' method, so we don't need to worry about an API 
clash there.

So we could define the method insert_header to have the following signature:

  insert_header(pos, name, value)

add_header is still required, because we can't use insert_header to append.  
(It would then be nice if it were named append_header...but ignore that for 
now).

However, there is almost no other context in which one interacts with the 
header list via a header's index in the list of headers.  Message does not 
support the 'index' method.

An alternate API, then, might be something like:

insert_header_after(existing_name, new_name, value)

This would be analogous to replace_header.

The trouble with this, and the trouble with defining a header_index, is that 
multiple headers can have the same name.  Message's answer to this currently is 
to have both a 'get' method and a 'get_all' method.  The former returns the 
first match, the latter all of them.

The reason this matters, by the way, is that one of the motivations for 
insert_header in my mind is the ability to create a sensible flow of headers: 
have the routing and forwarding headers (received, resent-xxx, etc) headers be 
before the From/to/date, etc headers.  But to do that, you need to be able to 
insert them *after* the other headers with the same name.

You could make 'insert after last instance of name' the default behavior of 
insert_header_after, but then we sill don't have a way to insert a header in an 
arbitrary location.

Another possibility is 'insert_header' combined with both 'header_index' and 
'header_index_all'.

I *think* I'm leaning toward the latter (with my biggest hesitation being that 
insert_header is pretty much the only place you can use the index information 
returned by the index methods), but this kind of API design issue is something 
we should run by the email-sig mailing list.  Feel free to post something there 
yourself, otherwise I will do so after I finish the 'whatsnew' work.

--

___
Python tracker 

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



[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

However, do note that the semantics will end up different from other uses of 
unicode. e.g.:

>>> "aa".strip(u"b")
u'aa'

In str.strip(), passing an unicode parameter returns an unicode string. In 
str.ljust(), passing an unicode parameter will return a byte string.

--

___
Python tracker 

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



[issue20015] Allow 1-character ASCII unicode where 1-character str is required

2014-03-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This sounds reasonable to me, but the patch lacks tests.

--

___
Python tracker 

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



[issue18139] email module should have a way to prepend and insert headers

2014-03-03 Thread Surya K

Surya K added the comment:

I've done the following changes:

1. create insert_header(): Which places header at the beginning.
For that I created set() method which actually takes an argument `pos` default 
to 0.

2. __setitem__() uses set() (new method) method while fixing `pos` to end.
3. _parse_values(), new method created to not duplicate the code in 
insert_header() and add_header() since both of them merely do same job.

Please let me know your opinions on it.

--
keywords: +patch
nosy: +Surya.K
Added file: http://bugs.python.org/file34278/suryak.patch

___
Python tracker 

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



[issue20098] email policy needs a mangle_from setting

2014-03-03 Thread Milan Oberkirch

Milan Oberkirch added the comment:

Updates patch to include necessary changes to test_policy.py.

--
Added file: http://bugs.python.org/file34277/mangle_from.patch

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Brett Cannon

Brett Cannon added the comment:

LGTM, but I won't be able to commit it until Friday so hopefully Eric or you 
can do it sooner.

--

___
Python tracker 

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



[issue20098] email policy needs a mangle_from setting

2014-03-03 Thread Milan Oberkirch

Changes by Milan Oberkirch :


Removed file: http://bugs.python.org/file34275/mangle_from.patch

___
Python tracker 

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



[issue20811] str.format for fixed width float can return a string longer than the maximum specified

2014-03-03 Thread aubmoon

aubmoon added the comment:

We will add extending the float class as another possible work around or
part of a work around. Our developers now have a few options to
choose from. I am not sure which approach will be preferred. thanks for all
of the quick replies. this was just an odd case that was encountered, so I
wanted the community to be aware of it. if and when to address it is above
my level.

On Saturday, March 1, 2014, Eric V. Smith  wrote:

>
> Eric V. Smith added the comment:
>
> I still think this is a special case that we won't "fix". And even if we
> did, you'd have to wait until 3.5.
>
> But instead of your solution, it might be easier to wrap your floats in a
> class that implements your version of format, based on float's format with
> some post-processing:
>
> class MyFloat(float):
> def __format__(self, fmt):
> s = float.__format__(self, fmt)
> if s[1] == '0':
> return s[0] + s[2:]
> return s
>
> print(format(MyFloat(0.12345678), '+8.8'))
> print(format(MyFloat(1.12345678), '+8.8'))
>
> gives:
> +.12345678
> +1.1234568
>
> I've grossly simplified __format__, of course. And I'm using built-in
> format() instead of ''.format() (because it's less typing), but they use
> the same mechanisms. So:
>
> print('{}:"{:+10.8}"'.format('answer', MyFloat(0.12345678)))
>
> gives:
> answer:"+.12345678"
>
> --
>
> ___
> Python tracker >
> 
> ___
>

--

___
Python tracker 

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



[issue20844] coding bug remains in 3.3.5rc2

2014-03-03 Thread STINNER Victor

STINNER Victor added the comment:

It's a duplicate of the issue #20731.

--
nosy: +haypo

___
Python tracker 

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



[issue20844] coding bug remains in 3.3.5rc2

2014-03-03 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue20844] coding bug remains in 3.3.5rc2

2014-03-03 Thread Musashi Tamura

New submission from Musashi Tamura:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\bug>python
Python 3.3.5rc2 (v3.3.5rc2:ca5635efe090, Mar  2 2014, 18:18:29) [MSC v.1600 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\bug>python test2.py
  File "test2.py", line 1
SyntaxError: encoding problem: iso-8859-1

--
components: Windows
files: test2.py
messages: 212637
nosy: miwa
priority: normal
severity: normal
status: open
title: coding bug remains in 3.3.5rc2
versions: Python 3.3
Added file: http://bugs.python.org/file34276/test2.py

___
Python tracker 

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



[issue20098] email policy needs a mangle_from setting

2014-03-03 Thread Milan Oberkirch

Milan Oberkirch added the comment:

(@r.david.murray) I just implemented what you suggested:
- Policy has a mangle_from_ property, overridden in EMailPolicy
- Generator and DecodedGenerator default to policy.mangle_from_ or True if 
policy is None.

Would be glad if it helps :)

--
nosy: +zvyn
Added file: http://bugs.python.org/file34275/mangle_from.patch

___
Python tracker 

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



[issue20814] tracemalloc example - Pretty Top

2014-03-03 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage:  -> committed/rejected

___
Python tracker 

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



[issue20815] ipaddress unit tests PEP8

2014-03-03 Thread Michel Albert

Michel Albert added the comment:

I strongly agree with Raymond's points! They are all valid.

I should note, that I submitted this patch to - as mentioned by Nick - 
familiarise myself with the patch submission process. I decided to make 
harmless changes which won't risk braking anything.

--

___
Python tracker 

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



[issue20843] 3.4 cherry-pick: a9058b772807 fix tracemalloc doc

2014-03-03 Thread STINNER Victor

New submission from STINNER Victor:

Please pick a9058b772807 into Python 3.4 final: it fixes a typo in tracemalloc 
documentation (in the "Pretty Top" example).

Related issue: #20814.

--
assignee: larry
messages: 212634
nosy: haypo, larry
priority: release blocker
severity: normal
status: open
title: 3.4 cherry-pick: a9058b772807 fix tracemalloc doc
versions: Python 3.4

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-03-03 Thread Michael Foord

Michael Foord added the comment:

I'm not sure to what extent mock documentation should explain Python semantics. 
The docs *do* make clear that sentinel is useful for where you want to test 
(compare) objects by *identity*. Problems with copying and pickling them come 
from the fact that those operations don't preserve *identity*, which is a basic 
facet of *Python* and not down to mock/sentinel.

"sentinel provides a convenient way of creating and testing the identity of 
objects like this."

--

___
Python tracker 

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



[issue20814] tracemalloc example - Pretty Top

2014-03-03 Thread Georg Brandl

Changes by Georg Brandl :


--
status: open -> closed

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Brett, Eric - if this looks right to you, feel free to commit and create the 
issue for Larry to incorporate it into 3.4.0.

--

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Attached patch adds some appropriate unit tests, switches pkgutil.find_loader 
over to using importlib.util.find_spec and updates the docs appropriately.

I also filed issue 20842 relating to the fact that the pkgutil docs still refer 
to PEP 302 when they should be referring to the glossary terms instead.

--
keywords: +patch
Added file: 
http://bugs.python.org/file34274/issue20839_migrate_pkgutil_to_find_spec.diff

___
Python tracker 

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



[issue20842] pkgutil docs should reference glossary terms not PEP 302

2014-03-03 Thread Nick Coghlan

New submission from Nick Coghlan:

The pkgutil docs still point at PEP 302 when mentioning loaders, importers, 
etc. They should reference the glossary terms (:term:`loader`, etc) instead.

--
assignee: docs@python
components: Documentation
messages: 212630
nosy: docs@python, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: pkgutil docs should reference glossary terms not PEP 302
type: enhancement
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, I think I see what may have happened - when we finally switched all the 
stdlib importers over to PEP 302 (and consistently set __loader__), the 
pkgutil.get_loader fallback to pkgutil.find_loader stopped being exercised by 
the test suite (it's currently missing lower level unit tests), and so we 
missed that it was still calling a deprecated API. (And we don't currently have 
any CI set up to warn us when coverage of a module goes backwards)

I'll add some new tests to get coverage and change it to use 
importlib.util.find_spec instead.

--

___
Python tracker 

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



[issue20814] tracemalloc example - Pretty Top

2014-03-03 Thread STINNER Victor

STINNER Victor added the comment:

Thank you Jeong-Min for your report, it's now fixed.

--
resolution: fixed -> 
stage: committed/rejected -> 
status: closed -> open

___
Python tracker 

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



[issue20814] tracemalloc example - Pretty Top

2014-03-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a9058b772807 by Victor Stinner in branch 'default':
Close #20814: doc: Fix "Pretty top" example of tracemalloc
http://hg.python.org/cpython/rev/a9058b772807

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

___
Python tracker 

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



[issue20841] asyncio.StreamReader.readline() lack lines limit optional parameter

2014-03-03 Thread Alexandre JABORSKA

Alexandre JABORSKA added the comment:

Hum... 

It seems to me that the StreamReader() limit parameter is for buffer size while 
the io.BytesIO.readline() "n" parameter is for maximum number of lines to be 
retreived, I guess. 

And since the StreamReader().readline() does not accept parameter, it still 
cannot be used in other modules (like http.client.parse_headers()).

--

___
Python tracker 

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



[issue20841] asyncio.StreamReader.readline() lack lines limit optional parameter

2014-03-03 Thread STINNER Victor

STINNER Victor added the comment:

The readline() limit can be set in the StreamReader constructor:
http://docs.python.org/dev/library/asyncio-stream.html#streamreader

Oh, it looks like it is not documented :-(

--
nosy: +gvanrossum, haypo, yselivanov

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +larry
priority: normal -> release blocker

___
Python tracker 

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



[issue20841] asyncio.StreamReader.readline() lack lines limit optional parameter

2014-03-03 Thread Alexandre JABORSKA

New submission from Alexandre JABORSKA:

This prevent using StreamReader as a normal file object in some circumstances 
(like http header parsing)

--
components: Library (Lib)
messages: 212624
nosy: ajaborsk
priority: normal
severity: normal
status: open
title: asyncio.StreamReader.readline() lack lines limit optional parameter
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue20838] Documents disagree about release state of Python 3.3.5

2014-03-03 Thread Georg Brandl

Georg Brandl added the comment:

It's coming.

--
status: open -> closed

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever, brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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



[issue20840] AttributeError: 'module' object has no attribute 'ArgumentParser'

2014-03-03 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

I guess that there is argparse module in current directory, which overrides 
argparse module from standard library.
Use e.g. print(argparse) or print(argparse.__file__) to find it.
A correct location would be something like /usr/lib64/python2.7/argparse.pyc.

--
nosy: +Arfrever

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2014-03-03 Thread Vlastimil Zíma

Vlastimil Zíma added the comment:

David, first part of your comment should be added to docs. Purpose of sentinels 
isn't much intuitive and in my opinion documentation doesn't quite describe it.

An exception in case of pickle or copy would be much easier to understand apart 
from unexpected inequality. In my experience negative test in general are 
uncommon, so I expect usage of sentinels to ensure different objects to be rare.

--

___
Python tracker 

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



[issue20840] AttributeError: 'module' object has no attribute 'ArgumentParser'

2014-03-03 Thread bsduni

New submission from bsduni:

Hi!

I have installed Python 2.7.6 fully (all the modules selected). I attempted run 
some Python codes that were developed by a past staff, and am stuck with an 
issue with argparse. 

For ease of explanation I am using the example given in this website at 
http://docs.python.org/2/howto/argparse.html.

When I create a simple program prog.py with codes below:

import argparse
parser = argparse.ArgumentParser()
parser.parse_args()

and execute with $ python prog.py, the following is the error message I receive:
Traceback (most recent call last):
  File "prog.py", line 2, in 
parser = argparse.ArgumentParser()
AttributeError: 'module' object has no attribute 'ArgumentParser'

I also tried to add argparse additionally using pip install and the problem 
remains the same.

Would be grateful if someone could help to overcome this AttributeError.

--
components: Extension Modules
messages: 212620
nosy: bsduni
priority: normal
severity: normal
status: open
title: AttributeError: 'module' object has no attribute 'ArgumentParser'
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue20283] Wrong keyword parameter name in regex pattern methods

2014-03-03 Thread Martin v . Löwis

Martin v. Löwis added the comment:

The patch sre_deprecate_pattern_keyword-3.4.patch looks good to me. I *think* 
that Larry has pre-approved it for 3.4.

If it is applied, and if people still think that 2.7 and 3.3 need to be 
changed, the release-critical status should be removed from the issue.

--
nosy: +loewis

___
Python tracker 

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



[issue20839] pkgutil.get_loader throws deprecation warning due to internal deprecation

2014-03-03 Thread Armin Ronacher

Armin Ronacher added the comment:

This also happens with the latest hg version.  I could not make an isolated 
test case unfortunately but it happens on the flask testsuite if run on 3.4.

--

___
Python tracker 

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



[issue19861] Update What's New for Python 3.4

2014-03-03 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I don't think this issue is actually release-critical. The current status of 
the document is fine for the release, any additions that people find can be 
added to bugfix releases (and online, of course).

The question also is how long this issue itself stays open. Serhiy, can you 
please update your original list to report which of the changes you had listed 
are still not documented? I suggest to close the issue when all changes from 
msg205005 have been dealt with.

--
nosy: +loewis
priority: release blocker -> normal

___
Python tracker 

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



[issue15809] IDLE console uses incorrect encoding.

2014-03-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Terry, what do you think? This bug is critical for non-ASCII-only users of IDLE.

--

___
Python tracker 

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