[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-01-12 Thread Nick Coghlan

Nick Coghlan added the comment:

The feature detection approach is especially important for anything covered by 
the security backports in PEP 466 and 476, but can also apply for things like 
installing the importlib2 meta_path hooks into Python 2.7.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue26087] PEP 0373 should be updated

2016-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1046a40e086f by Benjamin Peterson in branch 'default':
update 2.7 schedule (closes #26087)
https://hg.python.org/peps/rev/1046a40e086f

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue24780] unittest assertEqual difference output foiled by newlines

2016-01-12 Thread anchal agarwal

anchal agarwal added the comment:

There is another case where the error message displayed by self.assertEqual() 
is weird. 

==
FAIL: test_newline_1 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 9, in test_newline_1
self.assertEqual("\n abc", "\n abd")
AssertionError: '\n abc' != '\n abd'
  
-  abc?^
+  abd?^


==
FAIL: test_newline_2 (__main__.AssertEqualTest)
--
Traceback (most recent call last):
  File "test.py", line 12, in test_newline_2
self.assertEqual("\nabc", "\nabd")
AssertionError: '\nabc' != '\nabd'
  
- abc+ abd


--

There is a difference in between "\nabc" and "\n abc" and hence the difference 
between output

--
nosy: +pynewbie

___
Python tracker 

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



[issue25752] asyncio.readline - add customizable line separator

2016-01-12 Thread Martin Panter

Martin Panter added the comment:

The same Git Hub pull request is mentioned in Issue 26050, so I am guessing 
this is now a duplicate.

--
nosy: +martin.panter
resolution: wont fix -> duplicate
status: open -> closed
superseder:  -> Add new StreamReader.readuntil() method

___
Python tracker 

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



[issue15071] TLS get keys and randoms

2016-01-12 Thread Daniël van Eeden

Changes by Daniël van Eeden :


--
nosy: +dveeden

___
Python tracker 

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



[issue26088] re

2016-01-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue19316] devguide: compiler - wording

2016-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 43d842419188 by Ezio Melotti in branch 'default':
#19316: fix wording in the compiler.rst page.
https://hg.python.org/devguide/rev/43d842419188

--
nosy: +python-dev

___
Python tracker 

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



[issue19006] UnitTest docs should have a single list of assertions

2016-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ddb8fa84a119 by Ezio Melotti in branch '2.7':
#19006: fix wording in unittest docs.
https://hg.python.org/cpython/rev/ddb8fa84a119

New changeset 84f34e8685de by Ezio Melotti in branch '3.5':
#19006: fix wording in unittest docs.
https://hg.python.org/cpython/rev/84f34e8685de

New changeset 86c8d65d188f by Ezio Melotti in branch 'default':
#19006: merge with 3.5.
https://hg.python.org/cpython/rev/86c8d65d188f

--
nosy: +python-dev

___
Python tracker 

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



[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the report and the patch!

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue25574] 2.7 incorrectly documents objects hash as equal to id

2016-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 499ee454eecc by Ezio Melotti in branch '2.7':
#25574: backport glossary doc fix about hash and id of user-defined classes.
https://hg.python.org/cpython/rev/499ee454eecc

--
nosy: +python-dev

___
Python tracker 

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



[issue26068] re.compile() repr end quote truncated

2016-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

More smart truncating with closing quote and dots was the idea that I want to 
propose since introducing %R, but I didn't have time to formulate this. Opened 
issue26090 for this.

--

___
Python tracker 

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



[issue26089] Duplicated keyword in distutils metadata

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

This seems to be because the alternative spelling "licence" was also included 
in the list, and got changed in #693470/178d19cff163.
Because of that change, the method get_licence() is not supported anymore, but 
at this point removing the duplicate "license" should be safe.
Attached a patch.
(Note that there seem to be no tests for the "licence" alias in 
Lib/distutils/tests)

--
keywords: +patch
nosy: +ezio.melotti
stage:  -> commit review
type: resource usage -> enhancement
versions:  -Python 3.5
Added file: http://bugs.python.org/file41591/issue26089.diff

___
Python tracker 

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



[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> needs patch

___
Python tracker 

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



[issue26088] re

2016-01-12 Thread Hana Larsen

New submission from Hana Larsen:

-- 
Hans Larsen Galgebakken Sønder 4-11A 2620 Albertslund Danmark/Danio

--
messages: 258073
nosy: Johano
priority: normal
severity: normal
status: open
title: re

___
Python tracker 

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



[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Martin Panter

Martin Panter added the comment:

Here is the corresponding patch for the test suite. This version should fix all 
the SSL tests as long as the server is updated.

--
Added file: http://bugs.python.org/file41590/use-pythontest.v2.patch

___
Python tracker 

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



[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks Dimistri for the report, Upendra for the patch, Terry for the 
review, and Elena for the rewrapping!
I also rephrased the last sentence a bit to make it more readable.

--
assignee: docs@python -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue26089] Duplicated keyword in distutils metadata

2016-01-12 Thread Augustin Laville

New submission from Augustin Laville:

The line https://hg.python.org/cpython/file/tip/Lib/distutils/dist.py#l1016 
contains the word "licence" twice.

Check only on Python, 3.5 and 3.6, may be in others versions.

--
components: Distutils
messages: 258091
nosy: Augustin Laville, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Duplicated keyword in distutils metadata
type: resource usage
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue19316] devguide: compiler - wording

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks everyone for the patches and the reviews!

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

___
Python tracker 

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



[issue24712] Docs page's sidebar vibrates on mouse wheel scroll on Chrome.

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

CSS: Doc/tools/pydoctheme/static/pydoctheme.css
JS: Doc/tools/static/sidebar.js

The repo is https://hg.python.org/cpython/, but there should be a github mirror 
too.  See also the devguide for more info.

--

___
Python tracker 

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



[issue26087] PEP 0373 should be updated

2016-01-12 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: docs@python -> benjamin.peterson
nosy: +benjamin.peterson

___
Python tracker 

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



[issue24918] Docs layout bug

2016-01-12 Thread Georg Brandl

Georg Brandl added the comment:

If it works...

--

___
Python tracker 

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



[issue23942] Explain naming of the patch files in the bug tracker

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

I think this is not worth fixing, for two reasons:
1) we are moving away from Rietveld;
2) even if we document it, most people won't go looking for naming conventions 
and just use reasonable names (and most of the times they will just work);
I'm therefore going to close this -- thanks anyway for the report.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The C code often uses %. in PyUnicode_FromFormat(). %.200s 
protects from unlimited output when broken pointer points on random 
non-null-terminated data. %.200R is used to limit the size of human-readable 
messages.

In all these case formatted string can look well-formed with short data, but 
mis-formed (not closed quote, truncated backslash escaping or � decoded from 
truncated UTF-8 sequence) with long data.

I propose to make truncating in PyUnicode_FromFormat() more smart.

1. Truncated %R should keep at least one end character (the quote or ">").
2. Truncated output should include "..." or "[...]" as truncating sign.
3. \c, \OOO, \xXX, \u, and \U should not be truncated. It is better 
to omit these sequences at all (cut the string before them) that output them 
truncated.
4. Doesn't truncate UTF-8 sequence inside a character for %s.

--
components: Interpreter Core
messages: 258092
nosy: gvanrossum, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: More correct string truncating in PyUnicode_FromFormat()
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread STINNER Victor

STINNER Victor added the comment:

See my old issue #10833 which proposed to *remove* the arbitrary limit
on strings. It was rejected.

--

___
Python tracker 

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



[issue25995] os.walk() consumes a lot of file descriptors

2016-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> But using FDs proportional to the tree depth seems reasonable to me.

This was the main reason for rejecting issue15200. May be we can allow this for 
globbing, but only explicitly enabled with special parameter or separate 
functions. The benefit for globbing is starting to yield results without 
internal caching. The benefit for os.walk() is smaller, because in any case it 
yields files and directories not one-by-one, but collected into lists.

> Is there a potential hybrid strategy, where for small directories we close
> the FD but for large directories we keep it open?

May be with more complicated code. I think this needs explicit close() method, 
so it can go only in 3.6. For now I think we have to commit one of my patches 
(the difference only stylistic).

--

___
Python tracker 

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



[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Martin Panter

Martin Panter added the comment:

This is a patch against the pythontestdotnet repository to change the 
certificate to have the CA flag set. It should be applied in conjunction with 
an (upcoming) update to the test suite, otherwise test_httplib will fail with 
certificate verification errors.

If I push this patch to the pythontest repository, will the server immediately 
update itself, or are other steps required?

--
Added file: http://bugs.python.org/file41589/pythontest-set-ca.patch

___
Python tracker 

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



[issue19006] UnitTest docs should have a single list of assertions

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

Fixed, thanks for the review!

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21047] html.parser.HTMLParser: convert_charrefs should become True by default

2016-01-12 Thread Ezio Melotti

Ezio Melotti added the comment:

DeprecationWarnings are silenced by default.  You can enable them by using the 
-W Python flag.
They are also enabled while running tests with unittest, so you should have 
seen them there.

--

___
Python tracker 

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



[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-01-12 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Soren, for me, the page you link to is impossible to read as it blinks every 
second or so, something I have never seen before.  Perhaps it is trying to 
forward to the actual reference. As near as I can tell, it just lists about 3 
other documents and is not a reference in itself, and for me has no sections.  
Can you provide a better link, perhaps one that is more direct?

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue26086] Bug in standardmodule os

2016-01-12 Thread Hana Larsen

Hana Larsen added the comment:

I thank you much for thisse answer!
I Python is in "C:\Python35\" in the root of C-Drive (OS)
=-O
Den 11-01-2016 kl. 23:57 skrev Eryk Sun:
> Eryk Sun added the comment:
>
> The "yield from" syntax was added in Python 3.3, so somehow you're using the 
> 3.5 standard library with either an old 3.x or 2.x version. The older version 
> shouldn't use 3.5's standard library, unless you have either PYTHONHOME or 
> PYTHONPATH defined. Generally neither of these variables should be defined, 
> especially not PYTHONHOME. In the command prompt run "set PYTHON" to list all 
> environment variables that start with "PYTHON".
>
> You also appear to be running with the 3.5 site-packages as the working 
> directory. Even without the other problems, I recommend against this since 
> the current directory has precedence in sys.path. You're moving site-packages 
> to the head of the list, in front of the standard library. For example:
>
>  C:\Program Files\Python35\Lib\site-packages>type subprocess.py
>  print("This isn't the subprocess you're looking for.")
>
>  C:\Program Files\Python35\Lib\site-packages>py -3 -c "import subprocess"
>  This isn't the subprocess you're looking for.
>
> Save your scripts in the top-level Scripts directory or a directory in your 
> user profile. Generally leave everything under Lib alone, to be managed by 
> pip and other installers.
>
> --
> nosy: +eryksun
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2016-01-12 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

The patch looks good. I only have one question:

Why are you removing this part ? ...

@@ -1684,13 +1688,8 @@
 try:
 ret = func(*args)
 except ssl.SSLError as e:
-# Note that we get a spurious -1/SSL_ERROR_SYSCALL for
-# non-blocking IO. The SSL_shutdown manpage hints at this.
-# It *should* be safe to just ignore SYS_ERROR_SYSCALL because
-# with a Memory BIO there's no syscalls (for IO at least).
 if e.errno not in (ssl.SSL_ERROR_WANT_READ,
-   ssl.SSL_ERROR_WANT_WRITE,
-   ssl.SSL_ERROR_SYSCALL):
+   ssl.SSL_ERROR_WANT_WRITE):
 raise
 errno = e.errno
 # Get any data from the outgoing BIO irrespective of any error, and

--

___
Python tracker 

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



[issue26001] Tutorial: write() does not expect string in binary mode

2016-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a2692911a43 by Ezio Melotti in branch '3.5':
#26001: mention in the tutorial that files in binary mode expect bytes, not str.
https://hg.python.org/cpython/rev/5a2692911a43

New changeset 4b434a4770a9 by Ezio Melotti in branch 'default':
#26001: merge with 3.5.
https://hg.python.org/cpython/rev/4b434a4770a9

--
nosy: +python-dev

___
Python tracker 

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



[issue26092] doctest should allow custom sys.displayhook

2016-01-12 Thread Sergey B Kirpichev

New submission from Sergey B Kirpichev:

The purpose of doctest's - verify interactive examples.  But if
your users will use custom displayhook all the time (consider, as
examples CAS like SymPy or https://github.com/skirpichev/omg/) - why
you must show them examples with the builtin's displayhook?

After https://bugs.python.org/issue8048, sys.displayhook can't be
customized for doctest.  I think, that decision was wrong and we
should have a better solution.

PS: In fact, right now this issue can be workarrounded if you instead
override sys.__displayhook__ before doctest call.  But I believe
this "solution" has own problems.

--
components: Library (Lib)
messages: 258115
nosy: Sergey.Kirpichev
priority: normal
severity: normal
status: open
title: doctest should allow custom sys.displayhook
type: behavior

___
Python tracker 

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



[issue25995] os.walk() consumes a lot of file descriptors

2016-01-12 Thread Guido van Rossum

Guido van Rossum added the comment:

I like them both, if I had to choose I'd pick patch 2.

But yes, we need to add a close() method to the scandir iterator object.

In the meantime, I am still worried about what would happen if somehow the loop 
got interrupted and the frame got kept alive and the iterator wasn't closed by 
its dealloc until much later.  This kind of thing was common in asyncio and we 
had to resort to similar tricks to break some cycles. Maybe you can add a 
try/finally that *deletes* scandir_it to force it to close itself (at least in 
CPython)? That can go into 3.5.

--

___
Python tracker 

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



[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Guido van Rossum

Guido van Rossum added the comment:

Well it seems a little odd to spend effort on a corner case of the C-level
error messages if we can't even replicate it in pure Python.

--

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-12 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș added the comment:

As I understood it the issue is not with the order but with the iteration being 
"unstable" (eg: same key appears multiple times). Yes, the dict is mutated 
while it's being iterated on, but no keys are added or removed, only values are 
changed.

--

___
Python tracker 

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



[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Joseph Pyott

Changes by Joseph Pyott :


--
components: Extension Modules
files: decimal pow error.py
nosy: Pyottamus
priority: normal
severity: normal
status: open
title: decimal.Decimal(0)**0 throws decimal.InvalidOperation
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file41593/decimal pow error.py

___
Python tracker 

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



[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Joseph Pyott

Changes by Joseph Pyott :


--
components: +Library (Lib) -Extension Modules

___
Python tracker 

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



[issue26060] Class __dict__ iteration order changing due to type instance key-sharing

2016-01-12 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Indeed. Here is another version of the script, it crashes when I set 
PYTHONHASHSEED=1 and passes with PYTHONHASHSEED=3::

class Meta(type):
def __new__(meta, clsname, bases, methods):
cls = super(Meta, meta).__new__(meta, clsname, bases, methods)
count = 0
for name in vars(cls):
if name.startswith('f_'):
print('decorate', name)
count += 1
setattr(cls, name, getattr(cls, name))
assert count == 8
return cls

class Spam2(metaclass=Meta):
def f_1(self): pass
def f_2(self): pass
def f_3(self): pass
def f_4(self): pass
def f_5(self): pass
def f_6(self): pass
def f_7(self): pass
def f_8(self): pass

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue22642] trace module: convert to argparse

2016-01-12 Thread SilentGhost

SilentGhost added the comment:

Here is the updated version of the patch that addresses Senthil's comments. 
Besides re-flowing code, I've also added enforcement of --summary switch and 
re-factored and expanded the test_failures. It probably would be good if 
someone could test this on a real-life code.

--
Added file: http://bugs.python.org/file41594/issue22642_2.diff

___
Python tracker 

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



[issue25913] base64.a85decode adobe flag incorrectly utilizes <~ as a marker causing error

2016-01-12 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +curioswati

___
Python tracker 

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



[issue26093] __qualname__ different when calling generator object w/ functions.partial

2016-01-12 Thread Dino Viehland

New submission from Dino Viehland:

import functools
def f():
def g():
yield 1
return g

functools.partial(f())().__qualname__ != f()().__qualname__

The qualified name gets passed in via the interpreter loop with 
_PyEval_EvalCodeWithName calling PyGen_NewWithQualName.  If a generator object 
gets called from C then the qualified name gets lost.

It seems like _PyEval_EvalCodeWithName shouldn't exist and the generator code 
object should be able to get back to its qualified name so subtle differences 
like this don't happen.

--
components: Interpreter Core
messages: 258119
nosy: dino.viehland
priority: normal
severity: normal
status: open
title: __qualname__ different when calling generator object w/ functions.partial
type: behavior
versions: Python 3.5

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2016-01-12 Thread Simon Conseil

Simon Conseil added the comment:

I have looked at the webbrowser tests and it seems not so easy: currently the 
MacOS browser classes are not tested, and they don't the GenericBrowser base 
class. Instead they use custom code with os.popen, so it would require some 
work either replace os.popen with subprocess.Popen, or to mock the os.popen 
calls. I'm not sure I will the time to dig into this.

--

___
Python tracker 

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



[issue26090] More correct string truncating in PyUnicode_FromFormat()

2016-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think we can make this feature available with classic formatting '%.100r', 
but with new formatting '{0:.100!r}' (especially with f-strings) this can be 
not so easy.

--

___
Python tracker 

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



[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Stefan Krah

New submission from Stefan Krah:

http://speleotrove.com/decimal/daops.html#refpower

--
nosy: +skrah
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-12 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Related to #1288833, when FreeBSD 5.3's getaddrinfo was declared thread-safe.

--

___
Python tracker 

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



[issue24955] webbrowser broken on Mac OS X when using the BROWSER variable

2016-01-12 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Simon, sure. It is just for someone, either commiters or other interested folks 
to add the tests on top of your patch. Agree with you that more change is 
required to add the required tests.

--

___
Python tracker 

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



[issue26050] Add new StreamReader.readuntil() method

2016-01-12 Thread Марк Коренберг

Changes by Марк Коренберг :


--
keywords: +patch
Added file: 
http://bugs.python.org/file41595/asyncio-stream-doc-preliminary.patch

___
Python tracker 

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



[issue26050] Add new StreamReader.readuntil() method

2016-01-12 Thread Марк Коренберг

Марк Коренберг added the comment:

Attached patch, but did not compile documentation until text is validated.

These descriptions are just copies of docstrings of corresponding functions.

--

___
Python tracker 

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



[issue26094] ConfigParser.get() doc to be updated according to the configparser.py header doc

2016-01-12 Thread khyox

New submission from khyox:

For the sake of clarity, in 
https://docs.python.org/3.5/library/configparser.html#configparser.ConfigParser 
the ConfigParser.get() method doc could be properly updated with merging the 
information written in the header doc of the source file, as found in 
https://hg.python.org/cpython/file/3.5/Lib/configparser.py

Concretely, this sentence there, "Return a string value for the named option." 
could be considered quite relevant to be added to the doc of the method, as 
some packages are (incorrectly) expecting boolean values returned by the 
ConfigParser.get() method. The reality is that a "True" in the configuration 
file is returning the string "True" and not the boolean constant True.

To sum up, the suggested update would be:

def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
"""Returns a string value for the named option for a given section.

If `vars' is provided, it must be a dictionary. The option is looked up
in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
If the key is not found and `fallback' is provided, it is used as
a fallback value. `None' can be provided as a `fallback' value.

If interpolation is enabled and the optional argument `raw' is False,
all interpolations are expanded in the return values.

Arguments `raw', `vars', and `fallback' are keyword only.

The section DEFAULT is special.
"""
(...)

--
assignee: docs@python
components: Documentation
messages: 258124
nosy: docs@python, khyox
priority: normal
severity: normal
status: open
title: ConfigParser.get() doc to be updated according to the configparser.py 
header doc
type: enhancement
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-12 Thread A. Jesse Jiryu Davis

Changes by A. Jesse Jiryu Davis :


Added file: http://bugs.python.org/file41597/d_mach

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-12 Thread A. Jesse Jiryu Davis

Changes by A. Jesse Jiryu Davis :


Added file: http://bugs.python.org/file41596/h_resolv.c

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-01-12 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

NetBSD has a concurrency test for getaddrinfo, so I tried it on Mac to see if 
getaddrinfo is thread-safe here, too. It appears that it is thread-safe.

I copied NetBSD's getaddrinfo concurrency test "h_resolv.c" and the test's data 
file "d_mach" from src/tests/lib/libpthread in the NetBSD 7 source:

http://cvsweb.netbsd.org/bsdweb.cgi/src/tests/lib/libpthread/

I've also attached these files to this ticket.*

The test program h_resolv.c compiles fine on Mac OS X 10.10 with clang 7, and 
the test passes using the same parameters that the NetBSD test uses, resolving 
five host names on five threads:

./h_resolv -d -n 5 -h 5 d_mach

There's even evidence that getaddrinfo is actually concurrent on my Mac: 
resolving 100 hostnames on 1 thread takes about 6 seconds, but using 100 
threads take only 3 seconds. To test concurrency I ran this:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
time h_resolv -d -h 100 -n 1 d_mach

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
time h_resolv -d -h 1 -n 100 d_mach

Those sudo commands flush the Mac's DNS cache between runs.

* I removed one unresolvable domain, "cnftp.bjpu.edu.cn", from the test file 
d_mach. That domain took 15 seconds to time out and made the rest of the timing 
irrelevant.

--

___
Python tracker 

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



[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-01-12 Thread Brett Cannon

Brett Cannon added the comment:

And suggesting feature detection is even better than version detection.

--

___
Python tracker 

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



[issue26095] Update porting HOWTO to special-case Python 2 code, not Python 3

2016-01-12 Thread Brett Cannon

New submission from Brett Cannon:

As pointed out by 
http://astrofrog.github.io/blog/2016/01/12/stop-writing-python-4-incompatible-code/,
 special-casing Python 3 code instead of Python 2 code when writing Python 2/3 
code will lead to breakage when Python 3 comes out. There should probably be a 
note in the porting HOWTO mentioning that you should always special-case Python 
2 code and not Python 3 code.

--
assignee: docs@python
components: Documentation
messages: 258126
nosy: brett.cannon, docs@python
priority: normal
severity: normal
status: open
title: Update porting HOWTO to special-case Python 2 code, not Python 3

___
Python tracker 

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



[issue26096] '*' glob string matches dot files in pathlib

2016-01-12 Thread JitterMan

New submission from JitterMan:

Path('.').glob('*') generates all files and directories in '.' including hidden 
files (those that begin with '.'). This behavior is inconsistent with the shell 
and with the old glob module, which only generate hidden files if the glob 
pattern starts with a '.'.

--
messages: 258128
nosy: jitterman
priority: normal
severity: normal
status: open
title: '*' glob string matches dot files in pathlib
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