[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: How about renaming sys.implementation._multiarch to sys.implementation.target_architecture and make it public? sys.androidapilevel() sounds too specific to me. -- ___ Python tracker

Re: compile error when using override

2016-12-01 Thread Steve D'Aprano
On Thu, 1 Dec 2016 05:26 pm, Ho Yeung Lee wrote: > import ast > from __future__ import division That's not actually your code. That will be a SyntaxError. Except in the interactive interpreter, "__future__" imports must be the very first line of code. > class A: >     @staticmethod >     def

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you have concrete example when not ignoring an OSError in _update causes an issue? This is needed for writing tests. -- components: +Library (Lib) nosy: +serhiy.storchaka ___ Python tracker

[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2016-12-01 Thread Michael Enßlin
New submission from Michael Enßlin: This issue was previously addressed and fixed here: http://bugs.python.org/issue1351692 When subclassing PrettyPrinter, overriding the format() method should allow users to define custom pretty-printers. However, for objects whose repr is short, format()

[issue28833] cross compilation of third-party extension modules

2016-12-01 Thread Matthias Klose
Matthias Klose added the comment: again, I don't think relying on a specific target path for a cross target is a good idea. and now deciding that the last possibility to use a target id to identify is better is internal doesn't make it better. I'd appreciate if we could sit together where

[issue28849] do not define sys.implementation._multiarch on Android

2016-12-01 Thread Matthias Klose
Matthias Klose added the comment: > An idea is renaming it to something like target_architecture > to make things clearer Yes, that was my intent, and I think it is the right solution. using $(MACHDEP)_$(MULTIARCH) in the sysconfigdata name and probably in other places was not a good idea

[issue28833] cross compilation of third-party extension modules

2016-12-01 Thread Matthias Klose
Matthias Klose added the comment: > Hum, you still need to provide the native python interpreter > with the _path_ to the -python-config executable that > can be anywhere on the file system No, it's found in the same path. No contradiction. > So I suggest we start with this patch as it works

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: Patch version: fix the "if (0)" to use the small stack allocated on the C stack. -- Added file: http://bugs.python.org/file45719/fastcalldict-3.patch ___ Python tracker

Fwd: Merge Two List of Dict

2016-12-01 Thread Nikhil Verma
Just editing the count it was from Indian place value notation. -- Forwarded message -- From: Nikhil Verma Date: Thu, Dec 1, 2016 at 12:44 PM Subject: Merge Two List of Dict To: python-list@python.org Hey guys What is the most optimal and pythonic

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This example is too artificial. But there is a real issue: opening read-only files in read mode. Currently this causes a PermissionError on closing. For backward compatibility flags 'r' and 'w' are ignored. I.e. opening with 'r' and 'w' creates a file if

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: > Note: Using a simple printf() in the C code, I noticed that it is not > uncommon that _PyFunction_FastCallDict() is called with an empty dictionary > for keyword arguments. Simplified Python example where _PyFunction_FastCallDict() is called with an empty

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "small_stack increases C stack consumption even for calls without keyword arguments. This is serious problem since we can't control stack overflow." This problem is not new and is worked around by Py_EnterRecursiveCall() macro which counts the depth

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Jonathan Ng
Jonathan Ng added the comment: #1 makes sense to be backported. On Thu, Dec 1, 2016 at 8:41 PM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > This example is too artificial. > > But there is a real issue: opening read-only files in read mode.

[issue28699] Imap from ThreadPool behaves unexpectedly

2016-12-01 Thread fiete
fiete added the comment: Since the only thing I know about the multiprocessing internals is what I just read in the source code trying to debug my imap_unordered call, I'll add the following example, not knowing whether this is already covered by everything you have until now. import

[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-01 Thread INADA Naoki
INADA Naoki added the comment: (reopen the issue to discuss about using Argument Clinic) -- resolution: rejected -> status: closed -> open ___ Python tracker

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0516f54491cb by Serhiy Storchaka in branch '2.7': Issue #28847: dubmdbm no longer writes the index file in when it is not https://hg.python.org/cpython/rev/0516f54491cb -- nosy: +python-dev ___ Python

[issue28855] Compiler warnings in _PyObject_CallArg1()

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 96245d4af0ca by Benjamin Peterson in branch 'default': fix _PyObject_CallArg1 compiler warnings (closes #28855) https://hg.python.org/cpython/rev/96245d4af0ca -- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open ->

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The first part is committed in 2.7. I'll commit it in 3.5-3.7 after releasing 3.6.0. -- versions: -Python 2.7 ___ Python tracker

[issue26861] shutil.copyfile() doesn't close the opened files

2016-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue28855] Compiler warnings in _PyObject_CallArg1()

2016-12-01 Thread Benjamin Peterson
Benjamin Peterson added the comment: It doesn't seem like the question is whether to use inline functions but whether to force all callers to cast. Your original code would work if you added all the casts in your static_inline.patch patch. -- ___

[issue28855] Compiler warnings in _PyObject_CallArg1()

2016-12-01 Thread Benjamin Peterson
Benjamin Peterson added the comment: (Sorry, I noticed and landed a fix before completely reading the issue.) -- ___ Python tracker ___

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset a37cc3d926ec by Serhiy Storchaka in branch '2.7': Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code. https://hg.python.org/cpython/rev/a37cc3d926ec -- nosy: +python-dev ___ Python

[issue28857] SyncManager and Main Process fail to communicate after reboot or stoping with Ctrl - C

2016-12-01 Thread Nagarjuna Arigapudi
New submission from Nagarjuna Arigapudi: "SyncManager" and "Main Process" and main process look at different directories and fail to communicate, causing shutdown of all process, immediately after start of program. This behavior is seen in both 2.7 and 3.5. The logging of 2.7 is more clear,

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Will commit to 3.5-3.7 after releasing 3.6.0. -- versions: -Python 2.7 ___ Python tracker ___

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2016-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +ethan.furman, serhiy.storchaka ___ Python tracker ___

Re: compile error when using override

2016-12-01 Thread Steve D'Aprano
On Fri, 2 Dec 2016 01:35 pm, Ho Yeung Lee wrote: > from __future__ import division > import ast > from sympy import * > x, y, z, t = symbols('x y z t') > k, m, n = symbols('k m n', integer=True) > f, g, h = symbols('f g h', cls=Function) > import inspect Neither ast nor inspect is used. Why

How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-01 Thread Juan C.
I'm a student and my university uses Moodle as their learning management system (LMS). They don't have Moodle Web Services enabled and won't be enabling it anytime soon, at least for students. The university programs have the following structure, for example: 1. Bachelor's Degree in Computer

Re: correct way to catch exception with Python 'with' statement

2016-12-01 Thread Steve D'Aprano
On Fri, 2 Dec 2016 11:26 am, DFS wrote: > On 12/01/2016 06:48 PM, Ned Batchelder wrote: >> On Thursday, December 1, 2016 at 2:31:11 PM UTC-5, DFS wrote: >>> After a simple test below, I submit that the above scenario would never >>> occur. Ever. The time gap between checking for the file's

[issue23507] Tuple creation is too slow

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, I'm referring to the crashing. The code that worked before your changes now are crashing. Please revert your changes and find a way to optimize a function calling without increasing stack consumption. -- resolution: fixed -> status: closed ->

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka versions: +Python 2.7, Python 3.5, Python 3.6 ___ Python tracker

Re: correct way to catch exception with Python 'with' statement

2016-12-01 Thread Steve D'Aprano
On Fri, 2 Dec 2016 11:26 am, DFS wrote: >> For most programs, yes, it probably will never be a problem to check >> for existence, and then assume that the file still exists.  But put that >> code on a server, and run it a couple of million times, with dozens of >> other processes also

<    1   2