[issue25605] fcntl doc: document exceptions raised on error for ioctl() and flock()

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d3d974e92e6f by Victor Stinner in branch '2.7':
Issue #25605: Document exceptions raised by fcntl.ioctl() and fcntl.flock()
https://hg.python.org/cpython/rev/d3d974e92e6f

New changeset f82cd1ed659e by Victor Stinner in branch '3.4':
Issue #25605: Document exceptions raised by fcntl.ioctl() and fcntl.flock()
https://hg.python.org/cpython/rev/f82cd1ed659e

New changeset cf69fe41f873 by Victor Stinner in branch '3.5':
Merge 3.4 (issue #25605)
https://hg.python.org/cpython/rev/cf69fe41f873

New changeset 0eddeb57c3d6 by Victor Stinner in branch 'default':
Merge 3.5 (issue #25605)
https://hg.python.org/cpython/rev/0eddeb57c3d6

--
nosy: +python-dev

___
Python tracker 

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



[issue25605] fcntl doc: document exceptions raised on error for ioctl() and flock()

2015-11-13 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the review.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is nothing special with glob(). By default the ls command outputs sorted 
list of files, but os.listdir() doesn't. Python is just lower-level language 
than Posix shell. You always can call sort() on result.

It is easy to just add sort() after calling os.listdir() in current glob() 
implementation. It shouldn't significantly affect performance. I would support 
this feature. But I'm planning to implement glob() with os.scandir(), and it is 
not so easy to support sorting in that implementation.

--

___
Python tracker 

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



[issue25498] Python 3.4.3 core dump with simple sample code

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Great! The patch LGTM. I left only two minor suggestions on Rietveld.

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



[issue14061] Misc fixes and cleanups in archiving code in shutil and test_shutil

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I were going to left this for other issue, but now I agree that it is 
better to left zip in unarhiving registry unconditionally.

In 2.7 the support of bztar is not conditional.

--

___
Python tracker 

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



[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

AFAIK the filesystem either counts directory references, in this case st_nlink 
>= 2, and st_nlink == 2 only for empty directory. The exception is a root 
directory, but it is not relevant. Or it doesn't count directory references, in 
this case st_nlink == 1.

--

___
Python tracker 

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



[issue25498] Python 3.4.3 regression in ctypes.frombuffer()

2015-11-13 Thread STINNER Victor

STINNER Victor added the comment:

The change 1da9630e9b7f was first published in Python 3.4.3.

--
nosy: +haypo
title: Python 3.4.3 core dump with simple sample code -> Python 3.4.3 
regression in ctypes.frombuffer()

___
Python tracker 

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



[issue25615] Document unsorted behaviour of glob.glob

2015-11-13 Thread Dave Jones

New submission from Dave Jones:

As suggested in issue 21748, this is a minor documentation change to make 
explicitly clear that glob.glob returns unsorted results (on the basis that the 
existing specification references shell behaviour which is always sorted).

--
assignee: docs@python
components: Documentation
files: glob-spec-unsorted.patch
keywords: patch
messages: 254597
nosy: Dave Jones, docs@python
priority: normal
severity: normal
status: open
title: Document unsorted behaviour of glob.glob
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file41029/glob-spec-unsorted.patch

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-13 Thread Dave Jones

Dave Jones added the comment:

As suggested, doc patch attached to new issue 25615.

--

___
Python tracker 

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



[issue21748] glob.glob does not sort its results

2015-11-13 Thread David Jones

David Jones added the comment:

The original bug report did not mention ls (note serhiy.storchaka). It is a red 
herring.

I accept that the Python community doesn't care to have glob.glob sorted.
But then I think you should distance yourself from the shell in the 
documentation.

It currently says:
"The glob module finds all the pathnames matching a specified pattern according 
to the rules used by the Unix shell"

You could say something like:
"The glob module finds all the pathnames matching a specified pattern, using a 
syntax inspired by the Unix shell; unlike Unix shell the ordering is not 
guaranteed"

--

___
Python tracker 

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



[issue25558] Use static asserts in C code

2015-11-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6598] calling email.utils.make_msgid frequently has a non-trivial probability of generating colliding ids

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps will open a separate issue for more compact non-decimal message ID.

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



[issue25601] test_cpickle failure on the ware-gentoo-x86 buildbot

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could you reproduce the failure by running tests with the same seed on these 
machines?

--

___
Python tracker 

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



[issue25616] Extract OrderedDict tests into separate file

2015-11-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

OrderedDict tests now are about 1/3 of test_collections, and I think their 
volume will grow. I suggest to extract these tests into separate file 
test_ordereddict. There are precedences: test_deque (deque also is implemented 
in C), and test_userdict, test_userlist and test_userstring (for historical 
reasons).

The main reason to me is the possibility to run quick OrderedDict tests (and 
only OrderedDict tests).

--
components: Tests
messages: 254602
nosy: eric.snow, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Extract OrderedDict tests into separate file
type: enhancement

___
Python tracker 

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



[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 52ff0c00a404 by Serhiy Storchaka in branch '3.5':
Issue #25462: The hash of the key now is calculated only once in most
https://hg.python.org/cpython/rev/52ff0c00a404

New changeset 828c9b920532 by Serhiy Storchaka in branch 'default':
Issue #25462: The hash of the key now is calculated only once in most
https://hg.python.org/cpython/rev/828c9b920532

--
nosy: +python-dev

___
Python tracker 

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



[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Raymond and Eric.

--

___
Python tracker 

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



[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue25462] Avoid repeated hash calculation in C implementation of OrderedDict

2015-11-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: commit review -> resolved

___
Python tracker 

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



[issue19023] ctypes docs: Unimplemented and undocumented features

2015-11-13 Thread Sye van der Veen

Sye van der Veen added the comment:

Signed and confirmed. :-)

On Thu, Nov 12, 2015 at 11:28 PM Martin Panter 
wrote:

>
> Martin Panter added the comment:
>
> Sye van der Veen: can you sign a contributor agreement <
> https://www.python.org/psf/contrib/contrib-form/>? I think it might be
> needed for this patch.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue25617] Installing local installation of Python

2015-11-13 Thread Koustav Pal

New submission from Koustav Pal:

The inherent behaviour of python installations (local or global) is such that 
it expects to source system wide modules from the global python installation. 

There is no non hacky way to solve this problem.

The idea of local installations is that they should be independent of 
system-wide builds. Python's behaviour contradicts this condition.

In cases where users on clusters need to maintain their own python 
installations such that these installations are independent of uncontrollable 
cluster variables, python will break on a regular basis as it tries to import 
modules from the system wide sources which were compiled on a similar python 
version but with different parameters.

Why was this express decision made to include this path in the python 
development tree? 

How can this be resolved without hacking site.py?

--
components: Installation
messages: 254606
nosy: koustavpal88
priority: normal
severity: normal
status: open
title: Installing local installation of Python
type: performance
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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-11-13 Thread Florin Papa

Florin Papa added the comment:

Hi all,

We have set up a Skylake buildbot, which could be used for MPX builds. The 
errors that appear when running regrtest are proxy related and we are looking 
into a solution for that. There is no problem for tests that do not access 
network resources.

The buildbot is available here:
http://buildbot.python.org/all/builders/x86-64%20Ubuntu%2015.10%20Skylake%20CPU%202.7

Thank you,
Florin Papa

--

___
Python tracker 

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



[issue25610] Add typing.Awaitable

2015-11-13 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue25618] gdk attribute error

2015-11-13 Thread mrudula

New submission from mrudula:

I am porting application from python 2 to python 3. Unable to import rati 
modules and local modules.

gdk is not getting imported and unable to access many module.
AttributeError: 'gi.repository.Gtk' object has no attribute 'gdk'

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 254608
nosy: mrudula
priority: normal
severity: normal
status: open
title: gdk attribute error
type: compile error
versions: Python 3.4

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-13 Thread Yury Selivanov

Yury Selivanov added the comment:

> Are you suggesting that the note should state that these two are temporary? 

Yes, that would be great.


> Or is this information available somewhere else, in What's new, for example?

Not directly, I think.  It was detailed to some extent in PEP 492.  In what's 
new of 3.5 & 3.6 it's stated that async/await will be keywords in 3.7.

--

___
Python tracker 

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



[issue25594] enum instance attribute access possible

2015-11-13 Thread Ethan Furman

Ethan Furman added the comment:

Thanks for tracking that down.

After more research I'm inclined to leave the code as it is and revamp the docs 
to clarify that while it may work, the results may not be what you want:

-- 8< ---
class Color(Enum):
red = 1
blue = 2
name = 3

print(Color.name) # Color.name
print(Color.name.blue)# Color.blue
print(Color.blue.name)# 'blue'  (not Color.name!)
-- 8< ---

Patch attached.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file41030/issue25594.stoneleaf.01.patch

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-13 Thread SilentGhost

SilentGhost added the comment:

Here is the updated wording. I'm not familiar with other such cases in the 
stdlib, if any one knows of another similar case, I'd be glad to correct the 
language to match previous usage.

--
Added file: http://bugs.python.org/file41031/issue25580_2.diff

___
Python tracker 

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



[issue25619] Exception AttributeError: "'NoneType'.... thrown on exit

2015-11-13 Thread terry

New submission from terry:

The attached code generates this output:

init called
finished init
init called
finished init
init called
finished init
initPorts done
alldone
destroying /sys/class/gpio/gpio16/
destroying /sys/class/gpio/gpio6/
Exception AttributeError: "'NoneType' object has no attribute 'path'" in > ignored
destroying /sys/class/gpio/gpio13/
Exception AttributeError: "'NoneType' object has no attribute 'path'" in > ignored

It is necessary to have two functions defined (railVarRes() and 
batleveltopct()) and further more changing the name of railVarRes to 
arailVarRes changes the behavior:


init called
finished init
init called
finished init
init called
finished init
initPorts done
alldone
destroying /sys/class/gpio/gpio16/
destroying /sys/class/gpio/gpio13/
destroying /sys/class/gpio/gpio6/
Exception AttributeError: "'NoneType' object has no attribute 'path'" in > ignored


notice that the order of the class destruction has changed.

--
files: bug.py
messages: 254612
nosy: Terry Garyet
priority: normal
severity: normal
status: open
title: Exception AttributeError: "'NoneType'  thrown on exit
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41032/bug.py

___
Python tracker 

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



[issue25620] Bytes Issue

2015-11-13 Thread Marios Kourtesis

New submission from Marios Kourtesis:

Hello,

Executing the following code in a Python2 interpreter the result is True while 
running the same code in Python3 is False. I tested this in Python version 
2.7.10 and 3.4.2.

a = b'a'
b = b'b'
c = a+b
c[1] == b'b'

When I call type(c[1]) in Python2 I get str:

type(c[1])


While in Python3 I get int:
type(c[1])


Is this the expected behavior?

--
components: Interpreter Core
messages: 254613
nosy: Marios Kourtesis
priority: normal
severity: normal
status: open
title: Bytes Issue
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue25620] Bytes Issue

2015-11-13 Thread SilentGhost

SilentGhost added the comment:

Yes. It follows from definition of bytes in python3 
https://docs.python.org/3/library/functions.html#bytes

Some useful information is also available in 3.0 release notes: 
https://docs.python.org/3/whatsnew/3.0.html#text-vs-data-instead-of-unicode-vs-8-bit

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



[issue25618] gdk attribute error

2015-11-13 Thread R. David Murray

R. David Murray added the comment:

Your report does not indicate a bug in python or its standard library, which is 
what this tracker is for.  You are more likely to find help with your issues on 
the python-list mailing list.

--
nosy: +r.david.murray
resolution:  -> third party
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



[issue25619] Exception AttributeError: "'NoneType'.... thrown on exit

2015-11-13 Thread R. David Murray

R. David Murray added the comment:

Yes, python2 shutdown has this problem: modules and their attributes are set to 
None during interpreter shutdown.  Things are much better in python3.  If you 
want to avoid the error messages, finalize the objects explicitly (making sure 
to break gc cycles) before the end of your program, or keep explicit references 
to the objects you need during __del__ (eg: os_path = os.path in the global 
scope of your module).

As for your last comment, you are correct, the GC cleanup order is not 
deterministic.

--
nosy: +r.david.murray
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



[issue25619] Exception AttributeError: "'NoneType'.... thrown on exit

2015-11-13 Thread R. David Murray

R. David Murray added the comment:

Best practice, by the way, is to be explicit about the scope of any resource 
and clean it up before program end...this is often done by using the context 
manager protocol.

--

___
Python tracker 

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



[issue25616] Extract OrderedDict tests into separate file

2015-11-13 Thread Eric Snow

Eric Snow added the comment:

FWIW, I totally support this.  I originally had a patch up that did so but 
Raymond indicated that he'd rather not split the tests out though I made 
exactly the same arguments that you have.  Perhaps he's changed his mind in the 
intervening years (or I misunderstood his objections)? :)

--

___
Python tracker 

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



[issue25621] ast.literal_eval() fails on docstrings

2015-11-13 Thread Maxime Chambreuil

New submission from Maxime Chambreuil:

ast.literal_eval fails when there is docstrings in the file.

I used the file attached and this code in our CI server:

def is_installable_module(path):
"""return False if the path doesn't contain an installable odoo module,
and the full path to the module manifest otherwise"""
manifest_path = is_module(path)
if manifest_path:
manifest = ast.literal_eval(open(manifest_path).read())
if manifest.get('installable', True):
return manifest_path
return False

I get the following error message:
Traceback (most recent call last):

  File "/home/travis/maintainer-quality-tools/travis/test_flake8", line 14, in 


for addon in get_modules(os.path.abspath('.')):

  File "/home/travis/maintainer-quality-tools/travis/getaddons.py", line 53, in 
get_modules

if is_installable_module(os.path.join(path, x))]

  File "/home/travis/maintainer-quality-tools/travis/getaddons.py", line 38, in 
is_installable_module

manifest = ast.literal_eval(open(manifest_path).read())

  File "/usr/lib/python2.7/ast.py", line 49, in literal_eval

node_or_string = parse(node_or_string, mode='eval')

  File "/usr/lib/python2.7/ast.py", line 37, in parse

return compile(source, filename, mode, PyCF_ONLY_AST)

  File "", line 22

{

^

SyntaxError: invalid syntax


https://github.com/OCA/knowledge/pull/75
https://github.com/OCA/maintainer-quality-tools/blob/master/travis/getaddons.py#L33
https://travis-ci.org/OCA/knowledge/jobs/90332842

--
components: Interpreter Core
files: __openerp__.py
messages: 254619
nosy: Maxime Chambreuil
priority: normal
severity: normal
status: open
title: ast.literal_eval() fails on docstrings
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file41033/__openerp__.py

___
Python tracker 

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



[issue25621] ast.literal_eval() fails on docstrings

2015-11-13 Thread Maxime Chambreuil

Maxime Chambreuil added the comment:

If I remove the docstrings on the first line, ast.literal_eval() does not fail.

--

___
Python tracker 

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



[issue25621] ast.literal_eval() fails on docstrings

2015-11-13 Thread SilentGhost

SilentGhost added the comment:

It doesn't seem docstring-specific, docstring is a regular Python object and 
ast.literal_eval would fail if you have more than one literals of any kind. Put 
two integers in your file and the literal_eval will fail.

--
nosy: +SilentGhost, benjamin.peterson, georg.brandl

___
Python tracker 

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



[issue25621] ast.literal_eval() fails on docstrings

2015-11-13 Thread R. David Murray

R. David Murray added the comment:

Yes, literal_eval only evaluates a single literal, as is documented.

--
nosy: +r.david.murray
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



[issue25622] Enable ctypes.test.test_values.Win_ValuesTestCase for non-Windows

2015-11-13 Thread Martin Panter

New submission from Martin Panter:

In /Lib/ctypes/test/test_values.py, three out of the five test cases are only 
run on Windows. There is a comment saying “This test only works when python 
itself is a dll/shared library”, and the tests run fine on Linux. So I propose 
to remove the Windows-only restriction, and rename the class from 
Win_ValuesTestCase to PythonValuesTestCase.

The immediate benefit for me is that I can see on Linux when I need to update 
one of those tests before I break a Windows builtbot :)

This test used to be completely disabled (probably by accident), and was 
enabled for Windows only in revision 6f63fff5c120. There was a comment 
 by Zach wondering if it 
shouldn’t be Windows-specific.

--
components: Tests, ctypes
files: python-values.patch
keywords: patch
messages: 254623
nosy: martin.panter, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Enable ctypes.test.test_values.Win_ValuesTestCase for non-Windows
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41034/python-values.patch

___
Python tracker 

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



[issue25074] Bind logger and waninigs modules for asyncio __del__ methods

2015-11-13 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Yes, the approach use hackery shadows for binding global variables on shutdown 
stage.
The same I've found in subprocess module: see 
https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1544

The problem is: I want to inform users about unclosed resources.
Printouts like
`TypeError: 'NoneType' object is not callable`
or 
`AttributeError: 'NoneType' object has no attribute 'warn'` are too confusing 
for casual developer.

On shutdown logger and warnings modules may be destroyed at the moment of 
__del__ call, so `warnings.warn`, `loop.call_exception_handler` etc. are 
forbidden.

As an option we can add atexit handler to store shutdown flag into loop object 
(I don't know other way to get info is interpreter in shutdown or not).

According to the flag we can eihter print some short text about non-closed 
resources or raise proper ResourceWarning along with comprehensive logging with 
stacktrace if PYTHONASYNCIO is on.

Maybe I've missed something and you can suggest better solution.

--

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

Seems to have broken the SSL module. Looks like you typoed “dps” as “dsp” in 
some conditional code.

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.4/builds/1326/steps/compile/logs/stdio

building '_ssl' extension
gcc -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes 
-Werror=declaration-after-statement -I./Include -I. -IInclude 
-I/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Include 
-I/Users/buildbot/buildarea/3.4.murray-snowleopard/build -c 
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c -o 
build/temp.macosx-10.6-x86_64-3.4-pydebug/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.o
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c: In 
function ‘_get_crl_dp’:
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c:1084: 
error: ‘dsp’ undeclared (first use in this function)
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c:1084: 
error: (Each undeclared identifier is reported only once
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c:1084: 
error: for each function it appears in.)
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c: In 
function ‘_setup_ssl_threads’:
/Users/buildbot/buildarea/3.4.murray-snowleopard/build/Modules/_ssl.c:3828: 
warning: comparison is always false due to limited range of data type

--
nosy: +martin.panter
status: closed -> open
versions: +Python 3.4

___
Python tracker 

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



[issue25569] Memory leak in SSLSocket.getpeercert()

2015-11-13 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-13 Thread Neil Schemenauer

Neil Schemenauer added the comment:

So what happens for the filesystems that doesn't count '.' and '..'?  It looks 
to me like if there are exactly two messages in a folder then the revised code 
will return [] (i.e. it will think the folder is empty).  Probably we should 
revise the unit test to make a folder with two messages.

--

___
Python tracker 

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



[issue24821] The optimization of string search can cause pessimization

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch makes the degenerate case less hard while preserves the 
optimization for common case.

$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.find("є")'
1000 loops, best of 3: 330 usec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.rfind("є")'
1000 loops, best of 3: 325 usec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'
100 loops, best of 3: 7.81 msec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.rfind("Є")'
100 loops, best of 3: 8.5 msec per loop

$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.find("є")'
1000 loops, best of 3: 317 usec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.rfind("є")'
1000 loops, best of 3: 327 usec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.find("Є")'
1000 loops, best of 3: 1.1 msec per loop
$ ./python -m timeit -s 's = "АБВГД"*10**5' -- 's.rfind("Є")'
1000 loops, best of 3: 964 usec per loop

The slowdown is decreased from 25 times to 3 times.

The idea is that after memchr found false positive, make a tens iterations of 
simple loop before calling memchr again. This splits the cost of the memchr 
call with a tens of characters.

The patch also makes a little refactoring. STRINGLIB(fastsearch_memchr_1char) 
now is renamed and split on two functions STRINGLIB(find_char) and 
STRINGLIB(rfind_char) with simpler interface. All preconditional checks are 
moved into these functions. These functions now are directly used in other 
files.

--
keywords: +patch
resolution: remind -> 
stage: needs patch -> patch review
Added file: http://bugs.python.org/file41035/find_char.patch

___
Python tracker 

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



[issue25498] Python 3.4.3 regression in ctypes.frombuffer()

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9b23f7a94ba9 by Martin Panter in branch '3.4':
Issue #25498: Fix GC crash due to ctypes objects wrapping a memoryview
https://hg.python.org/cpython/rev/9b23f7a94ba9

New changeset 7445de785670 by Martin Panter in branch '3.5':
Issue #25498: Merge ctypes crash fix from 3.4 into 3.5
https://hg.python.org/cpython/rev/7445de785670

New changeset deb0fb601191 by Martin Panter in branch '3.5':
Issue #25498: Update error message for 3.5
https://hg.python.org/cpython/rev/deb0fb601191

New changeset f3dba13c22e5 by Martin Panter in branch 'default':
Issue #25498: Merge ctypes crash fix from 3.5
https://hg.python.org/cpython/rev/f3dba13c22e5

New changeset 08c56962c24c by Martin Panter in branch 'default':
Issue #25498: Add NEWS entry for 3.6
https://hg.python.org/cpython/rev/08c56962c24c

--
nosy: +python-dev

___
Python tracker 

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



[issue25583] os.makedirs with exist_ok=True raises PermissionError on Windows 7^

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

New patch with simpler test case and revised NEWS entry

--
Added file: http://bugs.python.org/file41036/makedirs-exist.2.patch

___
Python tracker 

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



[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

2015-11-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

st_nlink is not related to the number of messages in a folder. It is a number 
of hard links.

If the filesystem supports hard links counting for directories, every directory 
(except /) has at least two links: one from its parent directory, and one from 
itself (via "."). Every subdirectory adds yet one hard link via "..". 
Non-directory files don't create hard links.

Typical mail folder can contain thousands of messages and none or only a few 
subfolders. Subfolders (if there are any) usually are created before messages 
and hence encountered first in directory listing. Hereby the optimization can 
have significant effect.

If there is a real case when st_nlink != 1 and is less then a number of 
subdirectories + 2, we should consider removing the optimization.

--

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

Will they really be removed? What are the compatibility implications? Maybe it 
would be better to alias them to NAME, or keep them as unused values.

--

___
Python tracker 

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



[issue25580] async and await missing from token list

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

My only background here is via the tokenize module, which seems to currently 
behave as described in 
: async and await 
are either NAME tokens (like ordinary identifiers and other reserved keywords) 
outside a coroutine definition, but they become special ASYNC and AWAIT tokens 
inside a coroutine.

--

___
Python tracker 

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



[issue25498] Python 3.4.3 regression in ctypes.frombuffer()

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

Thanks to the various people that helped report and solve this.

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



[issue13940] imaplib: Mailbox names are not quoted

2015-11-13 Thread Maciej Szulik

Maciej Szulik added the comment:

>From imaplib.IMAP4 class description we're stating to quote parameters if 
>necessary. This patch adds that capability according to 
>https://tools.ietf.org/html/rfc3501#section-5.1

--
keywords: +patch
Added file: http://bugs.python.org/file41037/issue13940.patch

___
Python tracker 

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



[issue25615] Document unsorted behaviour of glob.glob

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

Looks good to me. Also worth applying to earlier versions I think.

--
nosy: +martin.panter
stage:  -> patch review
versions: +Python 2.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



[issue25620] Bytes Issue

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

More up-to-date information about the differences might be 
. If 
you want code that works in both versions, I find it simpler to use slicing: 
c[1:2] == b'b'.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 92f989bfeca2 by Martin Panter in branch '3.4':
Issue #25590: Make rlcompleter only call getattr() once per attribute
https://hg.python.org/cpython/rev/92f989bfeca2

New changeset 808279e14700 by Martin Panter in branch '3.5':
Issue #25590: Merge rlcompleter change from 3.4 into 3.5
https://hg.python.org/cpython/rev/808279e14700

New changeset ff68304356fe by Martin Panter in branch 'default':
Issue #25590: Merge rlcompleter getattr change from 3.5
https://hg.python.org/cpython/rev/ff68304356fe

New changeset bbf63749a129 by Martin Panter in branch 'default':
Issue #25590: Complete attribute names even if they are not yet created
https://hg.python.org/cpython/rev/bbf63749a129

--
nosy: +python-dev

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7bc8f56ef1f3 by Martin Panter in branch '2.7':
Issue #25017: Document that htmllib is superseded by module HTMLParser
https://hg.python.org/cpython/rev/7bc8f56ef1f3

--
nosy: +python-dev

___
Python tracker 

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



[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16d83e11675f by Martin Panter in branch '2.7':
Issue #25590: Make rlcompleter only call getattr() once per attribute
https://hg.python.org/cpython/rev/16d83e11675f

--

___
Python tracker 

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-11-13 Thread Martin Panter

Changes by Martin Panter :


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



[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Martin Panter

Martin Panter added the comment:

I also ported the getattr patch to the 2.7 branch.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed
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



[issue25590] tab-completition on instances repeatedly accesses attribute/descriptors values

2015-11-13 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks for taking care of this!

--

___
Python tracker 

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



[issue25619] Exception AttributeError: "'NoneType'.... thrown on exit

2015-11-13 Thread terry

terry added the comment:

My real application (not this example code that also 'breaks') is a battery 
monitor that starts at boot time and only exits when the battery is near death. 

So there is effectively a while(batlevelgood) loop that polls the battery level 
and doesn't exit until  near battery death.

I only encounters this while debugging and having to kill (ctrl-c) the script, 
having no chance to clean up properly.

Admittedly I'm not very experienced in Python but I am an experienced 
programmer.  I will look up context mgr protocol, but this was certainly odd 
behavior.  It isn't every day that the name of a  function not even called 
changes observed program behavior.

Terry

> On Nov 13, 2015, at 1:42 PM, R. David Murray  wrote:
> 
> 
> R. David Murray added the comment:
> 
> Best practice, by the way, is to be explicit about the scope of any resource 
> and clean it up before program end...this is often done by using the context 
> manager protocol.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--
title: Exception AttributeError: "'NoneType'  thrown on exit -> Exception 
AttributeError: "'NoneType' thrown on exit

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2015-11-13 Thread A. Jesse Jiryu Davis

Changes by A. Jesse Jiryu Davis :


--
nosy: +emptysquare

___
Python tracker 

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