[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans

Changes by Monty Evans :


--
nosy: ShiftedBit
priority: normal
severity: normal
status: open
title: Base64 decoding gives incorrect outputs.
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans

New submission from Monty Evans:

Tested in Python 2.7 and 3.5 - the base64 module contains a couple of decoding 
methods, 'standard_b64decode()' and 'b66decode()' which incorrectly decode 
certain invalid base64 strings. This is outlined in detail here: 
"https://stackoverflow.com/questions/44347819/python-3-5-base64-decoding-seems-to-be-incorrect";.
 I've checked with a few other developers, and they agree that there is an 
issue here. I can't see that the issue has been resolved on the bug tracker, so 
I've worked up an alternative version of "standard_b64decode()" which I'll 
upload, which ought to solve the issue.

--

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-06-04 Thread Thomas Moreau

Thomas Moreau added the comment:

I think this is a good solution as it let the user define easily the behavior 
it needs in other situation too. I would recommend adding the object 
responsible for the failure to the _on_queue_thread_error callback. This would 
simplify the error handling.


@@ -260,8 +260,16 @@ class Queue(object):
 info('error in queue thread: %s', e)
 return
 else:
-import traceback
-traceback.print_exc()
+self._on_queue_thread_error(e, obj)
+
+def _on_queue_thread_error(self, e, obj):
+"""
+Private API called when feeding data in the background thread
+raises an exception.  For overriding by concurrent.futures.
+"""
+import traceback
+traceback.print_exc()
+

--

___
Python tracker 

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



[issue30461] glob returns results in undeterministic order

2017-06-04 Thread Bernhard M. Wiedemann

Bernhard M. Wiedemann added the comment:

>From my performance measurements, the overhead was negligible (not even 
>counting the processing done on files returned by glob).

And also glob in C, bash, perl all do sort by default and these are generally 
pretty fast languages, yet they still chose consistency over performance.

I updated my PR to also update the documentation accordingly.

--
status: closed -> open

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-06-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2017

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PR 1938 tries to balance the stack effect computation for try/except and 
try/finally. I'm not sure that it is worth backporting.

Noised Antoine and Benjamin as people related to issue3021.

--
nosy: +benjamin.peterson, pitrou
stage: needs patch -> patch review
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



[issue24340] co_stacksize estimate can be highly off

2017-06-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm against backporting performance improvements which don't fix a severe 
regression.

--

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans

Changes by Monty Evans :


Added file: http://bugs.python.org/file46923/b64_decoding.py

___
Python tracker 

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



[issue30565] PEP 538: default to skipping warning for implicit locale coercion?

2017-06-04 Thread Nick Coghlan

New submission from Nick Coghlan:

This is a follow-up to PEP 538 that reflects the uncertainty over whether or 
not the warning on *successful* implicit locale coercion is a good idea.

The argument for this warning is that it alerts redistributors, system 
integrators, and application developers to the fact that LC_CTYPE may not be 
what they expect it to be.

The argument against it is that in many, and potentially even most, cases where 
the warning is omitted, there won't be any subsequent problems, and so the 
warning qualifies as a false alarm (especially for end users of applications 
that just happen to be written in Python), and the PEP 538 section in the .37 
What's New, together with the fact that "LC_CTYPE=C.UTF-8" (or similar) appears 
in the process environment can be considered sufficient notice of the change 
for debugging purposes.

The initial PEP 538 implementation at 
https://github.com/python/cpython/pull/659 includes the warning, this issue 
reflects the possibility that we may decide to reverse that decision prior to 
the release of Python 3.7.0.

--
assignee: ncoghlan
messages: 295120
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: PEP 538: default to skipping warning for implicit locale coercion?
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue28180] sys.getfilesystemencoding() should default to utf-8

2017-06-04 Thread Nick Coghlan

Nick Coghlan added the comment:

The PEP 538 PR is mostly complete now, but I created 
https://bugs.python.org/issue30565 to track making a follow-up decision on 
whether or not we really want to emit a warning on *successful* implicit locale 
coercion.

The pre-release What's New entry for PEP 538 will include a link to that issue 
to allow folks to provide feedback on their preferences.

--

___
Python tracker 

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



[issue28206] signal.Signals not documented

2017-06-04 Thread desbma

Changes by desbma :


--
pull_requests: +2018

___
Python tracker 

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



[issue24340] co_stacksize estimate can be highly off

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This isn't so easy. Seems the simplest way to solve this issue is implementing 
issue17611.

--

___
Python tracker 

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



[issue29456] bug in unicodedata.normalize: u1176, u11a7 and u11c3

2017-06-04 Thread Wonsup Yoon

Wonsup Yoon added the comment:

Is there anything need more?

--

___
Python tracker 

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



[issue30565] PEP 538: default to skipping warning for implicit locale coercion?

2017-06-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you please look at the patch Raymond? Is this what you wanted?

--

___
Python tracker 

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



[issue24744] Lack of type checks in pkgutil.walk_packages and friends

2017-06-04 Thread Sanyam Khurana

Sanyam Khurana added the comment:

I've updated the PR with required changes along with the test. Please have a 
look and let me know if any changes are needed.

--

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans

Changes by Monty Evans :


--
components: +Library (Lib)

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Gareth Rees

Gareth Rees added the comment:

RFC 4648 section 3.5 says:

   The padding step in base 64 and base 32 encoding can, if improperly
   implemented, lead to non-significant alterations of the encoded data.
   For example, if the input is only one octet for a base 64 encoding,
   then all six bits of the first symbol are used, but only the first
   two bits of the next symbol are used.  These pad bits MUST be set to
   zero by conforming encoders, which is described in the descriptions
   on padding below.  If this property do not hold, there is no
   canonical representation of base-encoded data, and multiple base-
   encoded strings can be decoded to the same binary data.  If this
   property (and others discussed in this document) holds, a canonical
   encoding is guaranteed.

   In some environments, the alteration is critical and therefore
   decoders MAY chose to reject an encoding if the pad bits have not
   been set to zero.

If decoders may choose to reject non-canonical encodings, then they may also
choose to accept them. (That's the meaning of "MAY" in RFC 2119.) So I think
Python's behaviour is conforming to the standard.

--
nosy: +g...@garethrees.org

___
Python tracker 

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



[issue26656] Documentation for re.compile is a bit outdated

2017-06-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy
status: open -> pending

___
Python tracker 

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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2017-06-04 Thread Vikram Hegde

New submission from Vikram Hegde:

Here is the relevant code snippet from  decode_generalized_number() in 
punycode.py

try:
char = ord(extended[extpos])
except IndexError:
if errors == "strict":
raise UnicodeError("incomplete punicode string")
return extpos + 1, None
extpos += 1
if 0x41 <= char <= 0x5A: # A-Z
digit = char - 0x41
elif 0x30 <= char <= 0x39:
digit = char - 22 # 0x30-26
elif errors == "strict":
raise UnicodeError("Invalid extended code point '%s'"
   % extended[extpos])

   While raising the UnicodeError() in the last line above, it accesses 
extended[extpos]. However extpos was incremented by 1 a few lines above that. 
This causes two errors:
   1) The UnicodeError() prints the wrong character (the one after the 
character we want)
   2) If the previous extpos was the last character in the string, then 
attempting to print character at extpos+1 will raise an IndexError.

--
components: Library (Lib)
messages: 295127
nosy: Vikram Hegde
priority: normal
severity: normal
status: open
title: punycode codec raises IndexError in decode_generalized_number()
type: crash
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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2017-06-04 Thread Vikram Hegde

Changes by Vikram Hegde :


--
nosy:  -Vikram Hegde

___
Python tracker 

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



[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>From the documentation:

"""
As the target string is scanned, REs separated by ``'|'`` are tried from left 
to right. When one pattern completely matches, that branch is accepted. This 
means that once ``A`` matches, ``B`` will not be tested further, even if it 
would produce a longer overall match.  In other words, the ``'|'`` operator is 
never greedy.
"""

I think this completely describes the behavior.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue23532] add example of 'first match wins' to regex "|" documentation?

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Serhiy that the docs correctly and completely describe the 
behavior.

--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

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



[issue26656] Documentation for re.compile is a bit outdated

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, I think the sentence is fine as-is.  The "which can be used" part doesn't 
purport to be all inclusive.   I rather like that at match() and search() are 
mentioned -- this is better than more vague reference to "the methods described 
below" -- and this is better than listing out every method.

I vote for leaving this alone.

--
nosy: +rhettinger
status: pending -> open

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread R. David Murray

R. David Murray added the comment:

Not only is it conforming, it is required, since the primary use (originally) 
of the base64 module was in the email package, where generous interpretation of 
the input is the standard.

This does not mean that adding a strict mode would be out of line, but that 
would be an enhancement request, and would require some discussion about the 
API.

I'm going to close this issue as not a bug.  If you want to submit an 
enhancement proposal, please do so in a new issue.  You'll probably want to 
wait for the design discussion to resolve before (re)writing the code :)

--
nosy: +r.david.murray
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



[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Segev Finer

New submission from Segev Finer:

There is a ref leak in sys.getwindowsversion due to using PyTuple_Pack and 
forgetting that it increments the ref count of passed in objects. Found here: 
https://github.com/python/cpython/pull/1927#issuecomment-306019512.

Clearly shows up in python -m test -R 3:2 test_sys

--
components: Interpreter Core
messages: 295132
nosy: Segev Finer
priority: normal
severity: normal
status: open
title: Leak in sys.getwindowsversion
type: resource usage
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Segev Finer

Changes by Segev Finer :


--
nosy: +eryksun

___
Python tracker 

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



[issue30461] glob returns results in undeterministic order

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Sorry, we're going to reject this patch for the reasons discussed in the two 
other referenced patches.

If a user wants sorted order, they can effortlessly specify that with 
sorted(glob('*.cpp')).

--
nosy: +rhettinger
resolution: not a bug -> 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



[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Segev Finer

Changes by Segev Finer :


--
pull_requests: +2019

___
Python tracker 

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



[issue30558] [Suggestion] Improve documentation for set() API

2017-06-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 9be4ff359daa67cde6246494f643ed7cd2825d46 by Raymond Hettinger 
(csabella) in branch 'master':
bpo-30538: Update count() in Functional Programming HOWTO (#1919)
https://github.com/python/cpython/commit/9be4ff359daa67cde6246494f643ed7cd2825d46


--

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thank you for the PR.

--
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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, feel free to apply and backport once the CLA is signed.

--
assignee: docs@python -> Mariatta
nosy: +Mariatta, rhettinger

___
Python tracker 

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




[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 48fb766f70d9ca9d5934cbddbe8d8e7972cb6343 by Serhiy Storchaka 
(Segev Finer) in branch 'master':
bpo-30567: Fix refleak in sys.getwindowsversion (#1940)
https://github.com/python/cpython/commit/48fb766f70d9ca9d5934cbddbe8d8e7972cb6343


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Ned Deily

Changes by Ned Deily :


--
components: +Windows -Interpreter Core
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue30567] Leak in sys.getwindowsversion

2017-06-04 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> backport needed

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread Monty Evans

Monty Evans added the comment:

Ah, that is enlightening. It hadn't occured to me that you might want to allow 
for minor mistakes in the encoder - I must've missed that part of the standard. 
Thanks to both of you for clearing that up :).

--

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Thank you.  And thank you for explaining about the strings.  That's what I 
suspected, so I appreciate you confirming it.

--

___
Python tracker 

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



[issue30568] README Formatting

2017-06-04 Thread James Lu

New submission from James Lu:

- Shorten the Copyright statement from a list of years (`2001, 2002, 2003, ... 
2017`) into `2001-2017`
  - Extend copyright date at end of README from 2016 to 2017
 - Ensure that there are two newlines before every header throughout the file 
(this was the original format)

--
assignee: docs@python
components: Documentation
messages: 295140
nosy: James.Lu, docs@python
priority: normal
pull_requests: 2020
severity: normal
status: open
title: README Formatting
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2021

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2022

___
Python tracker 

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



[issue18280] Documentation is too personalized

2017-06-04 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Would it be OK for me to tackle this?

--
nosy: +csabella

___
Python tracker 

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



[issue30569] Tutorial section 2.1 has *nix example at 3.7, but Windows at 3.6

2017-06-04 Thread Cheryl Sabella

New submission from Cheryl Sabella:

https://docs.python.org/3.7/tutorial/interpreter.html

The first lines for the location/command have been updated for 3.7, but next 
paragraph for Windows has not been updated.

--
assignee: docs@python
components: Documentation
messages: 295142
nosy: csabella, docs@python
priority: normal
severity: normal
status: open
title: Tutorial section 2.1 has *nix example at 3.7, but Windows at 3.6
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue30568] README Formatting

2017-06-04 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I had made the same suggestion a few months ago and found that it had already 
been discussed.  :-)

Duplicate of http://bugs.python.org/issue29555.

--
nosy: +csabella

___
Python tracker 

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



[issue26602] argparse doc introduction is inappropriately targeted

2017-06-04 Thread Cheryl Sabella

Cheryl Sabella added the comment:

If it helps at all, I first learned about argparse a few weeks ago.  I first 
went to the doc page and then immediately went to the tutorial, as suggested.  
I didn't find it difficult or off-putting at all.  In fact, I loved that there 
was a tutorial that it explained it perfectly for my level as a newbie.  I've 
referenced the doc page a few times since, but I haven't read it from beginning 
to end like I did to learn the str functions, for example.  I think the doc 
page should be more advanced for people who need to know it's full power (as it 
is now) and the tutorial can serve newbies (as it does now).

--
nosy: +csabella

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2017-06-04 Thread Cheryl Sabella

Cheryl Sabella added the comment:

It appears all the patches for this issue have been applied.  Is the only open 
item the changes to test_compare?

--
nosy: +csabella

___
Python tracker 

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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-04 Thread STINNER Victor

STINNER Victor added the comment:

I used ./python -m test Lib/test/test_threading.py --list-tests.

I would like to be able to use this feature in regrtest too:

./python -m test test_threading --list-tests

Sadly, this option already exists and only return test files, not test
methods.

--

___
Python tracker 

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



[issue30417] [buildbot] Disable the cpu resources on slow buildbots

2017-06-04 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +2023

___
Python tracker 

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



[issue30564] Base64 decoding gives incorrect outputs.

2017-06-04 Thread R. David Murray

R. David Murray added the comment:

Actually, the API discussion may be short: we already have a 'validate' option, 
whose spirit matches with this, so adding the check for the padding issue to 
that of the non-alphabet characters check would seem to me to be quite 
reasonable.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-04 Thread Guido van Rossum

Guido van Rossum added the comment:

I've done what I can for the logos: http://www.pythonlabs.com/logos.html

--

___
Python tracker 

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



[issue30566] punycode codec raises IndexError in decode_generalized_number()

2017-06-04 Thread R. David Murray

R. David Murray added the comment:

Can you provide a reproducer, please?

--
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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

New submission from Daniel Lepage:

The following code causes a segmentation fault:
class Failure(object):
def __getattr__(self, attr):
return (self, None)
issubclass(Failure(), int)

I am running a macbook pro, OS X 10.12.4, and have observed the problem in 
python 3.5.2, 3.6.0, and 3.6.1.

It appears that returning (self,) causes it to go into an infinite loop 
attempting to get `x.__bases__`, and returning `(self, y)` for any value `y` 
causes it to attempt to get `x.__bases__` 262,030 times and then segfault.

A crash log is attached.

--
components: Interpreter Core
files: segfault.crash
messages: 295150
nosy: Daniel Lepage
priority: normal
severity: normal
status: open
title: issubclass segfaults on objects with weird __getattr__
type: crash
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46924/segfault.crash

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

Changes by Daniel Lepage :


--
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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Daniel Lepage

Daniel Lepage added the comment:

I tried it on python 2.7.12 and python 2.6.9 since I had them lying around and 
got the same behavior.

--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Bruno Oliveira

Changes by Bruno Oliveira :


--
nosy: +Bruno Oliveira

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Louie Lu

Louie Lu added the comment:

I can reproduce this bugs on 3.7, Linux.

Python 3.7.0a0 (heads/master:d3bedf356a, Jun  5 2017, 10:21:52) 
[GCC 6.3.1 20170306] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo(object):
...  def __getattr__(self, attr):
...   return (self, None)
... 
>>> issubclass(Foo(), int)

[1]21897 segmentation fault (core dumped)  ./python

--
nosy: +louielu
versions: +Python 3.7

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2017-06-04 Thread Louie Lu

Louie Lu added the comment:

Without this segfault, I think you do a wrong operation. In other cases, for 
example:

>>> issubclass(10, int)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: issubclass() arg 1 must be a class


`issubclass` will return TypeError on instance, if you test as 
`issubclass(Failure, int)` or `issubclass(Failure().__class__, int`, it should 
get the correct answer.

--

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 1bced56567335745f91676192fc39c06aab30da9 by Mariatta (Mariano 
Anaya) in branch 'master':
bpo-30530: Update Descriptor How To Documentation (GH-1845)
https://github.com/python/cpython/commit/1bced56567335745f91676192fc39c06aab30da9


--

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2024

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage: patch review -> backport needed

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +2025

___
Python tracker 

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



[issue29555] Update Python Software Foundation Copyright Year

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Any update about this? 
Who do we need to talk to in order to move forward?
Thanks.

--
nosy: +Mariatta

___
Python tracker 

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



[issue30568] README Formatting

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks :) Yes the issue with copyright in the docs is still pending.
I'm closing this as a duplicate.

--
nosy: +Mariatta
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Update Python Software Foundation Copyright Year

___
Python tracker 

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



[issue29555] Update Python Software Foundation Copyright Year

2017-06-04 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 86eb93fae6fc5bf121de815b82697f2bc5bc126c by Mariatta in branch 
'3.6':
bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1953)
https://github.com/python/cpython/commit/86eb93fae6fc5bf121de815b82697f2bc5bc126c


--

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 1f04b900861686351977f6a7d51afa5fdc181b82 by Mariatta in branch 
'3.5':
bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1954)
https://github.com/python/cpython/commit/1f04b900861686351977f6a7d51afa5fdc181b82


--

___
Python tracker 

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



[issue30530] Descriptors HowTo: Example on function.__get__ needs update

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Mariano. I merged your PR and it's been backported to 3.5 and 3.6.

--
resolution:  -> fixed
stage: backport needed -> 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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset b32fb6c1fb6cdf019817176f573e60c0923a6e22 by Mariatta (csabella) 
in branch '3.5':
bpo-30538: Update count() in Functional Programming HOWTO (GH-1919) (GH-1944)
https://github.com/python/cpython/commit/b32fb6c1fb6cdf019817176f573e60c0923a6e22


--
nosy: +Mariatta

___
Python tracker 

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



[issue30538] Functional Programming HOWTO describes one argument itertools.count()

2017-06-04 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset ce40550acd3a8928bb6fef4d4e73642a8a69745d by Mariatta (csabella) 
in branch '3.6':
bpo-30538: Update count() in Functional Programming HOWTO (GH-1919) (GH-1943)
https://github.com/python/cpython/commit/ce40550acd3a8928bb6fef4d4e73642a8a69745d


--

___
Python tracker 

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



[issue30571] Add integer formatting code for fixed-width signed arithmetic (2's complement)

2017-06-04 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The current 'b' formatting code in inconvenient for emulating, demonstrating, 
and teaching two's complement arithmetic.  The problem is that negative inputs 
are always formatted with a minus sign.  I propose that some formatting code be 
provided for fixed-width display where the leading bit is a sign bit.

For example, if code were a capital 'B' and the total width were 8-bits:

>>> x = -12
>>> format(12, '08B')
'0100'

Currently, to achieve the same effect, one of the following is used:

>>> format(x if x >= 0 else x + 2**8, '08b')
'0100'

or 

>>> format(x & (2**8 - 1), '08b')
'0100'

For values outside the valid range, perhaps a ValueError could be raised:

>>> format(-200, '08B')
Traceback (most recent call last):
...
ValueError:  Expected value in range -128 <= x < 128, not -200

I'm not sure what the right code should be.  The idea of capital 'B' is 
attractive, but we already have a different relationship between 'X' and 'x'.   
There could also be a modifier symbol such as '!' in '!8b'.

--
components: Interpreter Core
messages: 295162
nosy: mark.dickinson, rhettinger, talin
priority: low
severity: normal
status: open
title: Add integer formatting code for fixed-width signed arithmetic (2's 
complement)
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue25910] Fixing links in documentation

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you!

What is left:

* Rewrite the text of license.rst for referring the Zope Corporation in the 
past tense and remove the link (and maybe add the reference to the Zope 
Foundation if it is related).

* Mark historical links http://www.vex.net/parnassus/ and 
http://svn.python.org/view/tracker/importer/ as dead.

--

___
Python tracker 

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



[issue18280] Documentation is too personalized

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Fred, do you want to opine on this?

In some cases, like heapq.py, the personal touch is an essential and beautiful 
part of the presentation and is a cherished part of Python.  In other cases, it 
seems unnecessary or a little off-putting, so perhaps a few changes are 
warranted.

Personally, I've grown to really dislike the incessant stream of proposals to 
make broad sweeping trivial changes across the code or documentation to fix 
made-up problems (ones not reported or cared about by actual users).  In 
particular, I worry about sending some new dev on a mission to rewrite 
documentation that was written by domain experts (Alex Martelli reported that 
copy-editors "wreaked havoc" on one of his books just prior to publication by 
subtly changing the meaning or correctness of his prose while applying grammar 
rules and minor style edits -- I wish to avoid the same for us).

Also, I place high value on text written by Guido and think we lose something 
every time someone wants to rewrite it to fit their personal tastes and views 
of the language.  The tastes and views of module authors are more important are 
easily lost in style edits (especially those that change point of view, mood, 
or theme of presentation).

Another thought is that there should be different general rules for different 
sections.  The standard library docs tend to be more formal.  The language 
reference tends to be even more formal ("for language lawyers"). The tutorial 
tends to be personable.  The how-to guides are often have a personal touch and 
are the only places where we attribute authorship back individuals (actual 
by-lines at the top of the file).

[Cheryl Sabella]
> Would it be OK for me to tackle this?
You could, but I would really like to get you involved in more substantive work 
that involves thinking about real issues and real code.  IMO, this project 
isn't worthy of you time and is not on the critical path to your stated goals.  
 That said, feel free to volunteer for anything that interests you.

--
assignee: docs@python -> fdrake
nosy: +fdrake, rhettinger
versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Rather than changing the documentation, I would prefer to have this fixed for 
date/time/datetiem unless MAL has a reason not to make the change.

For timezone, I don't think we really care.  

For timedelta, it is reasonable to always be the same hash.  It isn't 
conceptually different from the float given by s.total_seconds() or a tuple of 
(days, seconds, microseconds).

--
nosy: +rhettinger

___
Python tracker 

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



[issue30523] unittest: add --list-tests option to only display the list of test names, don't run tests

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I concur with Julien, the result should be printed to stdout.

I tried:

$ ./python -m unittest test.test_builtin --list-tests
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
test.test_builtin.BuiltinTest.test_abs
test.test_builtin.BuiltinTest.test_all
...

$ ./python -m test.test_builtin --list-tests
BuiltinTest.test_abs
BuiltinTest.test_all
BuiltinTest.test_any
...
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest
doctest.DocTestCase.runTest

All these doctest.DocTestCase.runTest look useless.

But "./python -m unittest test.test_json --list-tests" and "./python -m 
test.test_json --list-tests" give the same output.

"./python -m test.test_doctest --list-tests" and "./python -m test.test_tk 
--list-tests" run tests instead of listing them.

--

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2017-06-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me that this difference is not intentional. This is just a 
consequence of the fact that __hash__ functions for some of these objects use 
the hash of the pickle state which is a bytes object.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8136] urllib.unquote decodes percent-escapes with Latin-1

2017-06-04 Thread karl

karl added the comment:

#8143 was fixed.

Python 2.7.10 (default, Feb  7 2017, 00:08:15) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> urllib.unquote(u"%CE%A3")
u'\xce\xa3'

What should become of this one?

--
nosy: +karlcow

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-06-04 Thread Stefan Behnel

Stefan Behnel added the comment:

I looked up this change again and was surprised that it still wasn't applied. 
It feels to me that it makes sense already for reasons of consistency. Any time 
frame for changing it? I'd like to use METH_FASTCALL in Cython in a 
future-proof way.

--

___
Python tracker 

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



[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-06-04 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Proposed patch renames METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS
> and makes bare METH_FASTCALL be used for functions with 
> positional-only parameters. This eliminates small cost that 
> these functions pay for handling empty keywords: calling 
> _PyStack_UnpackDict() and _PyArg_NoStackKeywords(), 
> passing kwnames. This also can slightly reduce stack 
> consumption.

+1 for all the reasons listed.  These are very reasonable specializations.  The 
empty keyword checks are really irritating for fine-grained functions.

--

___
Python tracker 

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