[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

The "removed_modules.patch" applied cleanly on the Python 3.6.0b2 sources 
downloaded from:

https://www.python.org/ftp/python/3.6.0/Python-3.6.0b2.tar.xz

and worked SUCCESSFULLY 

The environment is the same as in my last post

Attached please find the build logs and the config logs.

Please let me know if there is any further tests that you would like me to 
perform. Thank you

--
Added file: 
http://bugs.python.org/file45111/python_3_6_0b2_remove_modules.build.log

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Changes by Benny K J :


Added file: 
http://bugs.python.org/file45112/python_3_6_0b2_remove_modules.config.log

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Changes by Benny K J :


Added file: 
http://bugs.python.org/file45110/python_3_5_2_remove_modules.config.log

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for the response and really appreciate the quick patch.

The "removed_modules.patch" applied cleanly on the Python sources downloaded 
from:

https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz

and worked SUCCESSFULLY on HOST:

Ubuntu 16.04 LTS

Linux ip-172-31-16-99 4.4.0-28-generic #47-Ubuntu SMP Fri Jun 24 10:09:13 UTC 
2016 x86_64 x86_64 x86_64 GNU/Linux

for CROSS COMPILING Python 3.5.2 for ARM (armhf) using

Toolchain: gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf

attached please find the logs.

I'll now go ahead and try it on the 3.6 sources and update this thread

--
Added file: 
http://bugs.python.org/file45109/python_3_5_2_remove_modules.build.log

___
Python tracker 

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



[issue28453] SSLObject.selected_alpn_protocol() not documented

2016-10-15 Thread Alex Grönholm

New submission from Alex Grönholm:

the ssl.SSLObject class supports selected_alpn_protocol() like ssl.SSLSocket, 
but it is not mentioned on the list of supported methods.

--
assignee: christian.heimes
components: SSL
messages: 278739
nosy: alex.gronholm, christian.heimes
priority: normal
severity: normal
status: open
title: SSLObject.selected_alpn_protocol() not documented
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



[issue26865] Meta-issue: support of the android platform

2016-10-15 Thread Ethan Smith

Changes by Ethan Smith :


--
nosy: +Ethan Smith

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-15 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file45108/testPatches.py

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-10-15 Thread Oren Milman

Oren Milman added the comment:

Sorry for taking so long to come up with a patch..

 proposed changes 
1. in Python/getargs.c in seterror, the following patches:
- add a parameter 'p_format_code' - a pointer to the format code
  whose conversion failed.
- replace the error message of the OverflowError with
  '{fname}() argument out of range' in case all of the following are
  true:
* PyErr_Occurred() and the exception is an OverflowError.
* The PyArg_* function received a format ending with a ':'
  (i.e. seterror's fname argument is not NULL).
* The error occurred during a conversion to a C integer type
  which might overflow, i.e. one of the format codes 'bhilLn'.

  With these patches, inconsistent messages could often be fixed by merely
  appending ':' to the format argument in a call to a PyArg_*
  function.

  Furthermore, Some inconsistent messages are actually fixed by these
  patches alone.
  That is because there are already many calls to PyArg_* functions with a
  format ending with ':'. Some of them are followed by more
  checks of the parsed arguments, which might result in raising an
  OverflowError/ValueError with an inconsistent error message.
  (e.g. in Modules/itertoolsmodule.c, product_new already calls
  PyArg_ParseTupleAndKeywords with the format "|n:product", so with these
  patches, in case we do 'itertools.product('a', repeat=1 << 1000)', the
  error message would be 'product() argument out of range').

  Also, ISTM this patch is helpful, regardless of this issue (#15988).
  In case a PyArg_* function raises an OverflowError (because a conversion
  to some C integer type failed), knowing which function called the
  PyArg_* function would probably prove more helpful to a user (than
  knowing which C type Python failed to convert to, and whether the
  conversion failed because the number to convert was too large or too
  small).

  I decided to put the patch inside seterror, because (aside from its
  name,) it is always called after a failure of convertitem (which is the
  only caller of convertsimple).

2. in various files:
- change some OverflowError/ValueError messages for more clarity, e.g.
  replace 'unsigned byte integer is greater than maximum' with
  'Python int too large to convert to C unsigned char'.
- add code to "catch" OverflowError/ValueError errors, to prevent
  raising inconsistent error messages
- append ':' to formats passed to PyArg_* functions, to utilize
  the first proposed change (to automatically "catch"
  OverflowError/ValueError errors).

3. in Lib/tests - I was already writing tests for my patches, so I guessed
  I should add some of them (the basic boundary checks) to Lib/tests (in
  case they didn't already exist). I ran into some issues here:
- test_pickle - I didn't manage to create an int large enough to test
  my patch for save_long in Modules/_pickle.c (and so I didn't add any
  test to test_pickle).
- test_stat - I didn't find a way to determine the size of mode_t on
  the current platform, except for Windows (so the test I added is
  incomprehensive).

4. in Objects/longobject.c, make some messages more helpful (as mentioned
  in the last message I posted here).


 diff 
The proposed patches diff file is attached.


 tests 
I wrote an ugly script to test my patches, and ran it on my Windows 10 and
Ubuntu 16.04 64-bit VM. The script is attached, but it might fail on another
platform.
  - Note that the script I wrote has (among others) a test for
'select.devpoll'. I couldn't run it, as I don't have a Solaris machine,
but the test is identical to that of 'select.poll', so it should run
smoothly on a Solaris machine. Theoretically.
(Each test in my script verifies the exception's error message, and not only
which exception was raised, so ISTM these kind of tests don't fit in
Lib/tests. Please let me know if you think otherwise.)

In addition, I ran 'python_d.exe -m test -j0' (on my 64-bit Windows 10 and
Ubuntu VM) with and without the patches, and got quite the same output. (That
also means my new tests in various files in Lib/tests have passed.)


##

Note that the inconsistent messages my patches fix are only those I found
while going over each 'PyExc_OverflowError' in the codebase (in *.h and *.c
files).
However, I would probably find another bunch of inconsistent messages when I
go over each 'PyExc_ValueError' in the codebase.

I would be happy to do that, but I am afraid I won't have time to (at least)
until next June.

--
keywords: +patch
Added file: 

[issue27815] Make SSL suppress_ragged_eofs default more secure

2016-10-15 Thread Martin Panter

Martin Panter added the comment:

Patch v2 also adds a new attribute to context objects. With this I can work 
around my Google server bug:

context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
context.suppress_ragged_eofs = True
handler = urllib.request.HTTPSHandler(context=context)
urlopen = urllib.request.build_opener(handler).open
urlopen(Request(url="https://accounts.google.com/o/oauth2/token;, ...))

--
Added file: http://bugs.python.org/file45106/ragged-eofs.v2.patch

___
Python tracker 

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



[issue28441] sys.executable is ambiguous on Cygwin without .exe suffix

2016-10-15 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

This patch has impact to end user, thus I don't agree to apply as far as Cygwin 
to avoid user surprise.
I think to need a consistency between other platforms having executable suffix 
(e.g. MSYS2), and also the patch needs short documentation of changing behavior 
to description for sys.executable.

--

___
Python tracker 

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



[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-15 Thread Martin Panter

Martin Panter added the comment:

I still think something is closing your socket object. I cannot see what it is 
from the code you posted though. If you update the print() call, I expect you 
will see that it is closed, and the file descriptor is set to -1:

print("sock_err @ ", msg[1], msg[1]._closed, msg[1].fileno())  # Expect True, -1

--

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-10-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

print in Python 2 doesn't add a space after whitespace characters except a 
space ('\t', '\n', '\r', etc).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-10-15 Thread Malthe Borch

Malthe Borch added the comment:

You're right. The trailing comma just suppresses the newline. I updated the 
patch.

--
Added file: 
http://bugs.python.org/file45105/0001-Allow-make-to-be-run-under-Python-3.patch

___
Python tracker 

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



[issue28143] ASDL compatibility with Python 3 system interpreter

2016-10-15 Thread Martin Panter

Martin Panter added the comment:

Are you sure about adding the space after tab? I am no Python 2 expert, but I 
don’t see it:

$ python2 -c 'print "\t", ""' | cat -A
^I$

Anyway, I’m not happy applying this patch unless it is clear that raising the 
Python version required to rebuild ASDL stuff is okay in the 2.7 branch. Maybe 
a query to the python-dev mail list might help.

--

___
Python tracker 

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



[issue28452] Remove _asyncio._init_module function

2016-10-15 Thread INADA Naoki

New submission from INADA Naoki:

_asyncio._init_module() looks ugly.
This patch imports external dependency when importing _asyncio.

--
components: asyncio
files: asyncio-speedup-refactoring.patch
keywords: patch
messages: 278731
nosy: gvanrossum, inada.naoki, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Remove _asyncio._init_module function
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45104/asyncio-speedup-refactoring.patch

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The attached patch fixes the problem and allows cross-building the extension 
modules independently of the configuration of the native interpreter that may 
have set some modules to be statically built. The patch also prints now the 
list of modules that are detected by setup.py and configured in one of the 
Setup files to be statically built into the interpreter.

So you don't need to build from scratch a native interpreter anymore. Can you 
please test the patch using the Ubuntu interpreter for the cross-build and 
check that the extension modules are correctly built now.

It's my turn to thank you for your reports and your tests and reactivity that 
are very helpful in fixing this problem :)

--
keywords: +patch
Added file: http://bugs.python.org/file45103/removed_modules.patch

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Neil Girdhar

Neil Girdhar added the comment:

"As a result of this, *both* implementations include a conditional check for a 
more derived metaclass in their namespace preparation logic, as well as an 
unconditional call to that metaclass derivation logic from type_new if the 
calculated metaclass is either type itself, or a subclass that calls up to 
super().__new__."

I don't see why that's necessary.  Either you should have the check in one 
place, or else have two equivalent checks.  Right now, the Python library is 
confusingly checking a subset of cases (when isinstance(meta, type)).  I 
suggest that you have the Python library check the entire set of cases so that 
the raised exception shows up in the right place.

--

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Neil Girdhar

Neil Girdhar added the comment:

>From your comment:

>>> MyDerivedDynamic = new_class("MyDerivedDynamic", (MyClass,), 
>>> dict(metaclass=metaclass_callable))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.5/types.py", line 57, in new_class
return meta(name, bases, ns, **kwds)
  File "", line 2, in metaclass_callable
TypeError: metaclass conflict: the metaclass of a derived class must be a 
(non-strict) subclass of the metaclasses of all its bases

This is in the wrong place.  It should be tripping the exception you defined in 
Lib/types.py.  (It will do that if you replace metaclass_callable with 
OtherMetaclass.)

--

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Neil Girdhar

Neil Girdhar added the comment:

The documentation suggests that you can have a metaclass that does is not the 
"most derived metaclass" provided you specify one that is not an instance of 
type.  This doesn't work in CPython, so I would suggest fixing the 
documentation using the text I provided.

After that, it should be clear that there's no reason for "if isinstance(meta, 
type):" in the code, and the Python code should be restructured.

The point is that these two functions drifted apart somewhere around Python 3, 
and they need to be brought back together.  I only discovered this because it 
was possible in Python 2 to have a non-type metaclass that is not the most 
derived metaclass.  That has disappeared in CPython 3, except from the 
documentation and Lib.

--

___
Python tracker 

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



[issue28451] pydoc.safeimport() raises ErrorDuringImport() if __builtin__.__import__ is monkey patched

2016-10-15 Thread Joon-Kyu Park

New submission from Joon-Kyu Park:

`pydoc.safeimport()` should return `None` if the module isn't found.

If Python's default `__import__` is monkey patched, (e.g., by using gevent)
the function misbehaves. According to the current implementation,
the function returns `None` by checking the only last entry of the traceback
if `ImportError` is thrown during calling `__import__()`.

If `__import__` is monkey patched, extra entries can be mixed into the
original traceback when `ImportError` is raised. In the case when the module
is not found, `ErrorDuringImport` is being raised rather than returning `None`
after failing checking the traceback because current implementation only
checks the last traceback entry.

The important thing is to check whether `ImportError` is raised inside
`safeimport()`, I think it's okay to check the whole traceback entries
instead of checking the only last item.

Please check the attached patch which I suggest. Thank you.

--
components: Library (Lib)
files: pydoc.patch
keywords: patch
messages: 278726
nosy: Joon-Kyu Park
priority: normal
severity: normal
status: open
title: pydoc.safeimport() raises ErrorDuringImport() if __builtin__.__import__ 
is monkey patched
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file45102/pydoc.patch

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

I've confirmed that the suggested steps works fine on Ubuntu 14.04 as well as 
16.04 versions

standard procedure for cross-compilation:
* Configure the python source, for example update Modules/Setup.
* Build python natively out of the source tree [1].
* Set the new interpreter first on the PATH.
* Cross-build python out of the same source tree, in another directory.

Thanks a lot for the support.

Could you please comment if we could add these instructions to the README file 
under the Build Instructions. I'll make a a small patch for updating the 
documentation.

--

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-15 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed

___
Python tracker 

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



[issue28442] tuple(a list subclass) does not iterate through the list

2016-10-15 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution: fixed -> out of date
stage:  -> resolved

___
Python tracker 

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2016-10-15 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Ned Deily, I added you because you are in the expert for the OSX platform.

--
assignee:  -> ned.deily

___
Python tracker 

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



[issue25571] Improve the lltrace feature with the Py_Debug mode

2016-10-15 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I have to update my patch to python-3.7, I will provide a patch asap.

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for the support and the detailed explanation on why the native python 
is necessary.

I'm now able to successfully compile all the extension modules on an Ubuntu 
Machine where there isn't any Python packages installed.

I'll go ahead and compile the python on the default Ubuntu 16.04 which has both 
python3 and python2.7. I'll update this thread with my results.

The below steps has been followed:


---
Building Python 3.5.2 natively for x86_64 HOST
---
./configure --enable-shared --disable-ipv6 --prefix=/opt/python3

make

sudo make install 


export PATH=/opt/python3/bin:$PATH

#this is a work around for the missing library error, needs to find a better 
solution
sudo ln -sf /opt/python3/lib/libpython3.5m.so.1.0 /usr/lib/libpython3.5m.so.1.0
sudo ldconfig

---
#Cros-compiling for ARM
---
make distclean

CONFIG_SITE=config.site CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ 
AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib 
READELF=arm-linux-gnueabihf-readelf CFLAGS="-I${CROSS_PATH}/usr/include" 
LDFLAGS="-L${CROSS_PATH}/usr/lib" CPPFLAGS="-I${CROSS_PATH}/usr/include" 
./configure --enable-shared --host=arm-linux --build=x86_64-linux-gnu 
--disable-ipv6 --prefix=/opt/arm-linux-gnueabihf-python

make

sudo PATH=/opt/python3/bin:$PATH make install


It would be quite helpful if the extension modules are not removed silently. 
Unfortunately I do not have the know-how how to do this but would like to test 
it once someone makes available.

Once again thanks a lot for the support all through out the day. I'll revert 
back with the results of my testing in a while.

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-15 Thread Robin Becker

Robin Becker added the comment:

After some searching I tried adding -std=gnu99 and the config goes through OK, 
but running make produces


[root@d3cce9786c2e Python-3.6.0b2]# make -j2
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -Wformat -fno-gnu89-inline -std=gnu99   -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   -I. 
-I./Include-DPy_BUILD_CORE -o Programs/python.o ./Programs/python.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -Wformat -fno-gnu89-inline -std=gnu99   -std=c99 -Wextra 
-Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers   -I. 
-I./Include-DPy_BUILD_CORE -o Parser/acceler.o Parser/acceler.c
/tmp/cc3Mfloe.s: Assembler messages:
/tmp/cc3Mfloe.s:1575: Error: symbol `stat64' is already defined
/tmp/cc3Mfloe.s:1595: Error: symbol `lstat64' is already defined
/tmp/cc3Mfloe.s:1615: Error: symbol `fstat64' is already defined
/tmp/cc3Mfloe.s:1635: Error: symbol `fstatat64' is already defined
make: *** [Programs/python.o] Error 1
make: *** Waiting for unfinished jobs
/tmp/ccOoXPte.s: Assembler messages:
/tmp/ccOoXPte.s:1575: Error: symbol `stat64' is already defined
/tmp/ccOoXPte.s:1595: Error: symbol `lstat64' is already defined
/tmp/ccOoXPte.s:1615: Error: symbol `fstat64' is already defined
/tmp/ccOoXPte.s:1635: Error: symbol `fstatat64' is already defined
make: *** [Parser/acceler.o] Error 1
[root@d3cce9786c2e Python-3.6.0b2]#

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The cross-build uses a native python to run setup.py to build the extension 
modules, and to run 'python -S -m sysconfig --generate-posix-vars' and to byte 
compile the modules from the standard library. So you do need a native python. 
That is why you should first build it natively, set the PATH so that the 
cross-build can find it and use it, and then run the cross-build.

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

@Xavier de Gaye : Thanks a lot for helping. 

Unfortunately I didn't notice your last post (Date: 2016-10-15 11:13). Kindly 
ignore my last quires on the native Python. 

I'll follow your steps and report back the results asap.

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

To eliminate the issues introduced by the native python on the Ubuntu 16.04 
host, I've set up a new Ubuntu Host with all the native python packages removed.

But now when I try to build the make fails saying:

arm-linux-gnueabihf-gcc -shared 
-L/home/ubuntu/workspace/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib
  -Wl,--no-as-needed -o libpython3.so -Wl,-hlibpython3.so libpython3.5m.so
arm-linux-gnueabihf-gcc 
-L/home/ubuntu/workspace/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc/usr/lib
  -Xlinker -export-dynamic -o python Programs/python.o -L. -lpython3.5m 
-lpthread -ldl  -lpthread -lutil   -lm  
_PYTHON_PROJECT_BASE=/home/ubuntu/workspace/python/Python-3.5.2 
_PYTHON_HOST_PLATFORM=linux-arm PYTHONPATH=./Lib:./Lib/plat-linux python -S -m 
sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
/bin/sh: 1: python: not found
generate-posix-vars failed
Makefile:598: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1


Looking at the configure.log it complains of missing python as well:

python: not-found! cannot run $(srcdir)/Parser/asdl_c.py

Could you please comment if it is not possible to build python3 without first 
installing a native python on the build machine?

Maybe I have not set all the options to the ./configure correctly (e.g 
_PYTHON_HOST_PLATFORM).

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
versions: +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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

So the problem is that setup.py in build_extensions() does not build the 
extensions that have been already built statically into the native Ubuntu 
interpreter.

The solution is to build first natively from source python3.5 and set the PATH 
environment variable so that the newly built interpreter is fisrt on the PATH, 
before the one distributed by Ubuntu. And then to run the cross-build.

I think that should be the standard procedure for cross-compilation:
* Configure the python source, for example update Modules/Setup.
* Build python natively out of the source tree [1].
* Set the new interpreter first on the PATH.
* Cross-build python out of the same source tree, in another directory.

Unless someone has a better idea to fix this problem, I will propose a patch so 
that extension modules that are removed by build_extensions(), are not removed 
anymore silently.

[1] Out of the source tree:
For example, assuming the source tree is at 'src' and the current working 
directory is its parent, to build python in the 'build' directory without 
modifying any file in the 'src' directory:
$ mkdir build
$ cd build
$ $(cd ../src && pwd)/configure arg1 arg2 ... && make

--

___
Python tracker 

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



[issue28450] Misleading/inaccurate documentation about unknown escape sequences

2016-10-15 Thread Lele Gaifax

New submission from Lele Gaifax:

Python 3.6+ is stricter about escaped sequences in string literals.

The documentation need some improvement to clarify the change: for example 
https://docs.python.org/3.6/library/re.html#re.sub first says that “Unknown 
escapes such as \& are left alone” then, in the “Changed in” section below, 
states that “[in Py3.6] Unknown escapes consisting of '\' and an ASCII letter 
now are errors”.

When such changes are made, usually the documentation reports the 
“new”/“current” behaviour, and the history section mention when and how some 
detail changed.

See this thread for details: 
https://mail.python.org/pipermail/python-list/2016-October/715462.html

--
assignee: docs@python
components: Documentation
messages: 278716
nosy: docs@python, lelit
priority: normal
severity: normal
status: open
title: Misleading/inaccurate documentation about unknown escape sequences
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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-15 Thread Robin Becker

Robin Becker added the comment:

benjamin.peterson: I tried adding that option -fno-gnu89-inline conditionally 
for the 3.6.0b2 build, but it goes wrong in config with an error

configure:3913: $? = 4
configure:3933: checking whether the C compiler works
configure:3955: gcc -Wformat -fno-gnu89-inline   conftest.c  >&5
cc1: error: -fno-gnu89-inline is only supported in GNU99 or C99 mode

The full docker output is here

https://www.reportlab.com/media/manylinux-docker-run-output-2.txt

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for your response

Yes. There is a python 3.5 that is installed on the system (from apt-get)


benny@whachamacallit:~$ which python3
/usr/bin/python3


benny@whachamacallit:~$ python3
Python 3.5.2 (default, Sep 10 2016, 08:21:44) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> 
>>> import sys
>>> 
>>> sys.builtin_module_names
('_ast', '_bisect', '_codecs', '_collections', '_datetime', '_elementtree', 
'_functools', '_heapq', '_imp', '_io', '_locale', '_md5', '_operator', 
'_pickle', '_posixsubprocess', '_random', '_sha1', '_sha256', '_sha512', 
'_signal', '_socket', '_sre', '_stat', '_string', '_struct', '_symtable', 
'_thread', '_tracemalloc', '_warnings', '_weakref', 'array', 'atexit', 
'binascii', 'builtins', 'errno', 'faulthandler', 'fcntl', 'gc', 'grp', 
'itertools', 'marshal', 'math', 'posix', 'pwd', 'pyexpat', 'select', 'spwd', 
'sys', 'syslog', 'time', 'unicodedata', 'xxsubtype', 'zipimport', 'zlib')
>>>

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

I assume from your logs that a native (not the cross-built one) python3.5 
already exists and is on your PATH.
What is the value of sys.builtin_module_names as given by this native python3.5 
interpreter ?

--

___
Python tracker 

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



[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +lars.gustaebel
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.4

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This new patch fixes the following:
* Use BASECFLAGS instead of CCSHARED.
* '-march=armv7-a' is not set in BASECFLAGS anymore as this is redundant: this 
option is already set in the configure command line or is implicitly set by the 
the first component of the triple of the '-target' clang option.
* Do not set '-mthumb' as this is optional and may be set for the armv7 arch as 
well. Also this option crashes Python on armv5te when built with clang, issue 
27606.

--
Added file: http://bugs.python.org/file45101/build-flags_5.patch

___
Python tracker 

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



[issue28449] tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to open compressed tars?

2016-10-15 Thread Silver Fox

New submission from Silver Fox:

Seems all `tarfile.open` will try all compress method(including `raw`) in 
random order, and `ignore_zeros` also hide the error during detecting compress 
method. So `raw` is used if tested before the rigth compress method, which is 
wrong.

But there is no warning that the 2 args can not be used together in docs.

--
components: Library (Lib)
messages: 278711
nosy: Silver Fox
priority: normal
severity: normal
status: open
title: tarfile.open(mode = 'r:*', ignore_zeros = True) has 50% chance failed to 
open compressed tars?
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

please let me know if there is any additional steps I need to follow when 
building from the source downloaded from python.org

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for the response.

Yes I've downloaded the XZ compressed source from python.org

Based on your comment I've double checked the MD5 with

https://www.python.org/downloads/release/python-352/



benny@whachamacallit:~/Downloads$ md5sum Python-3.5.2.tar.xz
8906efbacfcdc7c3c9198aeefafd159e  Python-3.5.2.tar.xz

--

___
Python tracker 

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



[issue26851] android compilation and link flags

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

See also the clang cross compilation documentation at 
http://clang.llvm.org/docs/CrossCompilation.html.

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Your Setup file matches the one distributed with Python 3.5.2.
Did you get the Python source from https://www.python.org/ ?

--

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Nick Coghlan

Nick Coghlan added the comment:

(I'll also note that my final comment there is rather different from my first 
draft, as I almost forgot myself that the namespace preparation logic lives in 
__build_class__ rather than type_new. Class definitions can actually bypass 
type entirely, even in Python 3:

>>> def the_one_class(*args):
... return 1
... 
>>> class TheOne(metaclass=the_one_class): pass
... 
>>> TheOne
1

--

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Note: I'd be open to suggestions for comments in the pure Python implementation 
that would have helped you find its CPython counterpart in bltinmodule.c - it 
isn't immediately obvious from the current code that the actual __build_class__ 
code invoked by CPython's class statement is somewhere else entirely.

--

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Nick Coghlan

Nick Coghlan added the comment:

I'm not clear on what discrepancy you're referring to, as I get the same 
(expected) exception for both the class statement and the dynamic type creation:

>>> class MyDerived(MyClass, metaclass=metaclass_callable):
... pass
... 
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in metaclass_callable
TypeError: metaclass conflict: the metaclass of a derived class must be a 
(non-strict) subclass of the metaclasses of all its bases

>>> MyDerivedDynamic = new_class("MyDerivedDynamic", (MyClass,), 
>>> dict(metaclass=metaclass_callable))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.5/types.py", line 57, in new_class
return meta(name, bases, ns, **kwds)
  File "", line 2, in metaclass_callable
TypeError: metaclass conflict: the metaclass of a derived class must be a 
(non-strict) subclass of the metaclasses of all its bases

This is due to the fact that your custom metaclass function returns an instance 
of a subclass of type, so we end up in type_new to actually create the type, 
which fails the metaclass consistency check.

One of the subtle intricacies here is that, for class statements, the logic 
that corresponds to types.prepare_class in the Python implementation is 
actually in the __build_class__ builtin for the C implementation - when there's 
a custom metaclass that *doesn't* return a subclass of type, we don't end up 
running type_new at all.

As a result of this, *both* implementations include a conditional check for a 
more derived metaclass in their namespace preparation logic, as well as an 
unconditional call to that metaclass derivation logic from type_new if the 
calculated metaclass is either type itself, or a subclass that calls up to 
super().__new__.

Most relevant issues and commit history:

- last update to C implementation
  - http://bugs.python.org/issue1294232
  - https://hg.python.org/cpython/rev/c2a89b509be4
- addition of pure Python implementation
  - http://bugs.python.org/issue14588
  - https://hg.python.org/cpython/rev/befd56673c80

The test cases in those commits (particularly the first one) should help make 
it clear what is and isn't supported behaviour.

--

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-15 Thread INADA Naoki

Changes by INADA Naoki :


--
stage: commit review -> resolved

___
Python tracker 

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



[issue28437] Class definition is not consistent with types.new_class

2016-10-15 Thread Nick Coghlan

Changes by Nick Coghlan :


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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Attaching the modules/set-up for natively building on x86_64

--
Added file: http://bugs.python.org/file45100/setup_x86_x86

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for your response.

Please note that I haven't touched the Modules/Setup.local or Modules/Setup or 
the global variable `disabled_module_list` in setup.py

However I'm noticing that the math is commented in the Modules/Setup on both 
cross compiling on x86_64 for ARM as well as natively compiling on x86_64 for 
x86_64. But on the native build for x86_64 the math, socket, select are all 
build properly.

Attached please find the modules/setup file

--
Added file: http://bugs.python.org/file45099/setup_x86_arm

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-15 Thread Robin Becker

Robin Becker added the comment:

I'm not able to access my work computer, I'll try later today at home.

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Wierd. Modules like 'math', 'select' or '_socket' are added unconditionally in 
detect_modules() of setup.py. Did you disable modules in Modules/Setup.local or 
Modules/Setup or via the global variable `disabled_module_list` in setup.py?

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue28424] pkgutil.get_data() doesn't work with namespace packages

2016-10-15 Thread Nick Coghlan

Nick Coghlan added the comment:

For 3.4/5/6, I agree this is a documentation issue, where the data files need 
to be given a *non*-namespaced directory to live in. However, it's worth 
explicitly noting that subpackages of namespace packages can themselves be 
regular packages, so one possible solution is to do:

pkg_util.get_data('my_namespace.my_package_data', 'resourcename')

rather than storing the data directly at the namespace level.

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



[issue28428] Rename _futures module to _asyncio

2016-10-15 Thread INADA Naoki

Changes by INADA Naoki :


--
status: open -> closed

___
Python tracker 

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



[issue28428] Rename _futures module to _asyncio

2016-10-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9d06fdedae2b by INADA Naoki in branch '3.6':
Issue #28428: Rename _futures module to _asyncio.
https://hg.python.org/cpython/rev/9d06fdedae2b

New changeset c2f3b7c56dff by INADA Naoki in branch 'default':
Issue #28428: Rename _futures module to _asyncio. (merge from 3.6)
https://hg.python.org/cpython/rev/c2f3b7c56dff

--
nosy: +python-dev

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Could you please tell me if the decision to make the extension modules like 
math, socket, select etc taken in the configure step or is it left to the 
Makefile.

Also could you please give me some hints on where to look for on how this 
decision is made (e.g file name / function name.)

--

___
Python tracker 

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



[issue28092] Build failure for 3.6 on Centos 5.11

2016-10-15 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Any different results with CFLAGS="-fno-gnu89-inline"?

--

___
Python tracker 

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



[issue28444] Missing extensions modules when cross compiling python 3.5.2 for arm on Linux

2016-10-15 Thread Benny K J

Benny K J added the comment:

Thank you for the response.

I'm not too sure how to set the root directory for arm headers and libraries in 
the configure command line.

So I've tried the below, but still not all of the extensions modules was not 
build (e.g math, socket, select)

export 
CROSS_PATH=/home/benny/workspace/projects/webshield/src/dntl_ws/sw/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/../arm-linux-gnueabihf/libc


CONFIG_SITE=config.site CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ 
AR=arm-linux-gnueabihf-ar RANLIB=arm-linux-gnueabihf-ranlib 
READELF=arm-linux-gnueabihf-readelf CFLAGS="-I${CROSS_PATH}/usr/include" 
LDFLAGS="-L${CROSS_PATH}/usr/lib" CPPFLAGS="-I${CROSS_PATH}/usr/include" 
./configure --enable-shared --host=arm-linux --build=x86_64-linux-gnu 
--disable-ipv6 --prefix=/opt/python3

Attached please find the build log

--
Added file: http://bugs.python.org/file45098/python3.5.2_x86_host_arm_target.log

___
Python tracker 

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