[issue23921] Standardize documentation whitespace, formatting

2016-03-01 Thread Georg Brandl

Georg Brandl added the comment:

I had no idea we had so many cases of wonky indentation :)

This looks good to me, apart from a few comments I left on rietveld.

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-03-01 Thread Georg Brandl

Georg Brandl added the comment:

Looks good now! I left a few comments on Rietveld.

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Berker Peksag

Berker Peksag added the comment:

> Which patch?

Looks like the patch can be found at https://github.com/atgreen/libffi/pull/34/ 
and it has been released in libffi 3.1: 
https://github.com/atgreen/libffi/blob/17ffc3655a531c116e9eb9cc933e50bb1e5c47f8/ChangeLog.libffi-3.1#L481

(It's hard to share a specific commit since libffi's history is not linear.)

The patch also has been merged into CPython's fork in 0fef0afb9d19 (Update the 
ctypes module's libffi to v3.1):

* 
https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L43
* 
https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L128

I don't have an ARM system to run David's reproducer (thanks for your report 
and for the test script, by the way!), but I think we can safely assume that 
this has already been fixed.

--
nosy: +berker.peksag
resolution:  -> out of date
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



[issue23670] Modifications to support iOS as a cross-compilation target

2016-03-01 Thread Russell Keith-Magee

Russell Keith-Magee added the comment:

Alex - The usual cause for that problem isn't regrtest (at least, not 
directly). The cause is one of the tests in the suite spawning a subprocess. 
Due to the way the test harness works, when the test suite forks/spawns a  
subprocess (e.g., to run a network server or a multiprocess worker), the fork 
causes the a second version of the test suite to start, rather than starting 
the server subprocess.

I've attached a patch for 3.5.1. This includes a patch to work around 
Issue22625; the patch is definitely suboptimal, but it lets a build come to 
completion. What is really needed (as requested on python-dev) is some help 
working out how to fix Issue22625 properly.

--
versions: +Python 3.5
Added file: http://bugs.python.org/file42060/20160217.diff

___
Python tracker 

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



[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer

Alex Willmer added the comment:

This looks like a duplicate of #20211, and IMO the patch there is more correct.

--

___
Python tracker 

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



[issue22654] issue with PYTHON_FOR_BUILD

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue22699] cross-compilation of Python3.4

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue22625] When cross-compiling, don’t try to execute binaries

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue23670] Modifications to support iOS as a cross-compilation target

2016-03-01 Thread Alex Willmer

Alex Willmer added the comment:

I've done my best to rebase Freakboy's patch onto 3.6-dev. The attached applies 
cleanly, but the testsuite goes into an infinite loop. It's a start at least. 
At a guess the problem is in Lib/test/libregrtest/ or Lib/test/regrtest.py 
where the patch changes sys.exit() calls to return statements.

I took the liberty of filtering out whitespace & other cosmetic changes that 
were in 20151221.diff.

--
nosy: +Alex.Willmer
Added file: http://bugs.python.org/file42059/20160301-brokentests.diff

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



[issue26467] Add async magic method support to unittest.mock.Mock

2016-03-01 Thread Brett Cannon

New submission from Brett Cannon:

Mock doesn't support stuff like __aexit__ which means you can't mock out 
something like an async context manager.

--
components: Library (Lib)
messages: 261092
nosy: brett.cannon, michael.foord
priority: normal
severity: normal
stage: test needed
status: open
title: Add async magic method support to unittest.mock.Mock
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



[issue26446] Mention in the devguide that core dev stuff falls under the PSF CoC

2016-03-01 Thread Brett Cannon

Brett Cannon added the comment:

The discussion seems to have gone in the direction of putting all 
core-controlled stuff under the CoC. So the devguide will mention this is the 
policy.

--
title: Mention in the devguide that core devs are expected to follow the PSF 
CoC -> Mention in the devguide that core dev stuff falls under the PSF CoC

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

The easiest way to check is to run the tests attached

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

Then maybe it's fixed, I have no idea

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +doko

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

David Schneider: "A patch for this issue has been accepted into libffi."

fijal: "Can you please commit the upstream fix that has been committed 3 years 
ago (...)"

Which patch? Attached tar archive doesn't look like a patch and I see no 
reference to a fix.

Previous libffi upgrade:
---
changeset:   92061:4331fa01398e
branch:  2.7
parent:  92058:928135d0fa7d
user:d...@ubuntu.com
date:Sun Aug 10 11:15:28 2014 +0200
files:   Misc/NEWS Modules/_ctypes/libffi.diff 
Modules/_ctypes/libffi/.gitignore Modules/_ctypes/libffi/.travis.yml 
Modules/_ctypes/libffi/ChangeLog Modules/_ctypes/libffi/Change
description:
- Issue #22176: Update the ctypes module's libffi to v3.1.  This release
  adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
  architectures.
---

This upgrade was made in august 2014, this issue was reported in march 2013. 
The upgrade didn't add the mentioned fix?

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

To me, it doesn't make sense to maintain a downstream "fork" of libffi. I would 
prefer to "simply" upgrade to a more recent version of libffi in CPython. But I 
don't know why we have a downstream version. What was patched? Does anyone know 
anything about it?

I understood that Linux packages configure with ./configure 
--with-system-libffi to reuse the system libffi.so.

Who uses the downstream version? Windows? OS X?

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I feel odd trying to advocate a POV that I disagree with, so let me just quote 
MAL:


"""
In practice you often don't know the resolution of
the timing source. Nowadays, the reverse of what you said
is usually true: the source resolution is higher than the
precision you use to print it.
..

For full seconds, truncation will add an error of +/- 1 second,
whereas rounding only adds +/- 0.5 seconds. This is what convinced
me to use rounding instead of truncation.
"""

I somehow missed this argument when Marc-Andre made it, so I want to make sure 
that it is properly considered before we finalize this issue.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> Personally, I don't rounding is that useful.

Nice, it looks like I agree with you on using ROUNDING_FLOOR :-)

I don't think that we should be prepared for theorical user requests, but 
rather focus on the concrete and well defined current existing user request: 
"Add timespec optional flag to datetime isoformat() to choose the precision".

Let's wait until users request a datetime.round() method to understand better 
concrete issues.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Personally, I don't rounding is that useful.  My working assumption is that 
users will select say timespec='millisecond' only when they know that their 
time source produces datetime instances with millisecond precision and they 
don't want to kill more trees by printing redundant 0's.

MAL's objection this this line of arguments was that some time sources have odd 
resolution (he reported MS SQL's use of 333 ms) and a user may want to have a 
perfect round-tripping when using a sub-usec timespec and such an odd time 
source or destination.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> Maybe a datetime.round() method along these lines will be a worthwhile 
> addition?

Sorry, what is the use case of this method?

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Guido van Rossum

Guido van Rossum added the comment:

IIUC truncation traditionally means "towards zero" -- that's why we have 
separate "floor" and "ceiling" operations meaning "towards [negative] 
infinity". Fortunately we shouldn't have to deal with negative values here so 
floor and truncate mean the same thing. Agreed that isoformat() should also 
truncate.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Except for the case where you're closer than half a usec from the next value, 
IMO rounding makes no sense when suppressing digits. I most definitely would 
never want 9:59:59 to be rounded to 10:00 when suppressing seconds. If you 
really think there are use cases for that you could add a 'round=True' flag (as 
long as it defaults to False). That seems better than supporting rounding on 
datetime objects themselves. But I think you're just speculating.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> But what should we do in your opinion?

Use ROUND_FLOOR rounding method.

time.time(), datetime.datetime.now(), etc. round the current time using the 
ROUND_FLOOR rounding method.

Only datetime.datetime.fromtimestamp() uses ROUND_HALF_EVEN, but it's more an 
exception than the rule: this function uses a float as input. To be consistent, 
we must use the same rounding method than other Python functions taking float 
as parameter, like round(), so use ROUND_HALF_EVEN.

So I suggest to also use ROUND_FLOOR for .isoformat().

Hopefully, we don't have to discuss about the exact rounding method for 
negative numbers, since the minimum datetime object is datetime.datetime(1, 1, 
1) which is "positive" ;-)

You have a similar rounding question for file timestamps. Depending on the file 
system, you may have a resolution of 2 seconds (FAT), 1 second (ext3) or 1 
nanosecond (ext4). But Linux syscalls accept subsecond resolution. The Linux 
kernel uses ROUND_FLOOR rounding method if I recall correctly. I guess that 
it's a requirement for makefiles. If you already experimented a system clock 
slew, you may understand me :-)


> For full seconds, truncation will add an error of +/- 1 second,
> whereas rounding only adds +/- 0.5 seconds. This is what convinced
> me to use rounding instead of truncation.

What is truncation? Is it the ROUND_FLOOR (towards -inf) rounding method? Like 
math.floor(float).

Python int(float) uses ROUND_DOWN (towards zero) which is different than 
ROUND_FLOOR, but only different for negative numbers. int(-0.9) returns 0, 
whereas math.floor(-0.9) returns -1.

I guess that "rounding" means ROUND_HALF_EVEN here? The funny "Round to nearest 
with ties going to nearest even integer" rounding method. Like round(float).

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-03-01 Thread Zachary Ware

Zachary Ware added the comment:

Attaching regenerated patch to coax Rietveld into accepting it for easier 
review.

--
nosy: +zach.ware
Added file: http://bugs.python.org/file42058/issue26462_regen.diff

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I hope my prediction "I am afraid that the rounding issues may kill this 
proposal" (see msg202276) will not come true.

I think the correct way to view "timespec" is a way to suppress/enforce 
printing of trailing digits.

Users that choose printing less than full usec format should make sure that 
their datetime instances are properly rounded before printing.

Unfortunately, I does not look like the datetime module makes rounding easy.  
The best I can think of is something like

def round_datetime(dt, delta):
dt0 = datetime.combine(dt.date(), time(0))
return dt0 + round((dt - dt0) / delta) * delta

Maybe a datetime.round() method along these lines will be a worthwhile addition?

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Guido van Rossum

Guido van Rossum added the comment:

But what should we do in your opinion?

--

___
Python tracker 

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



[issue26462] Patch to enhance literal block language declaration

2016-03-01 Thread Julien

Julien added the comment:

I revewed all my ".. code-block:: bash" and you're right (I was unaware of the 
existence of the "console" lexer). I changed them (reviewing them one by one) 
to ".. code-block:: shell-session", a synonym for ".. code-block:: console" 
(http://pygments.org/docs/lexers/?highlight=console#pygments.lexers.shell.BashSessionLexer)
 which I find, in a Python context, semantically more precise, and less 
ambigious, as one may read "console" as "the repl" (I assume most writers of 
the doc are aware of commonly used pygment lexers, it's still better for 
newcomers to be explicit and readable).

For your other point, about pycon being automatically detected, I tried 
removeing them and it works, I was sure I was adding them only where the 
python3 parser was reporting an error (was fixing errors one by one). I keeped 
the explicit pycon lexer in the "Doc/extending/extending.rst" file which have a 
".. highlightlang:: c".

Here is the new patch, and thanks for this usefull review !

--
Added file: http://bugs.python.org/file42057/literal_blocks_languages.patch

___
Python tracker 

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



[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-01 Thread Daniel Shaulov

Daniel Shaulov added the comment:

Pinging after a month without review (as the devguide suggests).

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> Given that we're talking about what to do when we're suppressing the usecs I 
> don't think roundtripping matters. :-)

I changed many times how Python rounds nanoseconds in the private PyTime API, 
and I got a bug report because of that! => issue #23517.

By the way, I wrote an article to explain the history the private PyTime API, 
especially changes on rounding ;-) https://haypo.github.io/pytime.html

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Guido van Rossum

Guido van Rossum added the comment:

Given that we're talking about what to do when we're suppressing the usecs I 
don't think roundtripping matters. :-)

--

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6643c5cc9797 by Victor Stinner in branch '3.5':
Issue #26464: Fix unicode_fast_translate() again
https://hg.python.org/cpython/rev/6643c5cc9797

--

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> LGTM.

Thanks for the review. I pushed my fix.

Sorry for the regression, I hate being responsible of a regression in a core 
feature :-/

I may even deserve a release, but Python doesn't have the habit of "release 
often" yet :-(

--
nosy: +larry
priority: high -> release blocker
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 27ba9ba5deb1 by Victor Stinner in branch '3.5':
Fix str.translate()
https://hg.python.org/cpython/rev/27ba9ba5deb1

--
nosy: +python-dev

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee: serhiy.storchaka -> haypo
stage: needs patch -> commit review

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

Apparently you can't have an opinion from ctypes experts. Can you please commit 
the upstream fix that has been committed 3 years ago or just stop vendoring 
random, old, broken version of ctypes if you can't maintain it enough to pull 
fixes from upstream?

--
nosy: +fijall

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Another argument for truncation is that this is what GNU date does:

$ date --iso-8601=seconds --date="2016-03-01 15:00:00.999"
2016-03-01T15:00:00-0500

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Guido,

Did you consider MAL's msg202274?  I am still in favor of truncation, but would 
like to make sure we are not missing something that MAL knows from experience.

--

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

> See change cca6b056236a of issue #21118.

The bug was introduced in Python v3.5.0a1.

--

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

Oh... I see. It's a bug introduced by the optimization for ASCII replacing one 
character with another ASCII character or deleting a character: 
unicode_fast_translate(). See change cca6b056236a of issue #21118.

There is a confusion in the code between input and ouput position. "i = 
writer.pos;" is used in the caller to continue when unicode_fast_translate() 
was interrupted (because a translation use a non-ASCII character or a string 
longer than 1 character), but writer.pos is the position in the *output* 
string, not in the *input* string :-/

I see that I added unit tests on translate, but it lacks an unit testing fast 
translation, starting with ignore and then switching to regular translation.

Attached patch should fix the issue. It adds unit tests.

--
keywords: +patch
Added file: http://bugs.python.org/file42056/unicode_fast_translate.patch

___
Python tracker 

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



[issue26452] Wrong line number attributed to comprehension expressions

2016-03-01 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +haypo, serhiy.storchaka
versions:  -Python 3.2, 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



[issue24295] Backport of #17086 causes regression in setup.py

2016-03-01 Thread Moritz Sichert

Moritz Sichert added the comment:

This is still an issue in Python 2.7.11.

--

___
Python tracker 

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



[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-03-01 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread David Edelsohn

David Edelsohn added the comment:

It's not symbol with value 0, it's symbol number 0.  You can list the symbols 
with the AIX "dump -t" command.

--

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread Michael Felt

Michael Felt added the comment:

the basic process I have used repeatedly (for calling ./configure) to package 
python, and many other things has not changed.

Today, I repackaged version 2.7.10 (the file listed in 2.7.10.0) just to test 
the process I was using with 2.7.11

I learned that 2.7.10 does not build with the src and build seperated, while 
2.7.11 supports having the src in a different directory (e.g., 
../src/python-2.7.11)

root@x064:[/data/prj/aixtools/python]find p* old -name \*.I -ls
44641791 48748 -rw-r--r--  1 root  system49917952 Mar  1 12:59 
python-2.7.10/installp/ppc/aixtools.python.2.7.10.0.aix537.I
102500359 48758 -rw-r--r--  1 199  1954 49927680 Nov  3 15:00 
python-2.7.10.0/installp/ppc/aixtools.python.2.7.10.0.aix537.I
102307460 46487 -rw-r--r--  1 199  1954 47602688 Oct 31 17:14 
old/python-2.7.8.2/installp/ppc/aixtools.prj.python.2.7.8.2.aix537.I
44377168 44107 -rwxrwxr--  1 199  1954 45165056 Sep 26  2013 
old/Python-2.7.3/installp/ppc/aixtools.Python.2.7.3.0.I
44433716 46063 -rw-r--r--  1 199  1954 47168000 Apr 24  2015 
old/python-2.7.8.1/installp/ppc/aixtools.prj.python.2.7.8.1.aix619.I
102373018 46360 -rw-r--r--  1 199  1954 47472128 Nov  3 12:51 
old/python-2.7.8.0/installp/ppc/aixtools.python.2.7.8.0.aix537.I

FYI: aix537.I means the program was linked on AIX 5.3 TL7: aix619.I means AIX 
6.1 TL9

That is one of the changes mentioned (in 2013 I packaged without a visual 
reminder of the system used, read - lowest level it would install on properly - 
e.g., as with python 2.7.3)

Hence, my best guess is that something in the way ceval.c is now holding back 
the linking.

If there is someone interested in reading the result I can provide the output 
of /usr/vac/exe/dis Python/ceval.o (disassembly of ceval.o).

Or maybe someone has a better way of getting more specific error message than
An RLD for section 2 (.data) refers to symbol 0,
but the storage class of the symbol is not C_EXT or C_HIDEXT.

i.e., I do not see how to recognize "symbol 0" (unless something in the .c file 
is defining something as NULL over and over again and I am blind to that as 
well.)

--

___
Python tracker 

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



[issue26465] Upgrade OpenSSL shipped with python installers

2016-03-01 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Eryk Sun

Eryk Sun added the comment:

It duplicates translated characters as well. For example:

>>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a')
>>> 'aamnopqrb'.translate(table)
'rqponmrqponmĀ'

3.4 returns the correct result:

>>> table = str.maketrans('mnopqrb', 'rqponm\u0100', 'a')
>>> 'aamnopqrb'.translate(table)
'rqponmĀ'

The problem is the new fast path for one-to-one ASCII mapping 
(unicode_fast_translate in Objects/unicodeobject.c) doesn't have a way to 
return the current input position in order to resume processing the 
translation. _PyUnicode_TranslateCharmap assumes it's the same as the current 
writer position, which is wrong when input characters have been deleted.

--
nosy: +eryksun
title: str.translate() unexpectedly duplicates untranslated characters -> 
str.translate() unexpectedly duplicates characters

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates characters

2016-03-01 Thread Eryk Sun

Changes by Eryk Sun :


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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2016-03-01 Thread Michael Felt

Michael Felt added the comment:

If you need assistance (re: AIX), just ask.

However, I am guessing you have enough to move forward.

--

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates untranslated characters

2016-03-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
components: +Interpreter Core
nosy: +serhiy.storchaka
priority: normal -> high
stage:  -> needs patch

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread David Edelsohn

David Edelsohn added the comment:

Something is building libpython2.7.a incorrectly or the python.exp script is 
not functioning correctly.

ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o]
An RLD for section 2 (.data) refers to symbol 0,
but the storage class of the symbol is not C_EXT or C_HIDEXT.
ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o]
An RLD for section 2 (.data) refers to symbol 0,
but the storage class of the symbol is not C_EXT or C_HIDEXT.

is different than the later undefined symbols error.

--

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread Michael Felt

Michael Felt added the comment:

It worked fine using xlc with 2.7.10 (verified again today).

The delta between ceval.c in 2.7.10 and 2.7.11 is large.

make.out (excerpt) 2.7.10:

rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o  Parser/grammar1.o  
Parser/listnode.o  Parser/node.o  Parser/parser.o  Parser/parsetok.o  
Parser/bitset.o  Parser/metagrammar.o
Parser/firstsets.o  Parser/grammar.o  Parser/pgen.o Parser/myreadline.o 
Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o  Objects/boolobject.o  
Objects/bufferobject.o  Objects/bytes_methods.o  Objects/bytearrayobject.o  
Objects/capsule.o  Objects/c
ellobject.o  Objects/classobject.o  Objects/cobject.o  Objects/codeobject.o  
Objects/complexobject.o  Objects/descrobject.o  Objects/enumobject.o  
Objects/exceptions.o  Object
s/genobject.o  Objects/fileobject.o  Objects/floatobject.o  
Objects/frameobject.o  Objects/funcobject.o  Objects/intobject.o  
Objects/iterobject.o  Objects/listobject.o  Objec
ts/longobject.o  Objects/dictobject.o  Objects/memoryobject.o  
Objects/methodobject.o  Objects/moduleobject.o  Objects/object.o  
Objects/obmalloc.o  Objects/rangeobject.o  Obj
ects/setobject.o  Objects/sliceobject.o  Objects/stringobject.o  
Objects/structseq.o  Objects/tupleobject.o  Objects/typeobject.o  
Objects/weakrefobject.o  Objects/unicodeobje
ct.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o  Python/Python-ast.o  
Python/asdl.o  Python/ast.o  Python/bltinmodule.o  Python/ceval.o  
Python/compile.o  Python/codecs.o  Pyt
hon/errors.o  Python/frozen.o  Python/frozenmain.o  Python/future.o  
Python/getargs.o  Python/getcompiler.o  Python/getcopyright.o  
Python/getplatform.o  Python/getversion.o
Python/graminit.o  Python/import.o  Python/importdl.o  Python/marshal.o  
Python/modsupport.o  Python/mystrtoul.o  Python/mysnprintf.o  Python/peephole.o 
 Python/pyarena.o  Pyt
hon/pyctype.o  Python/pyfpe.o  Python/pymath.o  Python/pystate.o  
Python/pythonrun.o  Python/random.o  Python/structmember.o  Python/symtable.o  
Python/sysmodule.o  Python/tra
ceback.o  Python/getopt.o  Python/pystrcmp.o  Python/pystrtod.o  Python/dtoa.o  
Python/formatter_unicode.o  Python/formatter_string.o  Python/dynload_shlib.o   
   Python/threa
d.o
ar rc libpython2.7.a Modules/config.o  Modules/getpath.o  
Modules/main.o  Modules/gcmodule.o
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecs
module.o  Modules/_weakref.o  Modules/zipimport.o  Modules/symtablemodule.o  
Modules/xxsubtype.o
ranlib libpython2.7.a
./Modules/makexp_aix Modules/python.exp . libpython2.7.a;  xlc  
-Wl,-bE:Modules/python.exp -lld -o python  Modules/python.o  libpython2.7.a 
-ldl  -lpthread   -lm
 ./python -E -S -m sysconfig --generate-posix-vars ; if test $? -ne 0 ; 
then  echo "generate-posix-vars failed" ;  rm -f ./pybuilddir.txt ;  exit 1 ;  
fi
running build

tail make.out (2.7.11)
rm -f libpython2.7.a
ar rc libpython2.7.a Modules/getbuildinfo.o
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o 
Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o 
Parser/metagrammar.o Parser/firstsets
.o Parser/grammar.o Parser/pgen.o Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o 
Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o 
Objects/capsule.o Objects/cellobject.o Ob
jects/classobject.o Objects/cobject.o Objects/codeobject.o 
Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o 
Objects/exceptions.o Objects/genobject.o Objects/
fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o 
Objects/intobject.o Objects/iterobject.o Objects/listobject.o 
Objects/longobject.o Objects/dictob
ject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o 
Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o 
Objects/sliceobject.o
 Objects/stringobject.o Objects/structseq.o Objects/tupleobject.o 
Objects/typeobject.o Objects/weakrefobject.o Objects/unicodeobject.o 
Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o 
Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/errors.o Pyt
hon/frozen.o Python/frozenmain.o Python/future.o Python/getargs.o 
Python/getcompiler.o Python/getcopyright.o Python/getplatform.o 
Python/getversion.o Python/graminit.o Python/
import.o Python/importdl.o Python/marshal.o Python/modsupport.o 
Python/mystrtoul.o Python/mysnprintf.o Python/peephole.o Python/pyarena.o 
Python/pyctype.o Python/pyfpe.o Pytho
n/pymath.o Python/pystate.o Python/pythonrun.o Python/random.o 
Python/structmember.o Python/symtable.o Python/sysmodule.o Python/traceback.o 

[issue26445] setup.py sdist mishandles package_dir option

2016-03-01 Thread glep

glep added the comment:

Actually I have come to realise that this is the intended behaviour for source 
distributions. And that it is simply not possible to pull in a package from 
outside the current top-level package when building a source distribution.

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

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread Michael Felt

New submission from Michael Felt:

Finally noticed the new release, unfortunately it fails to build.

All proceeds normally until...

tail .buildaix/make.out
ar rc libpython2.7.a Parser/acceler.o Parser/grammar1.o Parser/listnode.o 
Parser/node.o Parser/parser.o Parser/parsetok.o Parser/bitset.o 
Parser/metagrammar.o Parser/firstsets.o Parser/grammar.o Parser/pgen.o 
Parser/myreadline.o Parser/tokenizer.o
ar rc libpython2.7.a Objects/abstract.o Objects/boolobject.o 
Objects/bufferobject.o Objects/bytes_methods.o Objects/bytearrayobject.o 
Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/cobject.o 
Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o 
Objects/enumobject.o Objects/exceptions.o Objects/genobject.o 
Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o 
Objects/funcobject.o Objects/intobject.o Objects/iterobject.o 
Objects/listobject.o Objects/longobject.o Objects/dictobject.o 
Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o 
Objects/object.o Objects/obmalloc.o Objects/rangeobject.o Objects/setobject.o 
Objects/sliceobject.o Objects/stringobject.o Objects/structseq.o 
Objects/tupleobject.o Objects/typeobject.o Objects/weakrefobject.o 
Objects/unicodeobject.o Objects/unicodectype.o
ar rc libpython2.7.a Python/_warnings.o Python/Python-ast.o Python/asdl.o 
Python/ast.o Python/bltinmodule.o Python/ceval.o Python/compile.o 
Python/codecs.o Python/errors.o Python/frozen.o Python/frozenmain.o 
Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o 
Python/getplatform.o Python/getversion.o Python/graminit.o Python/import.o 
Python/importdl.o Python/marshal.o Python/modsupport.o Python/mystrtoul.o 
Python/mysnprintf.o Python/peephole.o Python/pyarena.o Python/pyctype.o 
Python/pyfpe.o Python/pymath.o Python/pystate.o Python/pythonrun.o 
Python/random.o Python/structmember.o Python/symtable.o Python/sysmodule.o 
Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o 
Python/dtoa.o Python/formatter_unicode.o Python/formatter_string.o 
Python/dynload_shlib.o   Python/thread.o
ar rc libpython2.7.a Modules/config.o Modules/getpath.o Modules/main.o 
Modules/gcmodule.o 
ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  
Modules/zipimport.o  Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython2.7.a
./Modules/makexp_aix Modules/python.exp . libpython2.7.a;  xlc  
-Wl,-bE:Modules/python.exp -lld -o python \
Modules/python.o \
libpython2.7.a -ldl  -lpthread   -lm  
Makefile:485: recipe for target 'python' failed

more details...

michael@x071:[/data/prj/aixtools/python/python-2.7.11]make
./Modules/makexp_aix Modules/python.exp . libpython2.7.a;  xlc  
-Wl,-bE:Modules/python.exp -lld -o python \
Modules/python.o \
libpython2.7.a -ldl  -lpthread   -lm  
ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o]
An RLD for section 2 (.data) refers to symbol 0,
but the storage class of the symbol is not C_EXT or C_HIDEXT.
ld: 0711-596 SEVERE ERROR: Object libpython2.7.a[ceval.o]
An RLD for section 2 (.data) refers to symbol 0,
but the storage class of the symbol is not C_EXT or C_HIDEXT.

This is, best guess, an error for 125 symbols...

michael@x071:[/data/prj/aixtools/python/python-2.7.11]nohup make | egrep "^ld" 
| wc -l

Obviously, if the ceval.o member is removed it cannot complete - BUT - I hope 
it provides sufficient info that someone may know what I should try next.

michael@x071:[/data/prj/aixtools/python/python-2.7.11]ar d libpython2.7.a 
ceval.o
michael@x071:[/data/prj/aixtools/python/python-2.7.11]make V=1
./Modules/makexp_aix Modules/python.exp . libpython2.7.a;  xlc  
-Wl,-bE:Modules/python.exp -lld -o python \
Modules/python.o \
libpython2.7.a -ldl  -lpthread   -lm  
ld: 0711-317 ERROR: Undefined symbol: ._PyEval_SliceIndex
ld: 0711-317 ERROR: Undefined symbol: .PyEval_SaveThread
ld: 0711-317 ERROR: Undefined symbol: .PyEval_RestoreThread
ld: 0711-317 ERROR: Undefined symbol: _PyEval_SliceIndex
ld: 0711-317 ERROR: Undefined symbol: _Py_CheckRecursionLimit
ld: 0711-317 ERROR: Undefined symbol: ._Py_CheckRecursiveCall
ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetFuncName
ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetFuncDesc
ld: 0711-317 ERROR: Undefined symbol: .PyEval_CallObjectWithKeywords
ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetRestricted
ld: 0711-317 ERROR: Undefined symbol: .PyEval_GetGlobals
ld: 0711-317 ERROR: Undefined symbol: _Py_Ticker
ld: 0711-317 ERROR: Undefined symbol: _Py_CheckInterval
ld: 0711-317 ERROR: Undefined symbol: PyEval_GetCallStats
ld: 0711-317 ERROR: Undefined symbol: .PyEval_ReleaseLock
ld: 0711-317 ERROR: Undefined symbol: .PyEval_InitThreads
ld: 0711-317 ERROR: Undefined 

[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread David Edelsohn

David Edelsohn added the comment:

Don't use XLC.  It may relate to using -Wl option, which is a GCC option.

--

___
Python tracker 

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



[issue26466] cannot build python 2.7.11 on AIX

2016-03-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue26465] Upgrade OpenSSL shipped with python installers

2016-03-01 Thread Alex Gaynor

New submission from Alex Gaynor:

https://openssl.org/news/secadv/20160301.txt

--
keywords: security_issue
messages: 261052
nosy: alex, paul.moore, steve.dower, tim.golden, zach.ware
priority: critical
severity: normal
status: open
title: Upgrade OpenSSL shipped with python installers
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2016-03-01 Thread Sam Ferencik

Sam Ferencik added the comment:

Thanks for the analysis. I agree with you. If there's much push-back, maybe we 
could introduce an alternative interface, i.e. let get_platform() do its thing, 
deprecate it, and introduce something like get_interpreter_platform().

--

___
Python tracker 

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2016-03-01 Thread Michael Felt

Michael Felt added the comment:

while reading to learn...

FYI: AIX does not return even a hint of the underlying platform (assumption is 
probably 64-bit) - but the value of the interpreter is anyone's guess

root@x064:[/data/prj/aixtools/python/python-2.7.10]python
Python 2.7.10 (default, Mar  1 2016, 12:55:35) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.util
>>> distutils.util.get_platform()
'aix-5.3'
>>> import os
>>> os.uname()
('AIX', 'x064', '3', '5', '00XX')


Going through the rest of the preceding messages:
a) platform.architecture() - seems accurate for AIX, is import so expensive 
that it is not preferred?
>>> import platform
>>> platform.architecture()
('32bit', '')

b) sys.maxsize < 2**16 is a good hint, but it is possible to have a 64-bit int 
with only 32-bit pointers - based on assumption!
>>> import os, sys
>>> sys.maxsize
2147483647
>>> 2**32
4294967296L
>>> 2**31
2147483648L

> If your wording is correct, and get_platform() really is used to determine 
> "the
> python being used," then we could actually be improving things by fixing this.
> Currently, get_platform() doesn't tell you the bitness of the *python* being
> used, but the bitness of the *OS* being used (the two of which only differ on
> 32-on-64).

So, it seems get_platform() does not have a uniform result that could ever be 
parsed by internal or external modules. It is always dependent on something 
external to python (e.g., uname() output).

IMHO: determining and adding the python bitness, as MacOS has done (i.e., I 
assume it is either (32-bit) or (64-bit) at the end) is a move forward - and I 
would be willing to submit a couple of somethings so that that value could be 
determined - leave it to a committer to decide what makes best sense.

Of course, it is "sad" if it breaks existing things, but being non-uniform as 
it is worse (imho :smile:)

--
nosy: +Michael.Felt

___
Python tracker 

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



[issue26464] str.translate() unexpectedly duplicates untranslated characters

2016-03-01 Thread Ben Knight

New submission from Ben Knight:

Python 3.5.1 x86-64, Windows 10

I created a translation map that translated some characters to None and others 
to strings and found that in some cases str.translate() will duplicate one of 
the untranslated characters in the returned string.

How to reproduce:

table = str.maketrans({'a': None, 'b': 'cd'})
'axb'.translate(table)

Expected result:

'xcd'

Actual result:

'xxcd'

Mapping 'a' to '' instead of None will produce the desired effect.

--
messages: 261049
nosy: ben.knight
priority: normal
severity: normal
status: open
title: str.translate() unexpectedly duplicates untranslated characters
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



[issue26463] asyncio-related (?) segmentation fault

2016-03-01 Thread Nicholas Chammas

Nicholas Chammas added the comment:

Thanks for the tip. Enabling the fault handler reveals that the crash is 
happening from the Cryptography library. I'll move this issue there.

Thank you.

--
resolution:  -> not a bug
status: open -> closed
Added file: http://bugs.python.org/file42055/faulthandler-stacktrace.txt

___
Python tracker 

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



[issue26167] Improve copy.copy speed for built-in types (list/set/dict)

2016-03-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

If there are no other comments, I'm going to commit the patch in short time.

--

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-03-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I used the code from fasta and regex-dna tests almost without changes. I.e. one 
part create the data in standard FASTA format (with 60-character lines and 
headers), and other part parses this format. The code can be simple if generate 
and consume raw data.

As for the quality of the code, tested code is pretty simple and enough 
pythonic. Yes, using replace() is more idiomatic and faster, but we are testing 
regular expressions. bytes.translate() doesn't work with dict, and 
str.translate() is slower than replace() or re.sub().

The code for generating test data is not the kind of the code that should be 
used in tutorials. It is highly optimized code that uses different optimization 
tricks that could be hard to understand without comments. But nothing 
unpythonic. It can be simplified if avoid formatting the data in standard FASTA 
format.

> I would add another kind of question: is it stressing something useful that 
> isn't already stressed by the two other regex benchmarks we already have?

Yes, it is. The regex_v8 benchmark is 2x faster with regex than with re. But 
the regex_dna benchmark is 1.6x slower with regex than with re. Thus these 
tests are stressing different aspects of regular expressions.

It may be worth also to test regular expressions with unicode strings. I expect 
some difference with latest Python and earlier 3.x and 2.7. The question is how 
to do this? Add a special option to switch between bytes and unicode (as 
--force_bytes in regex_effbot), or just run tests for bytes and unicode 
sequentially and add results?

--

___
Python tracker 

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



[issue26463] asyncio-related (?) segmentation fault

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

Please try to get the Python stacktrace on the segfault using the faulthandler 
module: add faulthandler.enable() call at the beginning of your application.

https://docs.python.org/dev/library/faulthandler.html

I suspect a bug in your C code, not in asyncio. asyncio is written in pure 
Python.

--

___
Python tracker 

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



[issue23921] Standardize documentation whitespace, formatting

2016-03-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

James, could you please update your patch to address Martin's comments? In 
general the patch LGTM and I hope to commit it in short time.

--
nosy: +georg.brandl
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26457] Error in ipaddress.address_exclude function

2016-03-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue26457] Error in ipaddress.address_exclude function

2016-03-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6d6c0a7b71f5 by Serhiy Storchaka in branch '3.5':
Issue #26457: Fixed the subnets() methods in IP network classes for the case
https://hg.python.org/cpython/rev/6d6c0a7b71f5

New changeset c092148a1b55 by Serhiy Storchaka in branch 'default':
Issue #26457: Fixed the subnets() methods in IP network classes for the case
https://hg.python.org/cpython/rev/c092148a1b55

--
nosy: +python-dev

___
Python tracker 

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



[issue26457] Error in ipaddress.address_exclude function

2016-03-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM. I have wrote similar patch but with different tests.

--
assignee:  -> serhiy.storchaka
stage: needs patch -> commit 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