[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 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



[issue28871] Destructor of ElementTree.Element is recursive

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

> Yet one argument for moving to Python 3.

Yep, thanks ;-)

--

___
Python tracker 

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



[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d9a64d00a439 by Serhiy Storchaka in branch '3.5':
Issue #29219: Fixed infinite recursion in the repr of uninitialized
https://hg.python.org/cpython/rev/d9a64d00a439

New changeset d9539a5c2315 by Serhiy Storchaka in branch '2.7':
Issue #29219: Fixed infinite recursion in the repr of uninitialized
https://hg.python.org/cpython/rev/d9539a5c2315

New changeset 17ca7c4dd583 by Serhiy Storchaka in branch '3.6':
Issue #29219: Fixed infinite recursion in the repr of uninitialized
https://hg.python.org/cpython/rev/17ca7c4dd583

New changeset 0503024831ad by Serhiy Storchaka in branch 'default':
Issue #29219: Fixed infinite recursion in the repr of uninitialized
https://hg.python.org/cpython/rev/0503024831ad

--
nosy: +python-dev

___
Python tracker 

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



[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue28871] Destructor of ElementTree.Element is recursive

2017-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Changes were reverted by 78bf34b6a713.

It is very uneasy to implement an alternative mechanism (without increasing the 
size of Element objects). It adds duplication of low level garbage collecting 
code. I think it is better to left all as is in 2.7. Yet one argument for 
moving to Python 3.

--
resolution:  -> fixed
stage: needs patch -> 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



[issue29192] Remove deprecated features from http.cookies

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29192] Remove deprecated features from http.cookies

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7bd9ec6e5da4 by Serhiy Storchaka in branch 'default':
Issue #29192: Removed deprecated features in the http.cookies module.
https://hg.python.org/cpython/rev/7bd9ec6e5da4

--
nosy: +python-dev

___
Python tracker 

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



[issue29192] Remove deprecated features from http.cookies

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue29193] Remove support of format_string as keyword argument in string.Formatter().format()

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29193] Remove support of format_string as keyword argument in string.Formatter().format()

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d571d8cd4258 by Serhiy Storchaka in branch 'default':
Issue #29193: A format string argument for string.Formatter.format()
https://hg.python.org/cpython/rev/d571d8cd4258

--
nosy: +python-dev

___
Python tracker 

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



[issue29193] Remove support of format_string as keyword argument in string.Formatter().format()

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue29195] Get rid of supporting outdated wrong keyword arguments in re methods

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29195] Get rid of supporting outdated wrong keyword arguments in re methods

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f8678135c042 by Serhiy Storchaka in branch 'default':
Issue #29195: Removed support of deprecated undocumented keyword arguments
https://hg.python.org/cpython/rev/f8678135c042

--
nosy: +python-dev

___
Python tracker 

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



[issue29258] __init__.py required for pkgutil.walk_packages in python3

2017-01-12 Thread Anthony Sottile

New submission from Anthony Sottile:

PEP420 makes __init__.py files optional: 
https://docs.python.org/3/whatsnew/3.3.html#pep-420-implicit-namespace-packages

Though it seems without them, pkgutil.walk_packages does not function as 
desired: https://docs.python.org/3/library/pkgutil.html#pkgutil.walk_packages

Consider the following example:

```
$ tree foo
foo
├── bar
│   ├── baz.py
│   └── __init__.py
├── __init__.py
└── womp.py
```

And a test script

# test.py
```
import pkgutil

import foo


for _, mod, _ in pkgutil.walk_packages(foo.__path__, foo.__name__ + '.'):
print(mod)
```

In both python2 and python3 I get the following output:

```
$ python2.7 test.py
foo.bar
foo.bar.baz
foo.womp
$ python3.5 test.py
foo.bar
foo.bar.baz
foo.womp
```

Removing the __init__.py files and only using python3, I get this:

```
$ find -name '__init__.*' -delete
$ python3.5 test.py
foo.bar
```

The modules are definitely importable:

```
$ python3.5 -c 'import foo.bar.baz'
$
```

Originally asked as a question on stackoverflow: 
http://stackoverflow.com/questions/41203765/init-py-required-for-pkgutil-walk-packages-in-python3

--
components: Library (Lib)
messages: 285361
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: __init__.py required for pkgutil.walk_packages in python3
type: behavior
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 Thread Nick Coghlan

Nick Coghlan added the comment:

SSH environment forwarding will propagate this "LC_CTYPE=UTF-8" setting from 
Mac OS X clients to Linux servers.

At present, that breaks in multiple ways, as CPython will interpret it as being 
the "C" locale (since Linux servers don't offer a "UTF-8" locale, even when 
they do offer "C.UTF-8")

PEPs 538 and 540 aim to help CPython itself to deal with that case, but that 
won't be sufficient to help code that tries to pass the nominal LC_CTYPE 
setting to the locale module.

Accepting "UTF-8" and interpreting it as functionally equivalent to C.UTF-8 
will mean that this setting will at least work as desired on servers that offer 
C.UTF-8.

--

___
Python tracker 

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



[issue29062] hashlib documentation link error

2017-01-12 Thread Xiang Zhang

Xiang Zhang added the comment:

Although I am +1 for merging it before but these days I find it's not the only 
case. There are also two unittest.mock entries. This is just FYI, no opinion on 
this issue.

--

___
Python tracker 

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



[issue29062] hashlib documentation link error

2017-01-12 Thread INADA Naoki

INADA Naoki added the comment:

@christian.heimes Would you look merge-hashlib-blake2.patch?
This is blocker of our document translation project.

--

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread INADA Naoki

INADA Naoki added the comment:

How about locale.getpreferredencoding() returns 'utf-8' in utf8 mode?

--

___
Python tracker 

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



[issue29257] Possible error in discussion of Abstract Base Classes and abstract properties

2017-01-12 Thread Gerald Britton

New submission from Gerald Britton:

I was rereading the 2.7 docs  about abstract base classes the other day.  I 
found this:

"This defines a read-only property; you can also define a read-write abstract 
property using the ‘long’ form of property declaration:"

along with an example.  so I copied the example and put in a little surrounding 
code:


from abc import ABCMeta, abstractproperty

class C:
__metaclass__ = ABCMeta
def getx(self): pass
def setx(self, value): pass
x = abstractproperty(getx, setx)
 
class D(C):
@property
def x(self):self._x
 
d = D()
print(d)   

When I ran this, I expected an exception, since I defined a read/write abstract 
property but only implemented the read operation.  However, the example runs 
fine. That is the class D can be instantiated without error.  Of course I 
cannot set the property since I didn't implement that part.

Now, If I don't implement the property at all, I can' instantiate the class.  I 
get:

"TypeError: Can't instantiate abstract class D with abstract methods x"

which is what I would expect.  What I don't understand is why I don't get a 
similar error when I implement the read operation for the property but not the 
write operation.

If this actually doesn't work (catching the non-implementation at instantiation 
time), then why is it documented this way?  To me at least the doc implies that 
it *will* raise on the missing write property implementation.

If ABCs are working as intended, can the documentation be changed to reflect 
that as per my experience above?  If the documentation is correct, can the ABC 
implementation be modified to function that way?

--
assignee: docs@python
components: Documentation
messages: 285356
nosy: docs@python, gbritton
priority: normal
severity: normal
status: open
title: Possible error in discussion of Abstract Base Classes and abstract 
properties
versions: Python 2.7

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2017-01-12 Thread Eryk Sun

Eryk Sun added the comment:

I simply listed the tags that have the name-surrogate bit set out of those 
defined in km\ntifs.h. 

To keeps things simple it might be better to only include Microsoft tags (i.e. 
bit 31 is set). That way we don't have to deal with REPARSE_GUID_DATA_BUFFER 
struct that's used from non-Microsoft reparse points.

--

___
Python tracker 

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



[issue11339] annotation for class being defined

2017-01-12 Thread Ryan Hiebert

Changes by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-12 Thread Steve Dower

Steve Dower added the comment:

Then we do in fact need to make os.fsencode/fsdecode either stop caching the 
encoding completely, or figure out a way to reset the cache when that function 
is called.

--

___
Python tracker 

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



[issue29256] Windows select() errors out when given no fds to select on, which breaks SelectSelector

2017-01-12 Thread Nathaniel Smith

New submission from Nathaniel Smith:

If SelectSelector.select() is called when there are no fds registered, then it 
ends up calling select.select([], [], [], timeout).

On sensible operating systems, this is equivalent to time.sleep(timeout). On 
Windows, it raises an error. Asyncio manages to avoid hitting this due to the 
fact that it always has at least one fd registered, but it causes problems for 
other users of the selectors module, e.g.:
  https://github.com/dabeaz/curio/issues/75

I see two possible approaches to fixing this:

1) Modify SelectSelector to check for this case and call time.sleep() instead 
of select.select() when encountered.

2) Modify the select.select() wrapper so that it behaves consistently on all 
operating systems, by special-casing this situation on Windows.

Option (2) seems nicer to me.

--
components: Library (Lib)
messages: 285353
nosy: njs
priority: normal
severity: normal
status: open
title: Windows select() errors out when given no fds to select on, which breaks 
SelectSelector
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



[issue29255] selects.KqueueSelector behaves incorrectly when no fds are registered

2017-01-12 Thread Nathaniel Smith

New submission from Nathaniel Smith:

When calling kevent(), selectors.KqueueSelector.select sets the "maxevents" 
argument to len(self._fd_to_key). So if there are no fds registered, it passes 
maxevents=0.

It turns out that the kevent() API has a special case behavior for maxevents=0: 
it returns immediately, ignoring timeout. I have no idea why kevent() works 
this way, but it's specifically called out in the man page:

   The nevents argument determines the size of eventlist.  When
   nevents is zero, kevent() will return immediately even if there is a
   timeout specified unlike select(2).

https://www.freebsd.org/cgi/man.cgi?query=kqueue=2

It happens that asyncio doesn't run into this because asyncio always has at 
least one fd registered with its selector, but this causes problems for other 
users of the selectors module, e.g.:
  https://github.com/dabeaz/curio/issues/156

I believe fix would just be to add some code like: "if max_ev == 0: max_ev = 1" 
to selectors.KqueueSelector.select.

--
components: Library (Lib)
messages: 285352
nosy: njs
priority: normal
severity: normal
status: open
title: selects.KqueueSelector behaves incorrectly when no fds are registered
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



[issue23407] os.walk always follows Windows junctions

2017-01-12 Thread Craig Holmquist

Craig Holmquist added the comment:

Can you point me toward any documentation on the additional tags you want to 
support?  Searching for IO_REPARSE_TAG_IIS_CACHE mostly seems to yield header 
files that define it (and nothing at all on MSDN), and the non-Microsoft tags 
just yield a few results each.

(For comparison, the junction and symbolic link tags yield 10K+ results each.)

Junctions are created with each user's home directory so they exist on every 
Windows system, even if the user never explicitly creates them.  The additional 
tags seem like they're far less common and much less well-documented.

--

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Thank you for catching this corner case!

I have made a PR upstream based on your patch: 
https://github.com/python/typing/pull/350

As I understand the fix will go in 3.6.1 and 3.5.4

--

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-12 Thread Thomas Nyberg

Thomas Nyberg added the comment:

Hi Vinay,

I just checked and yes that code works fine on my end (debian 8 box). 
Personally, I think either this or Mark's second patch would be fine.

Cheers,
Thomas

--

___
Python tracker 

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



[issue17824] pty.spawn handles errors improperly

2017-01-12 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue29252] self in classes missinterpreted as a string.

2017-01-12 Thread Decorater

Decorater added the comment:

Also in the code I had to subclass it 3 times, 1 time to preserver original 
functionality as if the hook was not inserted in the front of the path hooks, 
another time for 1 format of files it should be able to allow importing of, and 
the other time for another format of files.

--

___
Python tracker 

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



[issue29252] self in classes missinterpreted as a string.

2017-01-12 Thread Decorater

Decorater added the comment:

Also I sadly have to make this a dummy class just to add in an actual 
dictionary with the file extensions it supports because I cant use setattr on 
it. It is retarded that you cant use it for builtin types or classes if your 
code actually requires such.

--

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-12 Thread Vinay Sajip

Vinay Sajip added the comment:

It seems simpler to do it all in EnvBuilder.create:

def create(self, env_dir):
"""
Create a virtual environment in a directory.

:param env_dir: The target directory to create an environment in.

"""
env_dir = os.path.abspath(env_dir)
context = self.ensure_directories(env_dir)
# See issue 24875. We need system_site_packages to be False
# until after pip is installed.
true_system_site_packages = self.system_site_packages
self.system_site_packages = False
self.create_configuration(context)
self.setup_python(context)
if self.with_pip:
self._setup_pip(context)
if not self.upgrade:
self.setup_scripts(context)
self.post_setup(context)
if true_system_site_packages:
# We had set it to False before, now
# restore it and rewrite the configuration
self.system_site_packages = True
self.create_configuration(context)

Can you patch that in and see if it works for you?

--

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8578757cc3a6 by Alexander Belopolsky in branch '2.7':
Closes #28130: Documented that time.tzset() updates time module globals.
https://hg.python.org/cpython/rev/8578757cc3a6

--
status: open -> closed

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-12 Thread Thomas Nyberg

Changes by Thomas Nyberg :


Removed file: http://bugs.python.org/file46250/venv_site_packages.patch

___
Python tracker 

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



[issue28969] lru_cache is not threadsafe

2017-01-12 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



[issue29082] In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects

2017-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed with changed test. Thank you for your patch Chi Hsuan Yen.

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Greg Bengeult

Greg Bengeult added the comment:

Here's the 2.7 patch.

--
Added file: http://bugs.python.org/file46276/tzset_rst_27.patch

___
Python tracker 

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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-12 Thread Jamie Bliss

Jamie Bliss added the comment:

I consider it debatable as to if this is a bug in ABC (for using recursion in a 
way that limits class tree depth) or in CPython (for accounting recursion in 
such a way you can get significantly shallower stacks).

--

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
status: closed -> open

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ec3b08b361c0 by Alexander Belopolsky in branch 'default':
Closes #28130: Documented that time.tzset() updates time module globals.
https://hg.python.org/cpython/rev/ec3b08b361c0

--
nosy: +python-dev
status: open -> closed

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Committed in ec3b08b361c0.  Thanks, Greg.

Leaving open until 2.7 docs are fixed as well.

--
resolution:  -> fixed
stage:  -> resolved
versions: +Python 2.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



[issue29212] Python 3.6 logging thread name regression with concurrent.future threads

2017-01-12 Thread desbma

desbma added the comment:

Thoughts anyone?

This is a minor bug, but for a common use case (easy to hit), and the fix is 
trivial.

--

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Guido van Rossum

Changes by Guido van Rossum :


--
assignee:  -> levkivskyi
nosy: +levkivskyi

___
Python tracker 

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



[issue28969] lru_cache is not threadsafe

2017-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Inada.

Committed in 9314aebc9674, 5724c3ddf25b and 9c852878a998. There were errors 
during pushing:

remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 9 changesets with 15 changes to 5 files
remote: buildbot: change(s) sent successfully
remote: Traceback (most recent call last):
remote:   File "/srv/hg/repos/hooks/hgroundup.py", line 56, in update_issue
remote: _update_issue(*args, **kwargs)
remote:   File "/srv/hg/repos/hooks/hgroundup.py", line 108, in _update_issue
remote: s.login(username, password)
remote:   File "/usr/lib/python2.7/smtplib.py", line 610, in login
remote: AUTH_PLAIN + " " + encode_plain(user, password))
remote:   File "/usr/lib/python2.7/smtplib.py", line 394, in docmd
remote: return self.getreply()
remote:   File "/usr/lib/python2.7/smtplib.py", line 365, in getreply
remote: + str(e))
remote: SMTPServerDisconnected: Connection unexpectedly closed: timed out
remote: error: changegroup.roundup hook raised an exception: Connection 
unexpectedly closed: timed out
remote: notified python-check...@python.org of incoming changeset 9314aebc9674

remote: Traceback (most recent call last):
remote:   File "/srv/hg/repos/hooks/mail.py", line 166, in incoming
remote: return _incoming(ui, repo, **kwargs)
remote:   File "/srv/hg/repos/hooks/mail.py", line 157, in _incoming
remote: send(smtp, subj, sender, to, '\n'.join(body) + '\n')
remote:   File "/srv/hg/repos/hooks/mail.py", line 37, in send
remote: smtp.sendmail(sender, to, msg.as_string())
remote:   File "/usr/lib/python2.7/smtplib.py", line 748, in sendmail
remote: (code, resp) = self.data(msg)
remote:   File "/usr/lib/python2.7/smtplib.py", line 511, in data
remote: (code, msg) = self.getreply()
remote:   File "/usr/lib/python2.7/smtplib.py", line 365, in getreply
remote: + str(e))
remote: SMTPServerDisconnected: Connection unexpectedly closed: timed out
remote: error: incoming.notify hook raised an exception: Connection 
unexpectedly closed: timed out
...

--

___
Python tracker 

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



[issue28130] Document that time.tzset updates time module globals

2017-01-12 Thread Greg Bengeult

Greg Bengeult added the comment:

How about this documentation patch for tzset()? Most of the verbiage comes from 
the Linux tzset() man page. I can also generate a similar patch for 2.7 if it's 
needed.

--
nosy: +gbengeult
versions: +Python 3.7
Added file: http://bugs.python.org/file46275/tzset_rst.patch

___
Python tracker 

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



[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-12 Thread Jamie Bliss

Changes by Jamie Bliss :


--
nosy: +astronouth7303

___
Python tracker 

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



[issue22343] Install bash activate script on Windows when using venv

2017-01-12 Thread Vinay Sajip

Vinay Sajip added the comment:

Changesets:

3.5 d6ae934da199
3.6 8f77c4f93806
default 7afe82ad34e7

--

___
Python tracker 

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



[issue22343] Install bash activate script on Windows when using venv

2017-01-12 Thread Vinay Sajip

Vinay Sajip added the comment:

I've pushed the changes, but due to some SMTP problem this issue wasn't updated 
by Roundup:

remote: SMTPServerDisconnected: Connection unexpectedly closed: timed out
remote: error: changegroup.roundup hook raised an exception: Connection 
unexpectedly closed: timed out

However, the changes appear to be in the repository. Interested parties might 
want to pull the changes and test things out on Windows so that the issue can 
be closed.

--

___
Python tracker 

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



[issue11681] -b option undocumented

2017-01-12 Thread Greg Bengeult

Greg Bengeult added the comment:

Thanks for the :class: markup edits. I'm still learning this stuff.

--

___
Python tracker 

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



[issue29254] Documentation Error

2017-01-12 Thread Ammar Askar

Ammar Askar added the comment:

Given `slice[start:end]`:

What this line is trying to say is that the slice index is inclusive for the 
start parameter and exclusive for the end parameter.

In mathematical/interval notation this would look like [start, end)

As a quick example look at the word "Python"
Index  012345
Letter Python

If you do word[:2], the result is 'Py', notice how the t is excluded.

--
nosy: +ammar2
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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

encodings.py: enhancement version of pep540_cli.py, add locale and filesystem 
encoding. Script to test the implementation of the PEP 540 (and PEP 538).

--
Added file: http://bugs.python.org/file46274/encodings.py

___
Python tracker 

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



[issue29254] Documentation Error

2017-01-12 Thread Suraj Kumar

New submission from Suraj Kumar:

Hi,

I have found one documentation mistake in section 3.1.2. Strings saying
"""Note how the start is always included, and the end always excluded. This 
makes sure that s[:i] + s[i:] is always equal to s:
>>>word = 'Python'
>>> word[:2] + word[2:]
'Python'
"""

I think instead of 'the end always excluded' it should be 'the end always 
included'.

If my observation is correct, please do the needful change.

Thanks & Regards,
Suraj

--
assignee: docs@python
components: Documentation
messages: 285331
nosy: Suraj Kumar, docs@python
priority: normal
severity: normal
status: open
title: Documentation Error
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



[issue28969] lru_cache is not threadsafe

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue29082] In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ce22d69e134 by Serhiy Storchaka in branch '2.7':
Issue #29082: Fixed loading libraries in ctypes by unicode names on Windows.
https://hg.python.org/cpython/rev/4ce22d69e134

--
nosy: +python-dev

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I think Ronald's patch issue18378-2015-07-25-py36.txt with added darwin check 
would be the best way forward.

In the current form, it would allow using 'UTF-8' as locale string on all 
platforms - which is not such a good idea.

--
nosy: +lemburg

___
Python tracker 

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



[issue25658] PyThread assumes pthread_key_t is an integer, which is against POSIX

2017-01-12 Thread Erik Bray

Erik Bray added the comment:

Thanks Masayuki for the updated patch, and especially for the additional test 
cases.

Looking at the patch, it occurs to me that this solution seems to be the 
minimal needed to fix the issue that we were originally trying to fix, without 
adding too much additional complexity or new semantics to how TLS keys are used 
in the interpreter.  In other words, this preserves the existing usage with 
minimal changes except to better support opaque key types.  So I think it's a 
point in favor of this change that's managed to remain focused.

I'll work on updating the PEP draft to reflect the additions.

--

___
Python tracker 

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



[issue29082] In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue29082] In 2.7.13, _ctypes.LoadLibrary no longer accepts Unicode objects

2017-01-12 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Here's a new patch using fake library names.

And thanks for those related issues about asdl_c.py!

--
Added file: http://bugs.python.org/file46273/issue29082_3.patch

___
Python tracker 

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



[issue29253] Fix test_asyncore tests on Cygwin

2017-01-12 Thread Erik Bray

New submission from Erik Bray:

This patch works around a couple different problems with running the 
test_asyncore tests in Cygwin, both of which are due to bugs in Cygwin itself 
and not in Python.  As such, I don't think Python should try to work around 
these issues in general, but I do think they're worth at least working around 
in the tests so that they can pass and/or skip.

The first issue is more severe, as it actually causes the test run to hang 
indefinitely due to a bug in Cygwin that can cause connect() on a socket to 
block indefinitely.  This occurs only in a situation where a "client" connects 
to a "server" that is not accept()-ing connections--a situation that occurs 
specifically in some of the asyncore tests where both the "client" and the 
"server" are in the same test process.  This applies a known workaround to the 
tests only, allowing them to pass.

The other bug simply causes a test failure--the bug is that 
getsockopt(SO_REUSEADDR) returns the wrong result after a 
setsockopt(SO_REUSEADDR) (the latter has the correct behavior; the value of the 
option just isn't reported back correctly after being set).  In this case the 
relevant test is simply skipped on Cygwin.

The patch is currently light on in-line documentation of the situation, but I 
can add that if it's otherwise approved.

--
components: Tests
files: 0001-Fix-test_asyncore-tests-on-Cygwin-by-working-around-.patch
keywords: patch
messages: 285326
nosy: erik.bray, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Fix test_asyncore tests on Cygwin
Added file: 
http://bugs.python.org/file46272/0001-Fix-test_asyncore-tests-on-Cygwin-by-working-around-.patch

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 4:

* Handle PYTHONLEGACYWINDOWSFSENCODING: this env var now disables the UTF-8 
mode and has the priority over -X utf8 and PYTHONUTF8
* Add an unit test on PYTHONUTF8 env var and -E cmdline option
* Add an unit test on the POSIX locale
* Fix initstdio() to handle correctly empty PYTHONIOENCODING: this bug affects 
Python 3.6 as well and is not directly related to the PEP 540
* Fix to handle correctly PYTHONUTF8 set to an empty string (ignore it)
* Skip an unit test in test_utf8mode which failed with the POSIX locale

Note: This patch still has the sys.argv encoding bug with locale encodings 
different than ASCII and UTF-8.

--
Added file: http://bugs.python.org/file46270/pep540-4.patch

___
Python tracker 

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



[issue29185] test_distutils fails on Android API level 24

2017-01-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

can_symlink() is needed by test_posixpath and other tests, new patch.

--
Added file: http://bugs.python.org/file46271/test_distutils_3.patch

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Jon Walsh

Jon Walsh added the comment:

Seems a bit strange to not have glob() and match() working the same though. Is 
there any reason for that?

--

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-12 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +gvanrossum
stage:  -> patch review

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I missed Chi Hsuan Yen's comment:
> I guess replace mkstemp (C function) with tempfile.mkstemp (Python function) 
> can solve the problem.

So yes, I agree :-)

--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

I change the issue type to security.

--
type: behavior -> security

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

The putwin() function uses mkstemp() with the path template 
/tmp/py.curses.getwin.XX.

I would prefer to use the Python function tempfile.mkstemp(). This function has 
a more portable behaviour. For example, Python is able to atomatically make the 
file descriptor non-inherirable if the OS supports this feature.

I suggest to expect a file descriptor in the C putwin() and write a Python 
putwin() which expects a file and pass file.fileno() if available, or use 
tempfile.TemporaryFile().

tempfile.TemporaryFile is even more secure because the file is not accessible 
from the regular file system on most platforms. This function is able to use 
the secure Linux O_TMPFILE flag and the O_TEMPORARY flag on Windows.

--

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 Thread Wolfgang Maier

Wolfgang Maier added the comment:

I think PEP 538 extended to the UTF-8 locale *would* help here. Specifically, 
it would coerce only LC_CTYPE to en_US.UTF-8 (unless OS X has C.UTF-8), which I 
guess is good enough for the purpose here.

I do agree that it is not the kind of problem that PEP 538 tries to solve right 
now, but it could be extended to cover other types of problematic locales like 
this one. Just wanted to make you aware of this possibility.

--

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 Thread Nick Coghlan

Nick Coghlan added the comment:

PEP 538 wouldn't help here, as there's nothing wrong with CPython's assumptions 
about the text encoding to use for operating system interfaces - it's assuming 
UTF-8 (because it's Mac OS X) and that assumption is correct (because it's Mac 
OS X).

The problem appears to be that locale.py was written primarily for Linux, and 
hence makes assumptions that aren't valid on BSD and Mac OS X.

Dmitry's suggested solution of taking the BSD/Mac OS X specific locale of 
"UTF-8" and universally accepting it as meaning (None, "UTF-8") sems like a 
sensible step forward, even if it doesn't resolve all the discrepancies.

Where PEP 538 and PEP 540 would come into play is when this setting gets 
forwarded over SSH to Linux servers (as then CPython *will* get the nominal 
system text encoding wrong), but that's independent of getting the locale 
module to handle it more gracefully.

--

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2017-01-12 Thread Wolfgang Maier

Wolfgang Maier added the comment:

To me this issue seems quite related to PEP 538. Maybe the LC_CTYPE coercion 
proposed in the PEP could be extended to cover the case of LC_CTYPE=UTF-8?

--
nosy: +ncoghlan
versions: +Python 3.7

___
Python tracker 

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



[issue29252] self in classes missinterpreted as a string.

2017-01-12 Thread Decorater

New submission from Decorater:

So, I have a class (it subclasses the zipimporter for my import hook) that 
allows me to not worry about issues when the hook is appended to the beginning 
of the path hooks.

The code to the class as follows:

class OriginalZipImport(zipimport.zipimporter):
"""
Original zipimporter class. Modified for requirements of this import hook.
"""
# Sadly I have to manually specify the file extensions the original
# zipimporter supports to bypass an AttributeError.
# according to https://docs.python.org/3.6/library/zipimport.html
# zipimport only allows importing ``.py`` and ``.pyc`` files from zips.
extensions = ['.py', '.pyc']

def __init__(self, archivepath):
super(OriginalZipImport, self.inst).__init__(self, archivepath)

def find_loader(self, fullname, path=None):
"""
Original find_loader.
"""
self.inst.find_loader(fullname, path=path)

def find_module(self, fullname, path=None):
"""
Original find_module.
"""
self.inst.find_module(self, fullname, path=path)

def load_module(self, fullname):
"""
Original load_module.
"""
self.inst.load_module(self, fullname)

However instead of working like the way I would expect it gives this traceback:

Traceback (most recent call last):
  File "E:\Users\Elsword\Desktop\DecoraterBot\Async\\zipmaker\make_zip.py", 
line 11, in 
from pathlib import Path
  File "", line 961, in _find_and_load
  File "", line 946, in _find_and_load_unlocked
  File "", line 885, in _find_spec
  File "", line 1157, in find_spec
  File "", line 1129, in _get_spec
  File "", line 1273, in find_spec
  File "", line 1229, in _get_spec
  File 
"E:\Users\Elsword\Desktop\DecoraterBot\Async\zipmaker\py2pycx\_pycx_backend.py",
 line 180, in find_loader
self.inst.find_loader(fullname, path=path)
AttributeError: 'str' object has no attribute 'inst'

Note: it does use a slightly modified make_zip.py that is different than the 
one that is on the python source trees. It is specifically for testing the hook 
to see if it works or not.

The hook is supposed to work however it is confusing why it is doing this as I 
did not set self to be an string so it should allow me to do all of this just 
fine.

--
components: Interpreter Core
messages: 285316
nosy: Decorater
priority: normal
severity: normal
status: open
title: self in classes missinterpreted as a string.
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



[issue29185] test_distutils fails on Android API level 24

2017-01-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

This new patch skips the second test when hard links fail on the platform under 
test.

--
Added file: http://bugs.python.org/file46269/test_distutils_2.patch

___
Python tracker 

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-12 Thread Michael Felt

Michael Felt added the comment:

The "key" bit of the patch is to move the code AND make this assignment:

if _PYTHON_BUILD:
vars['LDSHARED'] = vars['BLDSHARED']

Besides, imho, skipping around the problem that LDSHARED is not correctly 
assigned - it cannot work because BLDSHARED is not set to the 'installed' value.

And, frankly I am amazed (in Python3-3.6.0) both are equal AND both pointing at 
the 'installed' location.

OOPS: I just looked and the patch above is NOT in the Python3-3.6 branch, and 
as both variables are identical now in _sysconfigdata_m_aix5.py - neither 
assignment has any affect.

Again: comparing python2 and python3 it seems the latest Python3 now have the 
fullpath - and equal definitions - for both variables WHILE Python2 use 
'relative' pathnames - BUT both are equal.

As far as the patch goes - it is irrevalant and can be removed in Python3 while 
a quick hack for Python2 would be to use (in the new location!)

if _PYTHON_BUILD:
vars['LDSHARED'] = vars['LDCXXSHARED']

Details:
root@x064:[/data/prj/python]grep SHARED 
python*/X64/opt/lib/python*/_sysconfig*.py | grep LD
python-2.7.12.0/X64/opt/lib/python2.7/_sysconfigdata.py: 'BLDSHARED': 
'./Modules/ld_so_aix xlc_r -bI:./Modules/python.exp',
python-2.7.12.0/X64/opt/lib/python2.7/_sysconfigdata.py: 'LDCXXSHARED': 
'/opt/lib/python2.7/config/ld_so_aix xlc_r 
-bI:/opt/lib/python2.7/config/python.exp',
python-2.7.12.0/X64/opt/lib/python2.7/_sysconfigdata.py: 'LDSHARED': 
'./Modules/ld_so_aix xlc_r -bI:./Modules/python.exp',
python-2.7.13/X64/opt/lib/python2.7/_sysconfigdata.py: 'BLDSHARED': 
'Modules/ld_so_aix xlc_r -bI:Modules/python.exp -L/opt/lib',
python-2.7.13/X64/opt/lib/python2.7/_sysconfigdata.py: 'LDCXXSHARED': 
'/opt/lib/python2.7/config/ld_so_aix xlc_r 
-bI:/opt/lib/python2.7/config/python.exp',
python-2.7.13/X64/opt/lib/python2.7/_sysconfigdata.py: 'LDSHARED': 
'Modules/ld_so_aix xlc_r -bI:Modules/python.exp -L/opt/lib',
python3-3.5.2/X64/opt/lib/python3.5/_sysconfigdata.py: 'BLDSHARED': 
'/opt/lib/python3.5/config/ld_so_aix xlc_r '
python3-3.5.2/X64/opt/lib/python3.5/_sysconfigdata.py: 'LDCXXSHARED': 
'/opt/lib/python3.5/config/ld_so_aix xlc_r '
python3-3.5.2/X64/opt/lib/python3.5/_sysconfigdata.py: 'LDSHARED': 
'/opt/lib/python3.5/config/ld_so_aix xlc_r '
python3-3.6.0/X64/opt/lib/python3.6/_sysconfigdata_m_aix5_.py: 'BLDSHARED': 
'/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '
python3-3.6.0/X64/opt/lib/python3.6/_sysconfigdata_m_aix5_.py: 'LDCXXSHARED': 
'/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '
python3-3.6.0/X64/opt/lib/python3.6/_sysconfigdata_m_aix5_.py: 'LDSHARED': 
'/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '

--

___
Python tracker 

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



[issue29251] Class __dict__ is only a mapping proxy

2017-01-12 Thread Martin Panter

New submission from Martin Panter:

The __dict__ attribute of class objects is documented as being a (standard) 
dictionary, but implemented with a proxy object. I propose to clarify the 
documentation in “Custom classes” under 
,
 and in .

I believe my changes are also applicable to Python 2, as long as I point out 
the proxy is specific to “new-style” classes.

--
assignee: docs@python
components: Documentation
files: class-dict.patch
keywords: patch
messages: 285313
nosy: docs@python, martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Class __dict__ is only a mapping proxy
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46268/class-dict.patch

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Please go ahead and start the discussion on Python-Dev.

--
assignee: xdegaye -> 

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

The test suite runner in the test.libregrtest.main module calls 
tempfile.gettempdir() and mkstemp_curses.patch uses the same logic to fix the 
problem on Android where the tests that I run use TMPDIR=/data/local/tmp on 
Android API 24.

As a side note, when the curses library is ncurses-6.0, the library must be 
patched in ncurses/base/lib_screen.c with the attached ncurses.patch, see:
http://lists.gnu.org/archive/html/bug-ncurses/2016-05/msg0.html
https://bugs.python.org/issue27323

--
Added file: http://bugs.python.org/file46267/mkstemp_curses.patch

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

** is supported not just as a prefix. Path('./Lib').glob('**/*.py') emits the 
same paths as Path('.').glob('Lib/**/*.py'). But ** is supported only in 
glob(), not in match(). The support of ** in match() is not documented. Would 
be worth to document explicitly that it is not supported.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, serhiy.storchaka
stage:  -> needs patch
type: behavior -> enhancement
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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Christian Heimes

Changes by Christian Heimes :


--
nosy: +pitrou

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-01-12 Thread Xavier de Gaye

Changes by Xavier de Gaye :


Added file: http://bugs.python.org/file46266/ncurses.patch

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Christian Heimes

Christian Heimes added the comment:

The ticket is not about glob but about pathlib.

Pathlib supports ** directory globbing, but it's only documented as prefix 
globbing, https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob

--
nosy: +christian.heimes

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The purpose of this helper is skipping the test rather than failing if some OS 
operation is not permitted by current configuration. May be 
skip_if_not_permitted()?

Similar helpers that convert runtime error in skipping a test: import_module(), 
get_attribute(), bind_unix_socket(), system_must_validate_cert(). They are more 
concrete, guard some specific operation.

Context manager is not the only possible syntax. The helper can call a function:

helper(os.mkfifo, filename)

or be a wrapper:

helper(os.mkfifo)(filename)

If you prefer such syntax.

There are many possibilities, and I think it is worth to discuss this on 
Python-Dev.

--

___
Python tracker 

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



[issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix

2017-01-12 Thread Michael Felt

Michael Felt added the comment:

> Regarding reopening Issue 10656, whatever you think is more appropriate. 

Not "scary", just irritating. I'll open a new one when I have more time to 
document it.

> Issue 16189 and Issue 25825 were about updating to match recent changes to 
> directory names, and I thought we decided the changes were not applicable to 
> 2.7.

My bad. I was looking at the subject titles (cannot load ld_so_aix, cannot 
build external modules). I'll focus on the 'patch' you mention below. As it 
stands, I have no idea how to determine if they have any relevance to 
anything...

> Regarding LDSHARED vs BLDSHARED, isn’t this the same as Issue 28311, which 
> lead to Issue 18235? 

> If you can try the patch I mentioned at 
> , I suspect it may help.

Will do.
> Let me know if you need help adapting the patch for 2.7.

--
nosy: +aixto...@gmail.com

___
Python tracker 

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



[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-12 Thread Michael Felt

Michael Felt added the comment:

OK - just looked at what happens with Python3-3.6

new file name: _sysconfigdata_m_aix5_.py

values:
root@x064:[/data/prj/python/python3-3.6.0/X64/opt/lib/python3.6]grep SHARED 
_sysconf*.py | grep LD
 'BLDSHARED': '/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '
 'LDCXXSHARED': '/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '
 'LDSHARED': '/opt/lib/python3.6/config-3.6m/ld_so_aix xlc_r '


The 'build' worked, so I am guessing that BLDSHARED had a different value that 
what it shows here. 

The full pathname for ld_so_aix is correct.

As I mentioned in https://bugs.python.org/issue28311#msg277692 - still broken 
for Python2-2.7(.13) - shall try your patch above (once I figure out how to 
grab it)

--

___
Python tracker 

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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Andrew Dunai

Andrew Dunai added the comment:

Isn't this intended? According to https://docs.python.org/2/library/glob.html 
and wiki, typical UNIX glob pattern does not have the reqursive matching 
operator (`**`).

--
nosy: +Andrew Dunai

___
Python tracker 

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



[issue22343] Install bash activate script on Windows when using venv

2017-01-12 Thread Evan

Evan added the comment:

Works for me in Git Bash.

--

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-12 Thread Xavier de Gaye

Xavier de Gaye added the comment:

'supported_operation':
* The intent in using 'supported' was that the context manager could possibly 
be extended later.
* 'operation' is the terminology used in the GNU libc documentation [1].
I will replace 'supported_operation' with 'permitted_operation' unless a better 
name is proposed.

[1] https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html

--

___
Python tracker 

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



[issue25591] refactor imaplib tests

2017-01-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a10d6ab65b23 by Victor Stinner in branch '3.5':
Issue #25591: Fix test_imaplib if ssl miss
https://hg.python.org/cpython/rev/a10d6ab65b23

--

___
Python tracker 

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



[issue29250] islink and stat follow_symlinks are inconsistent on Windows

2017-01-12 Thread Eryk Sun

Changes by Eryk Sun :


--
dependencies: +os.walk always follows Windows junctions

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2017-01-12 Thread Eryk Sun

Eryk Sun added the comment:

I opened issue 29248 for the os.readlink bug and issue 29250 for the 
inconsistency between os.path.islink and os.stat.

Handling junctions as links is new behavior, so I've changed this issue to be 
an enhancement for 3.7.

If the notion of a link is generalized to junctions, then maybe it should be 
further generalized to include all name-surrogate reparse tags [1]. Currently 
for Microsoft tags this includes 

IO_REPARSE_TAG_MOUNT_POINT (junctions)
IO_REPARSE_TAG_SYMLINK
IO_REPARSE_TAG_IIS_CACHE

For non-Microsoft tags it includes 

IO_REPARSE_TAG_SOLUTIONSOFT
IO_REPARSE_TAG_OSR_SAMPLE
IO_REPARSE_TAG_QI_TECH_HSM
IO_REPARSE_TAG_MAXISCALE_HSM

The last two are outliers. HSM isn't the kind of immediate, fast access that 
one would expect from a symbolic link. All other HSM tags aren't categorized as 
name surrogates.

[1]: https://msdn.microsoft.com/en-us/library/aa365511

--
type: behavior -> enhancement
versions: +Python 3.7 -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



[issue17824] pty.spawn handles errors improperly

2017-01-12 Thread Martin Panter

Martin Panter added the comment:

The patch for Issue 26228 proposes an improvement to the situation, although it 
is not perfect and does not include a test. I wonder if it is possible to 
replace fork() and execlp() with a subprocess.Popen invokation, at least in a 
new Python release?

--

___
Python tracker 

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



[issue29250] islink and stat follow_symlinks are inconsistent on Windows

2017-01-12 Thread Eryk Sun

New submission from Eryk Sun:

win32_xstat_impl in Modules/posixmodule.c doesn't check the value of 
reparse_tag to limit traversal to only tags that are considered links. So we 
have cases in which os.path.islink returns False (e.g. junctions, pending the 
resolution of issue 23407), but os.stat and os.lstat disagree. For example:

>>> os.path.islink(r'C:\Documents and Settings')
False
>>> s = os.stat(r'C:\Documents and Settings')
>>> ls = os.lstat(r'C:\Documents and Settings')
>>> s.st_ino == ls.st_ino
False

At its strictest, traversal would be limited to just symbolic links. It could 
be relaxed to also include junctions, and even further to include all tags with 
the name surrogate bit set [1]. This includes the following Microsoft tags

IO_REPARSE_TAG_MOUNT_POINT (junctions)
IO_REPARSE_TAG_SYMLINK
IO_REPARSE_TAG_IIS_CACHE

and non-Microsoft tags: 

IO_REPARSE_TAG_SOLUTIONSOFT
IO_REPARSE_TAG_OSR_SAMPLE
IO_REPARSE_TAG_QI_TECH_HSM
IO_REPARSE_TAG_MAXISCALE_HSM

I'm creating this issue as an enhancement for 3.7. The problem has existed for 
a long time, but it hasn't been a thorn in anyone's side as far as I know.

[1]: https://msdn.microsoft.com/en-us/library/aa365511

--
components: Library (Lib), Windows
messages: 285299
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: islink and stat follow_symlinks are inconsistent on Windows
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

Hum, test_utf8mode lacks an unit test on the -E command line option:
PYTHONUTF8 should be ignored if -E is used.

--

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


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



[issue29249] Pathlib glob ** bug

2017-01-12 Thread Jon Walsh

New submission from Jon Walsh:

>>> from pathlib import Path
>>> Path("a/b/c/d/e.txt").match('a/*/**/*')
False

--
components: Library (Lib)
messages: 285297
nosy: Jon Walsh
priority: normal
severity: normal
status: open
title: Pathlib glob ** bug
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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-12 Thread STINNER Victor

STINNER Victor added the comment:

> Can -X utf8 option be processed before Py_Main()?

I'm trying to implement that, but it's hard to factorize the code. I will 
probably have to duplicate the code handling -E, -X utf8, PYTHONMALLOC and 
PYTHONUTF8 for wchar_t* (UCS4 or UTF-16) and char* (bytes).

--

___
Python tracker 

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



[issue29006] 2.7.13 _sqlite more prone to "database table is locked"

2017-01-12 Thread Gian-Carlo Pascutto

Gian-Carlo Pascutto added the comment:

>Then we wait for someone that really knows why the change was done in the 
>first place.

Python 2.7 had a regression compared to 2.6 where a SELECT after a COMMIT would 
silently return the wrong data:

http://bugs.python.org/issue23129
http://bugs.python.org/issue10513

Neither exiting with a locked error nor producing the wrong data are 
particularly appealing results. Did 2.6 pass those sets that caused the 
attempted fix to get backed out?

--
nosy: +Gian-Carlo Pascutto

___
Python tracker 

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



[issue29248] os.readlink fails on Windows

2017-01-12 Thread Eryk Sun

New submission from Eryk Sun:

win_readlink in Modules/posixmodule.c mistakenly treats the PrintNameOffset 
field of the reparse data buffer as a number of characters instead of bytes. 
Thus, if the offset is non-zero, the value returned is incorrect stack garbage. 
For example, the following should return "C:\\ProgramData":

>>> os.readlink(r'C:\Users\All Users')
'\u6c20\u3012\u041f\x01\u2768\u60b2\u031b\x02\x05\x00\u031e\x06\u8c01\u4012'

Craig Holmquist found this bug, as detailed in message 277385. He included a 
fix in the patch for issue 23407, but this should be addressed in the next 
maintenance release of 3.5 and 3.6.

--
components: Library (Lib), Windows
messages: 285294
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: os.readlink fails on Windows
type: behavior
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