[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-09 Thread Xiang Zhang

Xiang Zhang added the comment:

Attach a patch to fix this.

--
keywords: +patch
Added file: http://bugs.python.org/file43671/bytes_concat_overflow_check.patch

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman

Ethan Furman added the comment:

I need names.  `aenum` already has an `AutoNumberEnum` (the one from the docs, 
no magic) so I hate to use the same name for the stdlib version with different 
behavior.

So I either need a different name for the stdlib version, or a different name 
for the aenum version.

Any ideas?

Hmmm... maybe SequentialEnum for the aenum version...

--

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-07-09 Thread mostafa shahdadi

Changes by mostafa shahdadi :


--
components: +Installation, Interpreter Core, Library (Lib), Tests
type: compile error -> performance
versions: +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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-09 Thread INADA Naoki

INADA Naoki added the comment:

OK.  Here is current version.

--
Added file: http://bugs.python.org/file43670/futures.patch

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> I'm working on this.  Some bugs are fixed, but doesn't pass tests for now.

Thanks a lot!  I couldn't find time to finish this myself.  I can definitely 
help you and review the patch once it's ready.

> Yury, could you explain what the comment "This isn't a Future class; it's a 
> BaseFuture" means?

Unfortunately I don't remember :(

> Should I send pull request to github.com/python/asyncio?
Or should I post patch here?

Please post it here. AFAIK we haven't yet transitioned to the GitHub.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-09 Thread INADA Naoki

INADA Naoki added the comment:

Should I send pull request to github.com/python/asyncio?
Or should I post patch here?

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-09 Thread Terry J. Reedy

Terry J. Reedy added the comment:

https://stackoverflow.com/questions/38276691/tkinter-nameerror-only-when-running-script-from-shell
  same problem with filedialog.

--

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This should be fixed.

--
components: +Interpreter Core
stage:  -> needs patch

___
Python tracker 

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



[issue27474] Unify exception in _Py_bytes_contains for integers

2016-07-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--
assignee:  -> serhiy.storchaka
stage:  -> commit review

___
Python tracker 

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



[issue27274] [ctypes] Allow from_pointer creation

2016-07-09 Thread Eryk Sun

Eryk Sun added the comment:

If your goal is to get a bytes object, I don't see the point of creating an 
array. string_at is simpler and more efficient. 

If you really must create an array, note that simple pointers (c_void_p, 
c_char_p, c_wchar_p) need special handling. They don't have a `contents` 
attribute, and their _type_ is a string. 

Also, I think combining from_address and addressof is a bit convoluted. I think 
it's cleaner to implement this using an array pointer:

>>> ptr = POINTER(c_int)((c_int * 3)(1,2,3))
>>> arr = POINTER(ptr._type_ * 3)(ptr.contents)[0]
>>> arr[:]
[1, 2, 3]

This also keeps the underlying ctypes object(s) properly referenced:

>>> arr._b_base_
<__main__.LP_c_int_Array_3 object at 0x7fb28471cd90>
>>> arr._b_base_._objects['0']['1']
<__main__.c_int_Array_3 object at 0x7fb28477da60>

whereas using from_address creates an array that dangerously doesn't own its 
own data and doesn't keep a reference to the owner:

>>> arr2 = (ptr._type_ * 3).from_address(addressof(ptr.contents))
>>> arr2._b_needsfree_
0
>>> arr2._b_base_ is None
True
>>> arr2._objects is None
True

Let's create a larger array to ensure it's using an mmap region instead of the 
heap. This ensures a segfault when trying to access the memory block after it's 
deallocated:

>>> ptr = POINTER(c_int)((c_int * 10)(*range(10)))
>>> arr = (ptr._type_ * 10).from_address(addressof(ptr.contents))
>>> del ptr
>>> x = arr[:]
Segmentation fault (core dumped)

whereas using a dereferenced array pointer keeps the source data alive:

>>> ptr = POINTER(c_int)((c_int * 10)(*range(10)))
>>> arr = POINTER(ptr._type_ * 10)(ptr.contents)[0]
>>> del ptr
>>> x = arr[:]
>>> x[-5:]
[5, 6, 7, 8, 9]

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Hold on. It's weekend. I will review this when I am near a laptop again.

--Guido (mobile)

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

> Why can't `wrap_socket` be used for wrapping client sockets? 

TOOWTDI and create_connection.  

I suppose we could remove (unadvertise) this functionality from 
create_connection.  Then we'd have code bloat because backward compatibility.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Yury Selivanov

Yury Selivanov added the comment:

> wrap_socket implies that it's for wrapping client or server sockets, but it's 
> not. It's only for handling server sockets. Also, I prefer a name that 
> reflects goal, not mechanism.

> I think the name should be discussed over here: 
> https://bugs.python.org/issue27392.

Why can't `wrap_socket` be used for wrapping client sockets?  I think we can 
refactor asyncio to use it in 'create_connection', and maybe to accept new 
connections.

To my ear, 'asyncio.handle_connection' implies that asyncio will "handle" the 
connection, i.e. that asyncio itself would do more than just wrapping the 
socket and attaching a protocol instance.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

We need an executive (Guido) decision on the name of the new API. Yury wants 
wrap_socket.

I don't like wrap_socket because:

- It implies that it's for wrapping client and server sockets.
  (It shouldn't be for wrapping client sockets because TOOWTDI
   and create_connection.)

- I prefer names that are about goal rather than mechanism.

But I can live with anything.

I'll defer to Yury unless Guido voices an opinion.

--

___
Python tracker 

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



[issue27474] Unify exception in _Py_bytes_contains for integers

2016-07-09 Thread Xiang Zhang

New submission from Xiang Zhang:

Now, `sys.maxsize+1 in b'foo'` raises "TypeError: 'int' does not support the 
buffer interface" which seems weird. In such case, I don't think there is any 
difference between sys.maxsize+1 and 256. So I suggest make it emits the same 
exceptions as `256 in b'foo'`, "ValueError: byte must be in range(0, 256)".

--
files: _Py_bytes_contains.patch
keywords: patch
messages: 270058
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: Unify exception in _Py_bytes_contains for integers
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43668/_Py_bytes_contains.patch

___
Python tracker 

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



[issue27274] [ctypes] Allow from_pointer creation

2016-07-09 Thread Memeplex

Memeplex added the comment:

I have been happily using this helper function:

def c_array(*args):
if type(args[1]) is int:
ptr, size = args
return (ptr._type_ * size).from_address(ct.addressof(ptr.contents))
else:
c_type, buf = args
return (c_type * (len(buf) // ct.sizeof(c_type))).from_buffer_copy(buf)

For example:

c_array(ptr_obj, 10)

c_array(c_int, bytes_obj)

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman

Ethan Furman added the comment:

The problem with testing the type of object a name refers to outside the class 
is it then becomes more difficult to make that an Enum member:

class AddressType(Enum):
pobox
mailbox  # third-party po box
property

Having to assign a value to `property` pretty much negates the value of the 
magic.

I'll go with `_ignore_`.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-09 Thread INADA Naoki

INADA Naoki added the comment:

Passing all tests now.
Yury, could you explain what the comment "This isn't a Future class; it's a 
BaseFuture" means?

Should it be "_futures.Future" or "_futures.BaseFuture"?

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread John Hagen

John Hagen added the comment:

> What happens with `property`?
> 
> - `property` is looked up in the class namespace

Perhaps you've already considered this, I'm not intimately familiar with how 
classes are parsed and constructed but is it possible to determine if the 
object is a decorator?  It already determines to stop auto-numbering when it 
hits the first method, could it stop when it hits the first decorator or method?

Being able to use temporaries is an interesting side effect, but I feel like 
that would be used less often than a @staticmethod, @property, or @classmethod 
over a method, in which case it becomes a little more complex.

That being said, I think either solution is valid.

--

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-09 Thread Xiang Zhang

New submission from Xiang Zhang:

bytes_concat uses following code to check overflow:

size = va.len + vb.len;
if (size < 0): {
PyErr_NoMemory();
goto done;
}

This is wrong since signed ints overflow is undefined bahaviour.

But one point is that Python's Makefile defines -fwrapv with gcc and
clang. So I am not sure this needs to be changed or not. But in other
parts of Python code I don't see any overflow check like this. I only
see pre-calculated overflow checks.

--
messages: 270053
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
status: open
title: bytes_concat seems to check overflow using undefined behaviour

___
Python tracker 

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



[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-09 Thread Xiang Zhang

Changes by Xiang Zhang :


--
type:  -> behavior
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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman

Ethan Furman added the comment:

A standard feature of Enum is that either space separated strings or a list of 
strings is accepted any where either is.

_sunder_ names are the ones reserved for Enum use (such as _value_, _name_, and 
soon _order_ (for py2/py3 compatible code).

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

I like the new method better. Submit away!

--Guido (mobile)

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower

Steve Dower added the comment:

Got some digging done today and it looks like we're probably best to write our 
own drop handler. It can probably be embedded into the py.exe launcher, which 
will keep all the registration in the one file.

At worst, we should switch to {86C86720-42A0-1069-A2E8-08002B30309D} (same as 
EXE files - converts long/Unicode paths to short filenames).

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Jul 09, 2016, at 03:20 PM, Ethan Furman wrote:

>As far as I can tell there is only one "good" way around this:
>
>- store any names you don't want auto-numbered into an `_ignore_`
>  attribute (this only needs to be global and built-in names that
>  are used before the first method is defined)

Seems reasonable, though why not a dunder, e.g. __ignore__?

>_ignore_ = 'Period i'

Why space separated names inside a string instead of a sequence of strings?

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread Ethan Furman

Ethan Furman added the comment:

There is one wrinkle with auto-numbering.  Consider the following code:

class Color(AutoNumberEnum):
  red
  green
  blue
  @property
  def cap_name(self):
return self.name.upper()

What happens with `property`?

- `property` is looked up in the class namespace
- it's not found, so is given the number 4
- it's then called to handle `cap_name`
- an exception is raised

As far as I can tell there is only one "good" way around this:

- store any names you don't want auto-numbered into an `_ignore_`
  attribute (this only needs to be global and built-in names that
  are used before the first method is defined)

another option is to build a proxy around any found global/built-in objects and 
decide what to do based on whether those objects are immediately called, but 
that fails when the object is simply assigned for later use.

So, barring any other ideas to handle this problem, the above example should 
look like this:

class Color(AutoNumberEnum):
  _ignore_ = 'property'
  red
  green
  blue
  @property
  def cap_name(self):
return self.name.upper()

Another advantage of using ignore is the ability to have temporary variables 
automatically discarded:

  class Period(timedelta, Enum):
'''
different lengths of time
'''
_ignore_ = 'Period i'
Period = vars()
for i in range(31):
  Period['day_%d' % i] = i, 'day'
for i in range(15):
  Period['week_%d' % i] = i*7, 'week'
for i in range(12):
  Period['month_%d' % i] = i*30, 'month'
OneDay = day_1
OneWeek = week_1
def __new__(self, value, period):
  ...

and the final enumeration does not have the temp variables `Period` nor `i`.

Thoughts?

--

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-07-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> The list of locations where '/bin/sh' is hard coded in the standard library:

I have entered issue 27472.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-09 Thread Jim Fulton

Jim Fulton added the comment:

I'd still like to find a way to handle already accepted server sockets.

Can we decide on either:

- a server_side flag to create_connection or

- A new interface for handling an already accepted socket? I would
  call this handle_connection, but I'll take any name. :)

I'm fine with and willing to implement either alternative.

--

___
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-07-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

issue #27472: add the 'unix_shell' attribute to test.support

--
dependencies: +add the 'unix_shell' attribute to test.support

___
Python tracker 

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



[issue27472] add the 'unix_shell' attribute to test.support

2016-07-09 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
dependencies: +add the 'is_android' attribute to test.support

___
Python tracker 

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



[issue27472] add the 'unix_shell' attribute to test.support

2016-07-09 Thread Xavier de Gaye

New submission from Xavier de Gaye:

'/bin/sh' is hard-coded in few places in the test suite, but the Android shell 
is at '/system/bin/sh', see msg266084.

--
assignee: xdegaye
components: Tests
messages: 270044
nosy: xdegaye
priority: normal
severity: normal
stage: needs patch
status: open
title: add the 'unix_shell' attribute to test.support
type: behavior
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



[issue1222585] C++ compilation support for distutils

2016-07-09 Thread Christian H

Changes by Christian H :


--
nosy: +Christian H

___
Python tracker 

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



[issue27137] Python implementation of `functools.partial` is not a class

2016-07-09 Thread Nick Coghlan

Nick Coghlan added the comment:

Emanuel's latest patch looks good to me, but after seeing yet another behaviour 
discrepancy between the two versions(static method vs instance method 
behaviour), I've proposed disallowing function/class mismatches as an explicit 
policy clarification in PEP 399: 
https://mail.python.org/pipermail/python-dev/2016-July/145556.html

Since this change can land any time before the first 3.6 beta in September, I'm 
going to wait and see want kind of responses we get to that thread before 
merging it.

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower

Steve Dower added the comment:

Okay thanks. I'll see if I can track down the right one on Monday.

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2016-07-09 Thread Keno Fischer

Keno Fischer added the comment:

Yes, you are correct about it being only an issue in the embedding context.
I agree that it might not be a good idea to do do this for every library, but I 
wanted to revive the discussion since this kind of thing seems like something 
that comes up frequently when people embed python. Thanks for the reference to 
the other thread. A solution that allows the activation context to be specified 
would be great.

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš

Adam Bartoš added the comment:

Without a handler the drop feature is disabled.

--

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-09 Thread John Hagen

John Hagen added the comment:

Is this something we want to get in before the next alpha in two days?  Just 
wanted to bring up the deadline since this may be a feature people want to play 
around with during the alpha phase.

Ethan, I'm happy to help with documentation or anything else.

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Steve Dower

Steve Dower added the comment:

Try removing the handler completely and see what the default behavior is.

Otherwise, I'll do some research and figure out the right one.

--

___
Python tracker 

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



[issue26081] Implement asyncio Future in C to improve performance

2016-07-09 Thread INADA Naoki

INADA Naoki added the comment:

I'm working on this.  Some bugs are fixed, but doesn't pass tests for now.
https://github.com/methane/cpython/pull/5

--
nosy: +methane

___
Python tracker 

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



[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2016-07-09 Thread Eryk Sun

Eryk Sun added the comment:

This is only a problem for ctypes when python27.dll is used in an application 
that isn't manifested to load the "Microsoft.VC90.CRT" assembly. ctypes doesn't 
have this problem for a regular script run via the 2.7 version of python.exe, 
since the loader uses the python.exe activation context. Daniel claimed 
otherwise, but his claim is demonstrably false. Maybe he was embedding Python.

Keno, I don't think it's a good idea to arbitrarily set the Python DLL's 
activation context every time ctypes calls LoadLibrary. I proposed a more 
generic solution in issue 24429, msg246754.

An alternative solution would be to implement a pure-Python activation context 
class that works as a Python context manager. For example, it could create and 
activate a context using the hModule and lpResourceName fields:

with ctypes.ACTCTX(module_handle=sys.dllhandle, 
   resource_name=2):
libc = ctypes.CDLL('msvcr90')

I have a Stack Overflow answer that demonstrates using activation contexts with 
ctypes:

http://stackoverflow.com/a/27392347/205580

--
nosy: +eryksun

___
Python tracker 

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



[issue27027] add the 'is_android' attribute to test.support

2016-07-09 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee:  -> xdegaye

___
Python tracker 

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



[issue27027] add the 'is_android' attribute to test.support

2016-07-09 Thread Xavier de Gaye

Xavier de Gaye added the comment:

New patch using the changes made in issue 27442.

--
dependencies:  -android: add platform.android_ver()
keywords: +needs review -patch
stage:  -> patch review
title: add is_android in test.support to detect Android platform -> add the 
'is_android' attribute to test.support
Added file: http://bugs.python.org/file43667/is_android_2.patch

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Eryk Sun

Eryk Sun added the comment:

Yes, a different drop handler solves the problem. It doesn't have to be the 
exefile handler that's built into shell32.dll. Another handler could be used 
that preserves Unicode filenames and long paths.

I tested in Windows 10.0.10586.

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-07-09 Thread Mark Dickinson

Mark Dickinson added the comment:

> I would like to see them spelled-out:  geometric_mean and harmonic_mean

+1

--

___
Python tracker 

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-09 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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



[issue26942] android: test_ctypes crashes on armv7

2016-07-09 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Maybe a libffi issue. The crash is still with libffi git-master and CPython 
hg-tip + `--with-system-libffi`. Reported to 
https://github.com/libffi/libffi/issues/262

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



[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 46567fda0b29 by Xavier de Gaye in branch 'default':
Issue #27442: Expose the Android API level in sysconfig.get_config_vars()
https://hg.python.org/cpython/rev/46567fda0b29

--
nosy: +python-dev

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš

Adam Bartoš added the comment:

Also, what versions of Windows does this affect? I have 64bit Vista, so maybe 
this is fixed in say Windows 10.

--

___
Python tracker 

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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-09 Thread Adam Bartoš

Adam Bartoš added the comment:

Thank you very much for the analysis. So Python Windows installers may be 
changed to set the other drop handler. If the short paths are problem, they may 
be converted to long ones when initializing `sys.argv`.

--

___
Python tracker 

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



[issue6721] Locks in the standard library should be sanitized on fork

2016-07-09 Thread STINNER Victor

STINNER Victor added the comment:

I suggest to close the issue as WONT FIX. Python code base is huge and
Python depends on a lot of external code. We cannot warranty anything.

It might be possible to track all kinds of locks with an infinite time. But
I'm not sure that it's worth it.

It is possible to use fork() with threads. The problem is more to execute
non trivial code after the fork. In short, the POSIX advices to only call
exec() syscall after fork and nothing else. The list of functions which are
safe after fork() is very short.

You can still use the multiprocessing module using the fork server for
example.

--

___
Python tracker 

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



[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-09 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Fixed the redundant import as pointed by Evelyn on IRC.

--
Added file: http://bugs.python.org/file43666/issue27466-v2.patch

___
Python tracker 

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