[issue5710] ctypes should return composite types from callbacks

2015-11-29 Thread Albert Zeyer

Albert Zeyer added the comment:

Any update here?

--
nosy: +Albert.Zeyer
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



[issue25608] ascynio readexactly() should raise ValueError if passed length <= 0 in argument

2015-11-29 Thread Марк Коренберг

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

Okay, https://github.com/python/asyncio/pull/298 is ready

--

___
Python tracker 

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



[issue25763] I cannot use absolute path in sqlite3 , python 2.7.9, windows

2015-11-29 Thread R. David Murray

R. David Murray added the comment:

Did you try just using the absolute file path without the file://?  That should 
work.  I don't believe uri interpretation is enabled by default, according to 
the docs you linked to.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue25766] __bytes__ doesn't work for str subclasses

2015-11-29 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Special __bytes__ method is purposed for converting to bytes with bytes 
constructor (as well as __str__ and __float__ for str and float). But this 
doesn't work if the class is a subclass of str.

>>> class X:
... def __bytes__(self):
... return b'abc'
... 
>>> bytes(X())
b'abc'
>>> class Y(str):
... def __bytes__(self):
... return b'abc'
... 
>>> bytes(Y())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: string argument without an encoding

--
components: Interpreter Core
files: str___bytes__.patch
keywords: patch
messages: 255593
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: __bytes__ doesn't work for str subclasses
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41192/str___bytes__.patch

___
Python tracker 

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



[issue24660] Heapq + functools.partial : TypeError: unorderable types

2015-11-29 Thread Марк Коренберг

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

Yes, this is not a bug. Python 3.5 works as expected.

Orderable lambda is the bug in python2.7.

--

___
Python tracker 

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



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

Okay so now I see 2.7 doesn’t support the context manager. I was mainly curious 
why you didn’t want to use subprocess. However a bigger problem with your first 
patch is shlex.quote() does not appear to be in Python 2 either.

If you want to use proc.communicate() rather than reading line by line, perhaps 
subprocess.check_output() would be simpler. I’m not familiar with the RPM 
command but if there is only a modest amount of output it should be good enough.

--

___
Python tracker 

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



[issue25764] PyObject_Call() is called with an exception set in subprocess

2015-11-29 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

http://buildbot.python.org/all/builders/x86%20OpenIndiana%203.x/builds/10847/steps/test/logs/stdio

[117/400] test_subprocess -- running: test_tokenize (65 sec), 
test_concurrent_futures (38 sec)
Assertion failed: !PyErr_Occurred(), file Objects/abstract.c, line 2158
Fatal Python error: Aborted

Current thread 0x0001 (most recent call first):
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/subprocess.py", 
line 1483 in _execute_child
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/subprocess.py", 
line 950 in __init__
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_subprocess.py",
 line 2295 in test_close_fds_after_preexec
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/case.py", 
line 600 in run
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/case.py", 
line 648 in __call__
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/suite.py", 
line 122 in run
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/suite.py", 
line 84 in __call__
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/support/__init__.py",
 line 1780 in _run_suite
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/support/__init__.py",
 line 1814 in run_unittest
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_subprocess.py",
 line 2657 in test_main
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/runtest.py",
 line 162 in runtest_inner
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/runtest.py",
 line 115 in runtest
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/runtest_mp.py",
 line 69 in run_tests_slave
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 379 in main
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 433 in main
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 455 in main_in_temp_cwd
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/regrtest.py", 
line 39 in 
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/runpy.py", 
line 85 in _run_code
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/runpy.py", 
line 170 in _run_module_as_main
Traceback (most recent call last):
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/runpy.py", 
line 170, in _run_module_as_main
"__main__", mod_spec)
  File "/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/runpy.py", 
line 85, in _run_code
exec(code, run_globals)
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/__main__.py", 
line 3, in 
regrtest.main_in_temp_cwd()
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 455, in main_in_temp_cwd
main()
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 433, in main
Regrtest().main(tests=tests, **kwargs)
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 392, in main
self.run_tests()
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/main.py",
 line 354, in run_tests
run_tests_multiprocess(self)
  File 
"/export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/libregrtest/runtest_mp.py",
 line 212, in run_tests_multiprocess
raise Exception(msg)
Exception: Child error on test_subprocess: Exit code -6
make: *** [buildbottest] Error 1
program finished with exit code 2

--
components: Extension Modules
messages: 255586
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: PyObject_Call() is called with an exception set in subprocess
type: crash
versions: Python 3.4, 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



[issue25761] Improve unpickling errors handling

2015-11-29 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +alexandre.vassalotti, pitrou

___
Python tracker 

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



[issue25765] Installation error

2015-11-29 Thread SilentGhost

Changes by SilentGhost :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: performance -> behavior

___
Python tracker 

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



[issue25696] "make -j9 install" fails because bininstall target requires the libainstall target

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

Please go ahead with bininstall-3.patch if you prefer. It certainly avoids the 
problem you reported. Although I still encourage you to not add the dash before 
the command.

--

___
Python tracker 

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



[issue5319] stdout error at interpreter shutdown fails to return OS error status

2015-11-29 Thread Robert Collins

Robert Collins added the comment:

@Martin I was wrong re: the defs - they only cover function vs data, not return 
codes. So it looks fine to me.

--

___
Python tracker 

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



[issue25765] Installation error

2015-11-29 Thread Ayushmaan Saxena

New submission from Ayushmaan Saxena:

installation error 0x80240004

--
components: Installation
files: Python 3.5.0 (32-bit)_20151130012741.log
messages: 255589
nosy: ayushmaan121
priority: normal
severity: normal
status: open
title: Installation error
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file41191/Python 3.5.0 
(32-bit)_20151130012741.log

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-29 Thread Kovid Goyal

Kovid Goyal added the comment:

Yes, I am aware. I embed python in my application, which includes large C++ 
libraries. Those libraries are going to start requiring to be compiled with a 
modern compiler soon, which means I need python to also be compiled with a 
modern compiler. I already manually compile all python extensions in my build 
system, so that is not a problem. And before someone suggests I upgrade to 
python 3, porting half a million lines of python is simply not worth it for me. 

I'll be happy to open a separate bug report, but first I want some advice. I 
have got all the other tests passing as well, except one single test. 
test_gzip.test_many_append. 

The reason that test fails is apparently because of a buffering bug in the 
stdio C functions in VS 2015. Combining lots of seeks relative to SEEK_CUR 
causes read() to return incorrect data. I can make the test pass by modify the 
gzip module to open files with bufferring=0, or by putting in a seek(0, 0) to 
cause the stdio layer to flush its read buffer at the appropriate point. 
However, this is not an actual fix, just an inefficient workaround.

My question is, how do I properly workaround this bug? And how come this bug is 
not triggered in Python 3.5.0? Am I diagnosing this correctly? Any other 
alternative explanations?

--

___
Python tracker 

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



[issue25752] asyncio.readline - add customizable line separator

2015-11-29 Thread Марк Коренберг

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

Well, https://github.com/python/asyncio/pull/297 is ready :)

--

___
Python tracker 

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



[issue12460] SocketServer.shutdown() does not have "timeout=None" parameter

2015-11-29 Thread Марк Коренберг

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

Please close this bug since asyncio is much more suitable, and things like 
socketserver is obsolete as I think.

--

___
Python tracker 

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



[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
status: open -> closed

___
Python tracker 

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



[issue25762] Calculation Mistake 1.5 * 0.3

2015-11-29 Thread Yunus Emre Kursav

New submission from Yunus Emre Kursav:

Dear Authorized Person,

When I was using python, I found a bug. When I multiplied 1.5 time 0.3, I got 
0.44996 as a result.

Best Regards,
Yunus

--
files: Screenshot from 2015-11-29 17-39-20.png
messages: 255579
nosy: zeneregion
priority: normal
severity: normal
status: open
title: Calculation Mistake 1.5  * 0.3
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file41190/Screenshot from 2015-11-29 
17-39-20.png

___
Python tracker 

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



[issue24731] Incorrect assert in str_subtype_new

2015-11-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2ea1a3bf448f by Serhiy Storchaka in branch '2.7':
Fixed Py3k warnings in tests for issue #24731.
https://hg.python.org/cpython/rev/2ea1a3bf448f

--

___
Python tracker 

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



[issue25762] Calculation Mistake 1.5 * 0.3

2015-11-29 Thread Ethan Furman

Ethan Furman added the comment:

Floating point calculations are not exact.

https://docs.python.org/3/tutorial/floatingpoint.html
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html

--
nosy: +ethan.furman
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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-29 Thread R. David Murray

R. David Murray added the comment:

You are aware that you can't use existing pre-compiled extension modules with 
your 2015 build, right?

It would be great if you could open a separate issue for the double close 
problem.  This should be a doc issue for fixing the docs.

--
assignee:  -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, r.david.murray
stage:  -> needs patch
type: compile error -> behavior

___
Python tracker 

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



[issue25767] asyncio documentation section 18.5.2.3.1. (Windows) links to French Wikipedia in English docs

2015-11-29 Thread Elizabeth Myers

New submission from Elizabeth Myers:

The link for HPET in the asyncio documentation (18.5.2.3.1 Windows, final 
paragraph, see 
https://docs.python.org/3/library/asyncio-eventloops.html#windows) links to 
https://fr.wikipedia.org/wiki/High_Precision_Event_Timer for the HPET link even 
though the document is in English (it should link to the English Wikipedia 
version instead).

--
assignee: docs@python
components: Documentation
messages: 255598
nosy: Elizacat, docs@python
priority: normal
severity: normal
status: open
title: asyncio documentation section 18.5.2.3.1. (Windows) links to French 
Wikipedia in English docs
type: enhancement
versions: Python 3.4, 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



[issue25763] I cannot use absolute path in sqlite3 , python 2.7.9, windows

2015-11-29 Thread jingtao chen

New submission from jingtao chen:

I tried the way like here 
https://www.sqlite.org/c3ref/open.html#urifilenamesinsqlite3open but it is 
useless 

what I got is 

C:\Users\CJT-6220>python D:\NKUSearch\pr_cal\main.py
Traceback (most recent call last):
  File "D:\NKUSearch\pr_cal\main.py", line 7, in 
conn = sqlite3.Connection('file:///D:/NKU.db')
sqlite3.OperationalError: unable to open database file


and I tried some other ways to write the URI but none of them works and PEP 249 
did not mention anything about absolute path . So what can I do ?

--
components: Windows
messages: 255581
nosy: jingtao chen, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: I cannot use absolute path in sqlite3 , python 2.7.9, windows
type: behavior
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



[issue25752] asyncio.readline - add customizable line separator

2015-11-29 Thread Guido van Rossum

Guido van Rossum added the comment:

If you hit EOF in the middle of a partial separator, treat it as a premature 
EOF just as if you hit EOF before the separator -- the record is not properly 
terminated so it shouldn't be accepted.

I prefer a single PR that has the full code.

We keep the CPython Lib version and the asyncio repo synchronized, a PR for the 
asyncio repo is easier to handle for me.

--

___
Python tracker 

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



[issue25768] compileall functions do not document return values

2015-11-29 Thread Nicholas Chammas

New submission from Nicholas Chammas:

I'm using the public functions of Python's built-in compileall module.

https://docs.python.org/3/library/compileall.html#public-functions

There doesn't appear to be documentation of what each of these functions 
returns.

I figured out, for example, that compileall.compile_file() returns 1 when the 
file compiles successfully, and 0 if not.

If this is "official" behavior, it would be good to see it documented so that 
we can rely on it.

I'd be happy to submit a patch to fix this if a committer is willing to 
shepherd a new contributor (me) through the process. Otherwise, this is 
probably a quick fix for experienced contributors.

--
assignee: docs@python
components: Documentation
messages: 255600
nosy: Nicholas Chammas, docs@python
priority: normal
severity: normal
status: open
title: compileall functions do not document return values
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



[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

http://buildbot.python.org/all/builders/x86%20XP-4%202.7/builds/3517/steps/test/logs/stdio
==
ERROR: test_setlocale_unicode (test.test_locale.TestMiscellaneous)
--
Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_locale.py",
 line 497, in test_setlocale_unicode
old_loc = locale.getlocale(locale.LC_ALL)
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\locale.py", 
line 565, in getlocale
raise TypeError, 'category LC_ALL is not supported'
TypeError: category LC_ALL is not supported

--

--
nosy: +serhiy.storchaka
status: closed -> open

___
Python tracker 

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



[issue25696] "make -j9 install" fails because bininstall target requires the libainstall target

2015-11-29 Thread STINNER Victor

STINNER Victor added the comment:

bininstall-4.patch: IMHO it's overkill and makes Makefile more complex to 
follow. My patch  bininstall.patch proposed something similar, but Arfrever 
asked me to modify bininstall target. IMHO Getting "Creating directory xxx" 
message twice is a minor issue.

It becomes annoying to have nitpicking on my patch, I hate autotools, I hate 
having to care of Makefile, etc. Maybe I should just abandon my change, it 
looks like nobody cares that Python cannot be installed with -j9 anyway :-)

--

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2015-11-29 Thread Armin Rigo

Armin Rigo added the comment:

This is a known general issue which is documented in 
Lib/test/crashers/borrowed_ref_1 inside the 2.7 branch.  In trunk, I see that 
this file has been deleted, although the issue has not been solved in general.  
Only the particular crash in the file has been solved.  (Somebody with 
motivation should restore the crashers that have been solved superficially 
only.  But finding actual crashing code takes more effort than I'm willing to 
put into this rather pointless process, so CPython still gets the occasional 
bug report like this one instead.)

--
nosy: +arigo

___
Python tracker 

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



[issue25750] tp_descr_get(self, obj, type) is called without owning a reference to "self"

2015-11-29 Thread Jeroen Demeyer

Jeroen Demeyer added the comment:

Thanks for the pointer. My patch does fix the crash in 
Lib/test/crashers/borrowed_ref_2.py on Python 2.7.10.

--

___
Python tracker 

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



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2015-11-29 Thread SilentGhost

SilentGhost added the comment:

Yeah, it would be great, Martin, if only that code worked in python2. Anyway, 
here is an alternative patch.

--
Added file: http://bugs.python.org/file41189/issue25627_3.diff

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-29 Thread Kovid Goyal

Kovid Goyal added the comment:

I missed a few places in my initial patch, updated patch:
https://github.com/kovidgoyal/cpython/commit/a9ec814d466d3c0139d10b69666f88eed10e4940

Also fixed the code not clearing errno before calling CRT functions, while I 
was there. Regardless of whether you want to allow your fork to be compiled 
with VS 2015 or not, I suggest you consider merging this patch, anyway, since 
the errno clearing is the correct thing to do, regardless. You can always 
cherrypick the errno clearing bits if you like :)

Just FYI, the code in my fork of 2.7 passes all tests on 64bit builds with VS 
2015, except for 5 small ones that I have yet to track down. (test_ctypes 
test_distutils test_gzip test_mailbox test_zipfile)

I dont anticipate any difficulty in fixing the remaining test failures. Famous 
last words ;)

--

___
Python tracker 

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



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2015-11-29 Thread SilentGhost

SilentGhost added the comment:

I tried re-writing that bit using subprocess.Popen but since the 2.7 support is 
needed I genuinely don't see any benefit that would add on top of the submitted 
patch.

--

___
Python tracker 

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



[issue25627] distutils : file "bdist_rpm.py" does not quote filenames when executing the rpm command

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

I don’t understand what 2.7 has got to do with using subprocess or not. Jumping 
through a shell quoting hoop only to pass a command to the shell to be unquoted 
seems like double handling. This is how I might rewrite it (untested):

q_cmd = ("rpm", "-q", "--qf", r"%s %s\n" % (...), "--specfile", spec_path)
with subprocess.Popen(q_cmd, stdout=PIPE, universal_newlines=?) as proc:
for line in proc.stdout:
...
if proc.returncode:
raise DistutilsExecError(...)

--
nosy: +martin.panter
stage:  -> patch review

___
Python tracker 

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



[issue25761] Improve unpickling errors handling

2015-11-29 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

This issue is for better detecting and reporting errors in broken pickle data.

--
assignee: serhiy.storchaka
components: Extension Modules, Library (Lib), Tests
messages: 255567
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve unpickling errors handling
type: enhancement

___
Python tracker 

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



[issue25761] Improve unpickling errors handling

2015-11-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d47e5b162072 by Serhiy Storchaka in branch '3.4':
Issue #25761: Added more test cases for testing unpickling broken data.
https://hg.python.org/cpython/rev/d47e5b162072

New changeset c7e7d77ef8bf by Serhiy Storchaka in branch '2.7':
Issue #25761: Added more test cases for testing unpickling broken data.
https://hg.python.org/cpython/rev/c7e7d77ef8bf

New changeset 4897438543da by Serhiy Storchaka in branch '3.5':
Issue #25761: Added more test cases for testing unpickling broken data.
https://hg.python.org/cpython/rev/4897438543da

New changeset c852c7d8d681 by Serhiy Storchaka in branch 'default':
Issue #25761: Added more test cases for testing unpickling broken data.
https://hg.python.org/cpython/rev/c852c7d8d681

--
nosy: +python-dev

___
Python tracker 

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



[issue25761] Improve unpickling errors handling

2015-11-29 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Proposed patch allows unpickler to detect errors related to reading a stack 
behind a mark.

For now Python implementation just pops a sentinel used as a mark. This can 
cause TypeError, AttributeError or UnpicklingError besides IndexError:

>>> pickle._loads(b'}(NNs.')
Traceback (most recent call last):
  ...
TypeError: 'object' object does not support item assignment
>>> pickle._loads(b'](Na.')
Traceback (most recent call last):
  ...
AttributeError: 'object' object has no attribute 'append'

Or can silently expose the mark object:

>>> pickle._loads(b')(.')

>>> pickle._loads(b']](a.')
[]

C implementation just ignores incorrect mark:

>>> pickle.loads(b'}(NNs.')
{None: None}
>>> pickle.loads(b'](Na.')
[None]
>>> pickle.loads(b')(.')
()
>>> pickle.loads(b']](a.')
[[]]

But in case of complex data this can cause errors later.

With the patch C implementation always raises UnpicklingError with relevant 
message and Python implementation always raises IndexError.

>>> pickle.loads(b'}(NNs.')
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'pickle' is not defined
>>> import pickle, pickletools
>>> pickle.loads(b'}(NNs.')
Traceback (most recent call last):
  File "", line 1, in 
_pickle.UnpicklingError: unexpected MARK found
>>> pickle.loads(b'](Na.')
Traceback (most recent call last):
  File "", line 1, in 
_pickle.UnpicklingError: unexpected MARK found
>>> pickle.loads(b')(.')
Traceback (most recent call last):
  File "", line 1, in 
_pickle.UnpicklingError: unexpected MARK found
>>> pickle.loads(b']](a.')
Traceback (most recent call last):
  File "", line 1, in 
_pickle.UnpicklingError: unexpected MARK found
>>> pickle._loads(b'}(NNs.')
Traceback (most recent call last):
  ...
IndexError: list index out of range
>>> pickle._loads(b'](Na.')
Traceback (most recent call last):
  ...
IndexError: list index out of range
>>> pickle._loads(b')(.')
Traceback (most recent call last):
  ...
IndexError: pop from empty list
>>> pickle._loads(b']](a.')
Traceback (most recent call last):
  ...
IndexError: pop from empty list

--
keywords: +patch
stage:  -> patch review
versions: +Python 3.6
Added file: http://bugs.python.org/file41188/unpickling_mark_errors.patch

___
Python tracker 

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



[issue25742] locale.setlocale does not work with unicode strings

2015-11-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7481ebeaa4f by Victor Stinner in branch '2.7':
Issue #25742: Try to fix test_locale on Windows
https://hg.python.org/cpython/rev/d7481ebeaa4f

--

___
Python tracker 

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



[issue25752] asyncio.readline - add customizable line separator

2015-11-29 Thread Марк Коренберг

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

When I reported that bug, I want to suggest multibyte separators, but 
implementation is much complex than current one. For example, we should decide 
what to do if partial separator is read and EOF occur.

So, I think we should merge ability to use custom one-byte separator, and next 
create another pull-request to make support of multibyte separator (like 
'\r\n').

Okay, I can make pull request on asyncio, but asyncio now is the part of 
Python. Does not it ?

--

___
Python tracker 

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



[issue25514] better startup error messages in IDLE when stdlib modules shadowed

2015-11-29 Thread Laura Creighton

Laura Creighton added the comment:

webmaster got another one of these today.

--

___
Python tracker 

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



[issue12460] SocketServer.shutdown() does not have "timeout=None" parameter

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

Closing as retracted by original reporter.

(Also, I wonder how useful the timeout would be. Adding a timeout isn’t going 
to fix a hanging server.)

--
nosy: +martin.panter
resolution:  -> rejected
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



[issue25763] I cannot use absolute path in sqlite3 , python 2.7.9, windows

2015-11-29 Thread jingtao chen

jingtao chen added the comment:

wow...It works...

--
status: open -> closed

___
Python tracker 

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



[issue25759] Python 2.7.11rc1 not building with Visual Studio 2015

2015-11-29 Thread Kovid Goyal

Kovid Goyal added the comment:

To answer part of my question, the reason the fseek()+fread() bug does not 
affect python 3.5.0 appears to be because it implements its own buffering and 
does not use fseek()/fread() at all. 

Sigh, I really hope the answer does not end up being that I have to 
re-implement fseek()/ftell()/fread()/fwrite() using lseek()/read()/write() on 
windows. Or I could wait and hope Microsoft fixes the bug :)

As a first step, to confirm that the bug is in the CRT, I'll have the gzip 
module record all reads/seeks/tells and then see if I can reproduce the bug in 
a plain C program.

--

___
Python tracker 

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



[issue25764] PyObject_Call() is called with an exception set in subprocess

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

This looks like an intermittent (1 in ~5) failure in at least the Open Indiana 
3.5 and 3.x buildbots.

My guess is that fork() has failed, and because preexec_fn is in use, the code 
tries to call gc.enable() with the fork() exception already set. My patch adds 
a test and fixes that.

Victor already fixed a similar error for the cleanup branch of 
subprocess_fork_exec() in Issue 22290.

--
keywords: +patch
nosy: +martin.panter
stage:  -> patch review
Added file: http://bugs.python.org/file41193/preexec-fork.patch

___
Python tracker 

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



[issue5319] stdout error at interpreter shutdown fails to return OS error status

2015-11-29 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6b08429a3932 by Martin Panter in branch 'default':
Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure
https://hg.python.org/cpython/rev/6b08429a3932

--

___
Python tracker 

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



[issue25763] I cannot use absolute path in sqlite3 , python 2.7.9, windows

2015-11-29 Thread Eryk Sun

Changes by Eryk Sun :


--
resolution:  -> not a bug
stage:  -> resolved

___
Python tracker 

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



[issue5319] stdout error at interpreter shutdown fails to return OS error status

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

Thanks everyone for helping to get this right.

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



[issue25769] Crash due to using weakref referent without acquiring a strong reference

2015-11-29 Thread lplatypus

New submission from lplatypus:

I have encountered some crashes in a multithreaded application which appear to 
be due to a bug in weakref_richcompare in Objects/weakref.c

(I am using Python 2.7.9, but the same weakref code exists in 3.5 and hg 
default branch too)

weakref_richcompare ends with the statement:

return PyObject_RichCompare(PyWeakref_GET_OBJECT(self),
PyWeakref_GET_OBJECT(other), op);

At this point the code has established that the referents of "self" and "other" 
are still alive, and it is trying to compare the referents.  However it has not 
acquired a strong reference to the referents, so I think it is possible for one 
of them to be deleted half way through this comparison.  This can lead to a 
crash, because PyObject_RichCompare assumes that the PyObject*’s it was passed 
will remain usable for the duration of the call.

The crash dumps I have seen involve data corruption consistent with one of 
these PyObject's being deleted and the memory used for something else, eg:

00 python27!try_3way_compare+0x15 [objects\object.c @ 712]
01 python27!try_3way_to_rich_compare+0xb [objects\object.c @ 901]
02 python27!do_richcmp+0x2c [objects\object.c @ 935]
03 python27!PyObject_RichCompare+0x99 [objects\object.c @ 982]
04 python27!weakref_richcompare+0x6a [objects\weakrefobject.c @ 212]

In this example, in try_3way_compare the value of v->ob_type was 0x5f637865, 
which is ASCII "exc_" and not a valid pointer at all.

Other places in weakrefobject.c seem to have a similar weakness, eg in 
weakref_hash and weakref_repr.

I have not been successful in producing a small test case to demonstrate this 
crash.

--
components: Interpreter Core
messages: 255608
nosy: ldeller
priority: normal
severity: normal
status: open
title: Crash due to using weakref referent without acquiring a strong reference
type: crash
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, 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



[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-29 Thread Martin Panter

Martin Panter added the comment:

In the python-dev thread, Nick Coghlan gave some arguments and examples where 
PyObject_SetAttr() is intended to be used for deletion. So I will keep my 
changes for PyObject_SetAttr(), and also _SetAttrString() for consistency.

My second patch documents deletion with sq_ass_item(), mp_ass_subscript(), and 
PySequence_SetItem().

PyObject_SetItem() does not look like it deletes items. It explicitly considers 
value == NULL to be an error. As a consequence, PyMapping_SetItemString() does 
not delete either.

PySequence_SetItem() does accept NULL to delete the item. I think this is 
reasonable, to keep it consistent with sq_ass_item(), so I documented it.

PySequence_SetSlice() also accepts NULL to delete the slice. But I am more 
reluctant to document this, because I don’t know of any slot or other code that 
would benefit. So I have left it as is for the time being.

--
Added file: http://bugs.python.org/file41194/setattr.2.patch

___
Python tracker 

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



[issue18161] call fchdir if subprocess.Popen(cwd=integer|fileobject)

2015-11-29 Thread Марк Коренберг

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

Do not understand what should be done in order to fix that...

It will be nice if I can create pull request by myself

--

___
Python tracker 

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



[issue24523] coroutine asyncio.wait() does not preserve order of elements

2015-11-29 Thread Марк Коренберг

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

Yes this is not a bug.

Use asyncio.gather(), it preserves order of elements :)

--

___
Python tracker 

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



[issue15500] Python should support naming threads

2015-11-29 Thread Марк Коренберг

Changes by Марк Коренберг :


--
nosy: +mmarkk

___
Python tracker 

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