[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch. I left two review comments about unused variables on 
Rietveld.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue26897] Clarify Popen stdin, stdout, stderr

2016-04-30 Thread Yclept Nemo

New submission from Yclept Nemo:

From: https://docs.python.org/dev/library/subprocess.html#popen-constructor

"..., an existing file descriptor (a positive integer), an existing file 
object, and None."

It should be made clear that the file object must be backed by an operating 
system file, i.e. must have a valid file descriptor.

As it stands, the documentation suggests implicit concurrency: that any file 
object can be used, and on read/write from the subprocess/OS arbitrary python 
code will be executed, i.e. the python interpreter is pre-empted or python 
spawns a hidden I/O thread.

Anyway, I'm pretty sure subprocess.Popen() just redirects the forked process' 
stdout/stdin/stderr to the file descriptors from the provided file object.

--
assignee: docs@python
components: Documentation
messages: 264579
nosy: Yclept.Nemo, docs@python
priority: normal
severity: normal
status: open
title: Clarify Popen stdin, stdout, stderr
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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-04-30 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +brett.cannon
stage:  -> patch review

___
Python tracker 

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



[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-30 Thread Meador Inge

Meador Inge added the comment:

Fixed.

Thank y'all for the patch and help with testing.

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



[issue24114] ctypes.utils uninitialized variable 'paths'

2016-04-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 57bf7a40925f by Meador Inge in branch '2.7':
Issue #24114: Fix an uninitialized variable in `ctypes.util`.
https://hg.python.org/cpython/rev/57bf7a40925f

New changeset db5baad7ad69 by Meador Inge in branch '3.5':
Issue #24114: Fix an uninitialized variable in `ctypes.util`.
https://hg.python.org/cpython/rev/db5baad7ad69

New changeset 5b5fbce1db9c by Meador Inge in branch 'default':
Issue #24114: Fix an uninitialized variable in `ctypes.util`.
https://hg.python.org/cpython/rev/5b5fbce1db9c

--
nosy: +python-dev

___
Python tracker 

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



[issue22005] datetime.__setstate__ fails decoding python2 pickle

2016-04-30 Thread Torsten Bronger

Changes by Torsten Bronger :


--
nosy: +bronger

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-04-30 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file42668/patchedCPythonTestOutput.txt

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-04-30 Thread Oren Milman

Changes by Oren Milman :


Added file: http://bugs.python.org/file42667/CPythonTestOutput.txt

___
Python tracker 

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



[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-04-30 Thread Oren Milman

New submission from Oren Milman:

the proposed changes:
1. it seems there is some mix-up with the terms 'importer' and 'finder' (and 
rarely also 'loader') in the import system and in related code (I guess most of 
it is just relics from the time before PEP 302).
The rational is simply https://docs.python.org/3/glossary.html#term-importer, 
which means (as I understand it) that the only place where 'importer' is 
appropriate is where the described object is guaranteed to be both a finder and 
loader object (i.e. currently only any of the following: BuiltinImporter, 
FrozenImporter, ZipImporter, mock_modules, mock_spec, TestingImporter).

Note: At first I pondered about also changing local variable names and even the 
name of a static C function, so I posted a question to the core-mentorship 
mailing list, and ultimately accepted (of course) the answer - 
https://mail.python.org/mailman/private/core-mentorship/2016-April/003541.html 
- fix only docs.

these proposed changes are in the following files:
- Python/import.c (also changed the line saying that get_path_importer 
returning None tells the caller it should fall back to the built-in import 
mechanism, as it is no longer true, according to 
https://docs.python.org/3/reference/import.html#path-entry-finders. As I 
understand it, the last is indeed the right one)
- Doc/c-api/import.rst (also changed the parallel doc of the aforementioned 
comment in Python/import.c)
- Lib/pkgutil.py
- Doc/Library/pkgutil.rst
- Lib/runpy.py (also changed the function comment of _get_module_details, 
which specified wrong return values)
- Lib/test/test_pkgutil.py


2. While scanning every CPython file that contains the string 'importer', 
Anaconda (a Sublime Package for Python) found two local variable assignments 
which were never used. I commented both out (and added a comment stating why). 
I would be happy to change those two tiny fixes if needed. 

these proposed changes are in the following files:
- Lib/test/test_importlib/import_/test_meta_path.py
- Lib/test/test_importlib/util.py


diff:
The patches diff is attached.


tests:
I built the changed *.rst files, and they looked fine.

I played a little with the interpreter, and everything worked as usual.
In addition, I run 'python -m test' (on my 64-bit Windows 10) before and after 
applying the patch, and got quite the same output.
the outputs of both runs are attached.

--
components: Library (Lib)
files: issue.diff
keywords: patch
messages: 264576
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: mix-up with the terms 'importer', 'finder', 'loader' in the import 
system and related code
versions: Python 3.6
Added file: http://bugs.python.org/file42666/issue.diff

___
Python tracker 

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



[issue1944] Document PyUnicode_* API

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyUnicode_DecodeCodePageStateful

Following functions likely should be wrapped with "#ifndef Py_LIMITED_API":

_PyUnicode_ClearStaticStrings
_PyUnicode_EQ
_PyUnicode_FromId

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue26822] itemgetter/attrgetter/methodcaller objects ignore keyword arguments

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> 2) my attempt caused a crash.

I found an error in my attempt. Here is a patch that correctly define macros 
for _PyArg_NoKeywords and _PyArg_NoPositional micro-optimization.

I don't know wherever it is worth to push it.

--

___
Python tracker 

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



[issue18688] Document undocumented Unicode object API

2016-04-30 Thread Berker Peksag

Changes by Berker Peksag :


--
superseder:  -> Document PyUnicode_* API

___
Python tracker 

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



[issue10435] Document unicode C-API in reST

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 1944.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Document PyUnicode_* API

___
Python tracker 

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



[issue18688] Document undocumented Unicode object API

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 1944.

--
nosy: +berker.peksag
resolution:  -> duplicate
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



[issue1944] Document PyUnicode_* API

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

Remaining undocumented functions:

>From this issue:

PyUnicode_RSplit
PyUnicode_Partition
PyUnicode_RPartition

>From issue 10435:

PyUnicode_IsIdentifier
PyUnicode_Append
PyUnicode_AppendAndDel
PyUnicode_GetDefaultEncoding
PyUnicode_FromOrdinal
PyUnicode_Resize
PyUnicode_GetMax
PyUnicode_InternImmortal
PyUnicode_CHECK_INTERNED

>From issue 18688:

Py_UNICODE_REPLACEMENT_CHARACTER
PyUnicodeIter_Type
PyUnicode_AsDecodedObject
PyUnicode_AsDecodedUnicode
PyUnicode_AsEncodedObject
PyUnicode_AsEncodedUnicode
PyUnicode_BuildEncodingMap

--
keywords:  -easy
nosy: +berker.peksag
stage:  -> needs patch
title: Documentation for PyUnicode_AsString (et al.) missing. -> Document 
PyUnicode_* API
versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue26877] tarfile use wrong code when read from fileobj

2016-04-30 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Please give us some example test code that shows us what goes wrong exactly.

--

___
Python tracker 

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



[issue26877] tarfile use wrong code when read from fileobj

2016-04-30 Thread Марк Коренберг

Марк Коренберг added the comment:

Well, there are  more than one workarounds for that.

man read:
===
If a read() is interrupted by a signal after it has successfully read some 
data, it shall return the number of bytes read.
=

So, this is a way how to make "exploit" for this bug.

--

___
Python tracker 

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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-04-30 Thread Ethan Furman

Ethan Furman added the comment:

Thanks for catching that.

--

___
Python tracker 

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



[issue26711] Fix comparison of plistlib.Data

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ronald, my second patch uses "==" instead of __eq__. Is it good to you?

--

___
Python tracker 

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



[issue26892] debuglevel not honored in urllib

2016-04-30 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Patch for the test.

--
Added file: http://bugs.python.org/file42665/urllib_debuglevel_test.patch

___
Python tracker 

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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-04-30 Thread Xiang Zhang

Changes by Xiang Zhang :


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +modulefinder should reuse the dis module

___
Python tracker 

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



[issue26895] regex matching on bytes considers zero byte as end

2016-04-30 Thread Tim Peters

Tim Peters added the comment:

Do note that `.match()` is constrained to match starting at the first byte.  
`.search()` is not (it can start matching at any position), and your example 
works fine if `.search()` is used instead.

This is all expected, and intended, and documented.

--
nosy: +tim.peters

___
Python tracker 

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



[issue21746] urlparse.BaseResult no longer exists

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch, Matthew. Python 3 documentation has already been updated.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue21746] urlparse.BaseResult no longer exists

2016-04-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6d49a7330c99 by Berker Peksag in branch '2.7':
Issue #21746: Remove BaseResult reference from urlparse documentation
https://hg.python.org/cpython/rev/6d49a7330c99

--
nosy: +python-dev

___
Python tracker 

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



[issue26895] regex matching on bytes considers zero byte as end

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no bug.

The pattern b'a' matches bytes that starts with byte 97 (ord(b'a')), but 
b'\x00abc' starts with byte 0.

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



[issue23897] Update Python 3 extension module porting guide

2016-04-30 Thread Berker Peksag

Changes by Berker Peksag :


--
components: +Documentation
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue26895] regex matching on bytes considers zero byte as end

2016-04-30 Thread Simmo Saan

New submission from Simmo Saan:

Regex functions on bytes consider zero byte as end and stop matching at that 
point. This is completely nonsensical since python has no problems working with 
zero bytes otherwise.

For example:
  Matches as expected: re.match(b'a', b'abc')
  Does not match unexpectedly: re.match(b'a', b'\x00abc')

--
components: Regular Expressions
messages: 264561
nosy: Simmo Saan, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: regex matching on bytes considers zero byte as end
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



[issue14882] Link/Compile Error on Sun Sparc Solaris10 with gcc3.4.3----python2.6.8

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

> From some website, I was told that this is caused by a fault of Solaris's gcc.

Closing as 'not a bug' since this isn't an issue with Python. Also, 2.6 is now 
EOL.

--
nosy: +berker.peksag
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



[issue26894] Readline not aborting line edition on sigint

2016-04-30 Thread Memeplex

New submission from Memeplex:

Maybe this is just a bug in ipython but as it's closely related to 
http://bugs.python.org/issue23735 I'm reporting it here too, just in case.

-- My original report to bug-readline:

using readline with ipython 4.1.2 and the TkAgg (or GTK3Agg)
backend for matplotlib, I observed the following behavior:

1) open ipython in pylab mode (ipython --pylab or use the %pylab magic once 
inside the repl).

2) Type something.

3) Press Ctrl-C: line edition is not aborted as expected.

-- And this was Chet answer:

This is probably the result of the same signal handling issues as with
SIGWINCH that we discussed a little more than a year ago. Readline
catches the signal, sets a flag, and, when it's safe, resends it to the
calling application. It expects that if the calling application catches
SIGINT, it will take care of cleaning up the readline state. Sometimes
applications don't want to kill the current line on SIGINT.
Notice it doesn't happen with the Qt5Agg backend.

--
components: Extension Modules
messages: 264559
nosy: memeplex
priority: normal
severity: normal
status: open
title: Readline not aborting line edition on sigint
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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I found bugs in peephole.c. I have published my comments on Rietveld, but 
reviewing peephole.c is still not finished.

--

___
Python tracker 

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



[issue26892] debuglevel not honored in urllib

2016-04-30 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Hi Chi Hsuan,

The patch looks good to me. Additional tests for the coverage of this will be 
helpful too. Thanks!

--
nosy: +orsenthil

___
Python tracker 

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



[issue23960] PyErr_SetImportError doesn't clean up on some errors

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

Looks like 2545bfe0d273 (issue 23486) is the culprit.

--
keywords: +3.5regression
nosy: +berker.peksag
stage:  -> needs patch
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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-04-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Library (Lib)
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue26864] urllib.request no_proxy check differs from curl

2016-04-30 Thread Martin Panter

Changes by Martin Panter :


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



[issue26893] ValueError exception raised when using IntEnum with an attribute called "name" and @unique decorator

2016-04-30 Thread Julien Enche

New submission from Julien Enche:

The linked file fails with the following error :
ValueError: duplicate values found in : id -> User.name, name -> 
User.name

This exception was not raised with Python 3.4.

--
files: enumtest.py
messages: 264554
nosy: Julien Enche
priority: normal
severity: normal
status: open
title: ValueError exception raised when using IntEnum with an attribute called 
"name" and @unique decorator
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file42664/enumtest.py

___
Python tracker 

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



[issue26891] CPython doesn't work when you disable refcounting

2016-04-30 Thread Larry Hastings

Larry Hastings added the comment:

Here is my theory: if the code asserts that it's true, and the code normally 
runs fine, then it's normally true, and therefore I can remove the assertion 
and the code will run correctly.  I haven't hit that assertion in the peephole 
optimizer.  But I have assertions turned off.

The checks in unicode / set / bytes (maybe) were not regulated by _NDEBUG, they 
were unconditional "if (refcnt != 1) BadInternalCall();" code.

--

___
Python tracker 

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



[issue23960] PyErr_SetImportError doesn't clean up on some errors

2016-04-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the patch. I left review comments on Rietveld (click to the review 
link above).

--
nosy: +berker.peksag
stage:  -> patch review
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



[issue24887] Sqlite3 has no option to provide open flags

2016-04-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

IMO this issue can be closed as the URI filename interface can be used instead 
of the flags. The URI interface parameters can override the flags given as 
specified in:
https://www.sqlite.org/c3ref/open.html

--
nosy: +palaviv

___
Python tracker 

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



[issue26891] CPython doesn't work when you disable refcounting

2016-04-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Just now I'm reading the code of the peephole optimizer, and it contains such 
assertion since it modifies the lnotab bytes array in-place. May be there are 
other similar cases.

--

___
Python tracker 

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



[issue26187] sqlite3 trace callback prints duplicate line

2016-04-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

This issue will be resolved when we change the sqlite3_prepare to 
sqlite3_prepare_v2. So there should be a dependency on issue 9303.

--

___
Python tracker 

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



[issue9303] Migrate sqlite3 module to _v2 API to enhance performance

2016-04-30 Thread Aviv Palivoda

Aviv Palivoda added the comment:

I made a new patch to fix this issue. I left a fallback to the old API as Jim 
suggested. In addition to the changes in Robin`s patch I changed sqlite3_close 
to sqlite3_close_v2 if available.

This solves issue 26187 as well.

--
nosy: +palaviv
Added file: http://bugs.python.org/file42663/9303.patch

___
Python tracker 

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



[issue26892] debuglevel not honored in urllib

2016-04-30 Thread Chi Hsuan Yen

New submission from Chi Hsuan Yen:

The following test program:

import sys
try:
import urllib.request as urllib_request
except:
import urllib2 as urllib_request

print(sys.version)

handler = urllib_request.HTTPSHandler(debuglevel=1)
opener = urllib_request.build_opener(handler)
print(opener.open('https://httpbin.org/user-agent').read().decode('utf-8'))

Works as expected in Python 2:
$ python2 test_urllib_debuglevel.py
2.7.11 (default, Mar 31 2016, 06:18:34) 
[GCC 5.3.0]
send: 'GET /user-agent HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: 
httpbin.org\r\nConnection: close\r\nUser-Agent: Python-urllib/2.7\r\n\r\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: Server: nginx
header: Date: Sat, 30 Apr 2016 10:02:32 GMT
header: Content-Type: application/json
header: Content-Length: 40
header: Connection: close
header: Access-Control-Allow-Origin: *
header: Access-Control-Allow-Credentials: true
{
  "user-agent": "Python-urllib/2.7"
}

But the verbose output is unavailable in Python 3.x:
$ ./python test_urllib_debuglevel.py
3.6.0a0 (default:1ceb91974dc4, Apr 30 2016, 17:44:57) 
[GCC 5.3.0]
{
  "user-agent": "Python-urllib/3.6"
}

Patch attached.

--
components: Library (Lib)
files: urllib_debuglevel.patch
keywords: patch
messages: 264547
nosy: Chi Hsuan Yen
priority: normal
severity: normal
status: open
title: debuglevel not honored in urllib
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file42662/urllib_debuglevel.patch

___
Python tracker 

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



[issue26891] CPython doesn't work when you disable refcounting

2016-04-30 Thread Larry Hastings

Larry Hastings added the comment:

I did as you suggested.  I also discovered that _Py_NewReference is usually a 
macro, and I'd only fixed the version in Objects/object.c (the one not being 
used).  When I fixed both those things, and switched the makefile so it uses a 
different Python interpreter in the build itself, it builds successfully.  The 
interpreter doesn't run though.

The next problem: there are a couple of spots where code asserts the refcount 
of an object must == 1.  This is so they can modify the object in-place.  This 
is usually a sanity-check, so I assume the code knows what it's doing, so I 
removed the refcount assertion.  I did this two or three times: set, unicode, 
and (maybe) bytes.

Now it's segfaulting in lookdict_unicode_nodummy().  mp->ma_keys looks like 
garbage, the keys it refers to are invalid addresses.  I'd be very happy to 
post my patch if someone else wanted to try debugging it.

--

___
Python tracker 

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



[issue26807] mock_open()().readline() fails at EOF

2016-04-30 Thread Yolanda

Yolanda added the comment:

How about...

@@ -2339,9 +2339,12 @@ def mock_open(mock=None, read_data=''):
 if handle.readline.return_value is not None:
 while True:
 yield handle.readline.return_value
-for line in _state[0]:
-yield line
 
+try:
+while True:
+yield next(_state[0])
+except StopIteration:
+yield ''

--

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-04-30 Thread Michael Felt

Michael Felt added the comment:

Question - before I submit a patch.

A. Is there a PEP I should read re: ctypes/util and/or ctypes/cdll?

B. I show two different behaviors of responding - My question is, what does the 
community think should be the response? My preference is to bring the request 
back to it's stub - (strip lib from the beginning, and .so* or .a from the 
suffix, so that it is in it's -lFOO form - as if being offered to a linker 
(with -lFOO, we do not use -lFOO.so.6 (e.g., for libc.so.6).
I have seen a lot of variance in how cdll is used (in only two python based 
projects I am currently interested in porting). Calls are frequently made using 
some variation including .so somewhere in the name and/or code is basing 
decesions based on a the number (###) returned by find_library (e.g., 
libFOO.so.###, and ### MUST be one of a list - and is rejected if not a match 
(even if newer)). I would think if there is a version dependancy this should be 
a call to the library loaded rather than an external string.
In any case, - for one example - as libc.so.* will never exist, by default, on 
AIX, for ease of use I believe that translating libFOO.* to FOO and then doing 
the 'find' comes closest to what was intended (long long ago) - again, is there 
a PEP with guidance on this AND my preference, for AIX, is to look in .a 
archives first for a .so member, and then look for an AIX legacy member 
(shr.*.o) and then look for an external .so.* file.

With my current working version - this is the output of the test in util.py:

root@x064:[/data/prj/aixtools/python/python-2.7.11.3/Lib/ctypes]../../python 
./util.py
libm.a
libc.a
libbz2.a


libcrypt.a

Additional Tests for AIX
call find_library("foo")
c:  libc.a
c.a:  None
c.so:  None
libc:  libc.a
libc.a:  libc.a
libc.so.6:  libc.a
crypt:  libcrypt.a
crypto:  libcrypto.a
crypto.so:  None
libcrypto.so:  libcrypto.a

call cdll.LoadLibrary("foo")
m:  
libm.so:  
c:  
c.a:  
libc.a:  
libc.so.6:  
libc.so.9:  
bz2:  
libbz2:  
crypt:  
crypto:  
crypto.so:  
libcrypto.so:  
iconv:  
intl:  

The test looks like:

# test code

def test():
from ctypes import cdll
if os.name == "nt":
print cdll.msvcrt
print cdll.load("msvcrt")
print find_library("msvcrt")

if os.name == "posix":
# find and load_version
print find_library("m")
print find_library("c")
print find_library("bz2")

# getattr
##print cdll.m
##print cdll.bz2

# load
if sys.platform == "darwin":
print cdll.LoadLibrary("libm.dylib")
print cdll.LoadLibrary("libcrypto.dylib")
print cdll.LoadLibrary("libSystem.dylib")
print cdll.LoadLibrary("System.framework/System")
else:
print cdll.LoadLibrary("libm.so")
print cdll.LoadLibrary("libcrypt.so")
print find_library("crypt")

if sys.platform.startswith("aix"):
print "\nAdditional Tests for AIX"
print "call find_library(\"foo\")"
print "c: ", find_library("c")
print "c.a: ", find_library("c.a")
print "c.so: ", find_library("c.so")
print "libc: ", find_library("libc")
print "libc.a: ", find_library("libc.a")
print "libc.so.6: ", find_library("libc.so.6")
print "crypt: ", find_library("crypt")
print "crypto: ", find_library("crypto")
print "crypto.so: ", find_library("crypto.so")
print "libcrypto.so: ", find_library("libcrypto.so")
###
print "\ncall cdll.LoadLibrary(\"foo\")"
print "m: ", cdll.LoadLibrary("m")
print "libm.so: ", cdll.LoadLibrary("libm.so")
print "c: ", cdll.LoadLibrary("c")
print "c.a: ", cdll.LoadLibrary("c.a")
print "libc.a: ", cdll.LoadLibrary("libc.a")
print "libc.so.6: ", cdll.LoadLibrary("libc.so.6")
print "libc.so.9: ", cdll.LoadLibrary("libc.so.9")
print "bz2: ", cdll.LoadLibrary("bz2")
print "libbz2: ", cdll.LoadLibrary("libbz2")
print "crypt: ", cdll.LoadLibrary("crypt")
print "crypto: ", cdll.LoadLibrary("crypto")
print "crypto.so: ", cdll.LoadLibrary("crypto.so")
print "libcrypto.so: ", cdll.LoadLibrary("libcrypto.so")
print "iconv: ", cdll.LoadLibrary("iconv")
print "intl: ", cdll.LoadLibrary("intl")

if __name__ == "__main__":
test()

Thank you for your considered comments. My goal is ease of use for (porting) 
existing projects to AIX, i.e., ideally without code change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 

[issue24434] ItemsView.__contains__ does not mimic dict_items

2016-04-30 Thread Xiang Zhang

Xiang Zhang added the comment:

After reading issue4296, I agree with Serhiy's point on the second issue. Right 
now, (1, math.nan) in ItemsView({1: math.nan}) returns false which seems not 
acceptable.

--

___
Python tracker 

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