[issue18314] Have os.unlink remove junction points

2014-05-06 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Yes, new issue.

--

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



[issue21445] Some asserts in test_filecmp have the wrong messages

2014-05-06 Thread Steven Barker

New submission from Steven Barker:

While working on a fix for issue 1234674, I found that the first test method in 
Lib/test/test_filecmp.py (FileCompareTestCase.test_matching) has switched up 
messages in its AssertEquals calls. The first two asserts have the message that 
should belong to the second two, and visa versa.

I've prepared a very simple patch that switches around the AssertEquals 
arguments so that the messages match what is being tested. The behavior checked 
by the asserts remains exactly the same, only the message printed if an assert 
fails will be different.

The test still passes. If you want to see the wrong message get displayed, the 
patch I uploaded for issue 1234674 may cause the test edited here to fail 
intermittently (it depend on whether two files are created in a shorter time 
than your filesystems's mtime resolution in the setup code). The failures are 
not affected by this patch, but with it you'll get the right message rather 
than a wrong one.

--
components: Tests
files: filecmp_test_messages.diff
keywords: patch
messages: 217970
nosy: Steven.Barker
priority: normal
severity: normal
status: open
title: Some asserts in test_filecmp have the wrong messages
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file35160/filecmp_test_messages.diff

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread STINNER Victor

STINNER Victor added the comment:

Similar(?) issue #20526:
Modules/gcmodule.c:379: visit_decref: Assertion `((gc)-gc.gc_refs  (1)) != 
0' failed.

--

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 358a12f4d4bc by Victor Stinner in branch 'default':
Issue #21233: Fix _PyObject_Alloc() when compiled with WITH_VALGRIND defined
http://hg.python.org/cpython/rev/358a12f4d4bc

--

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



[issue21446] Update reload fixer to use importlib instead of imp

2014-05-06 Thread Berker Peksag

New submission from Berker Peksag:

Since imp.reload() was deprecated in issue 18193, the reload fixer (added in 
issue 11797) needs to be updated to use importlib.reload() instead of 
imp.reload().

--
components: 2to3 (2.x to 3.x conversion tool)
files: reload-fixer.diff
keywords: patch
messages: 217973
nosy: benjamin.peterson, berker.peksag, brett.cannon
priority: normal
severity: normal
stage: patch review
status: open
title: Update reload fixer to use importlib instead of imp
versions: Python 3.5
Added file: http://bugs.python.org/file35161/reload-fixer.diff

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue21444] __len__

2014-05-06 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
title: __len__ can't return big numbers - __len__

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
title: __len__ - __len__ can't return big numbers

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread Mark Dickinson

Mark Dickinson added the comment:

Whoops; sorry -- accidental title change by typing `__len__` into something 
that wasn't the search box.

Stupid fingers...

(I suspect this issue is a duplicate of an existing issue.)

--
nosy: +mark.dickinson

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



[issue18314] Have os.unlink remove junction points

2014-05-06 Thread eryksun

eryksun added the comment:

Nevermind, strike seems to work; it doesn't work without the \?? prefix. I 
stupidly assumed the DeviceIoControl call would validate the substitute name. 
Of course it doesn't; it happily creates a broken junction. Opening the 
junction with CreateFile fails with either ERROR_INVALID_REPARSE_DATA or 
ERROR_CANT_RESOLVE_FILENAME. Sorry.

--

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



[issue18314] Have os.unlink remove junction points

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Thanks, eryksun: failed experiments are still useful data for future
reference!

--

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



[issue21440] Use support.rmtree in test_zipfile

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ebf97299b18 by Tim Golden in branch 'default':
Issue21440 Use support.rmtree in test_zipfile  test_tarfile
http://hg.python.org/cpython/rev/4ebf97299b18

--
nosy: +python-dev

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



[issue21393] Python/random.c: close hCryptProv at exit

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2b18f6c37a68 by Tim Golden in branch 'default':
Issue21393 Use CryptReleaseContext to release Crypt handle on Windows
http://hg.python.org/cpython/rev/2b18f6c37a68

--

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



[issue21264] test_compileall fails to build in the installed location

2014-05-06 Thread Matthias Klose

Matthias Klose added the comment:

what happens here:

PYTHONPATH=$(pwd) python3.4 -X faulthandler -S -m compileall
Skipping current directory
Listing '/home/packages/python/3.4/x'...
Compiling '/home/packages/python/3.4/x/foo.py'...
Listing '/usr/lib/python3.4/'...
Listing '/usr/lib/python3.4/plat-x86_64-linux-gnu'...
Listing '/usr/lib/python3.4/lib-dynload'...

so even when overwriting PYTHONPATH, the standard locations are searched and 
tried to compile, which fails when these are read only.

Is this behaviour expected?

The tests itself can be fixed by passing the the test directory as an argument, 
as done in other tests too.

--
components: +Tests
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file35162/issue21264.diff

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



[issue21442] Win32 compiler warning in PyBytes_Concat

2014-05-06 Thread Zachary Ware

Zachary Ware added the comment:

Declaring oldsize as Py_ssize_t instead of size_t at Objects/bytesobject.c:2812 
takes care of the warning, but I'm not comfortable saying that's a correct 
change.

--

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



[issue21442] Win32 compiler warning in PyBytes_Concat

2014-05-06 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +tim.golden

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



[issue21393] Python/random.c: close hCryptProv at exit

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Use CryptReleaseContext to release Crypt handle on Windows

--
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue21440] Use support.rmtree in test_zipfile

2014-05-06 Thread Tim Golden

Changes by Tim Golden m...@timgolden.me.uk:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue20752] Difflib should provide the option of overriding the SequenceMatcher

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Well, it would be 3.5, so there's plenty of time yet.  We are hoping for an 
answer from Tim Peters, but if we don't get one someone else will review it as 
time allows.  Pinging the issue like this was good; do it again in another 
month if there's no further action before then.  (NB: we're working on 
improving our workflow so that issues like this don't get lost, but it will 
take time for those improvements to show up...)

--

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Mark: I thought it was too, but the two I noted were the closest I could find.  
Maybe you'll find something even more on point :)

--

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



[issue21366] Document that return in finally overwrites prev value

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset faaa8d569664 by Zachary Ware in branch '3.4':
Issue #21366: Document the fact that ``return`` in a ``finally`` clause
http://hg.python.org/cpython/rev/faaa8d569664

New changeset 685f92aad1dc by Zachary Ware in branch 'default':
Issue #21366: Document the fact that ``return`` in a ``finally`` clause
http://hg.python.org/cpython/rev/685f92aad1dc

--
nosy: +python-dev

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



[issue21366] Document that return in finally overwrites prev value

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7fabe3652ee0 by Zachary Ware in branch '2.7':
Issue #21366: Document the fact that ``return`` in a ``finally`` clause
http://hg.python.org/cpython/rev/7fabe3652ee0

--

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



[issue21366] Document that return in finally overwrites prev value

2014-05-06 Thread Zachary Ware

Zachary Ware added the comment:

Done. Thanks pointing out just how redundant that parenthetical was (I don't 
know how that slipped through my brain...), David.  And thank you Jon for the 
report!

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed
versions: +Python 2.7

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



[issue21446] Update reload fixer to use importlib instead of imp

2014-05-06 Thread Brett Cannon

Brett Cannon added the comment:

I don't think that's necessarily obvious since that will make your code tied to 
Python 3.4.

--

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread akira

akira added the comment:

If `len()` signature can't be changed to return Python int objects (unlimited) 
then the OverflowError may contain the actual `.length`
 property instead (based on msg66459 by Antoine Pitrou)

operator.length():

def length(sized):
Return the true (possibly large) length of `sized` object.

It is equivalent to len(sized) if len doesn't raise 
OverflowError i.e., if the length is less than sys.maxsize on
CPython; otherwise return OverflowError.length attribute

try:
return len(sized)
except OverflowError as e:
return e.length

--
nosy: +akira

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



[issue13702] relative symlinks in tarfile.extract broken (windows)

2014-05-06 Thread Andreas Gäer

Andreas Gäer added the comment:

Is there any progress to the question if the problem should be fixed in 
os.symlink or in tarfile?

Because this currently seems to break installing source packages that contain 
symlinks with pip under Windows.

Try: pip install networkx==1.8.1 for example

--
nosy: +Andreas.Gäer

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-05-06 Thread Yury Selivanov

Yury Selivanov added the comment:

Thanks, I'll take a look at the patch.

--

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Note that there has never been a strict correspondence between 
linecache/getsource, the module in memory, and the code on disk.  If the file 
is changed before a traceback is generated, for example, you will get the new 
source.  That doesn't mean fixing the reload case is wrong, it's just something 
to keep in mind.

--
nosy: +r.david.murray

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



[issue21442] Win32 compiler warning in PyBytes_Concat

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Well PyBytes_GET_SIZE is documented as returning a Py_ssize_t so I'd say it's 
perfectly valid.

--

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



[issue21377] PyBytes_Concat could try to concat in-place

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6234f4caba57 by Zachary Ware in branch 'default':
Issue #21442: Fix MSVC compiler warning introduced by issue21377.
http://hg.python.org/cpython/rev/6234f4caba57

--

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



[issue21442] Win32 compiler warning in PyBytes_Concat

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6234f4caba57 by Zachary Ware in branch 'default':
Issue #21442: Fix MSVC compiler warning introduced by issue21377.
http://hg.python.org/cpython/rev/6234f4caba57

--
nosy: +python-dev

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



[issue21442] Win32 compiler warning in PyBytes_Concat

2014-05-06 Thread Zachary Ware

Zachary Ware added the comment:

I should have looked a little harder, thanks Tim!

--
assignee:  - zach.ware
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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



[issue21382] Signal module doesnt raises ValueError Exception

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

To be honest I can't get excited about this one. The only sensible change is to 
remove the rather specific comment about ValueError and just leave the fact 
that only certain signals are valid. 

Because the C code defines module-level constants on the basis of whether the 
platform C-lib defines them, different platforms will have different module 
attributes. It would be unusual for us to list all the combinations.

Adding Brian Curtin as he made the original change.

--
nosy: +brian.curtin, tim.golden

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



[issue19643] shutil rmtree fails on readonly files in Windows

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Ok, so to move this forward we have essentially two proposals:

1) Add a remove_readonly flag

2) Add a doc example which shows how to use the onerror handler to remove a 
recalcitrant file.

I'm -0.5 on (1) because it feels like Windows-specific clutter; and +0 on (2).

--

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



[issue20758] mimetypes initialization order

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Fixed by issue9291

--
resolution:  - duplicate
stage:  - resolved
status: open - closed
type:  - behavior

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



[issue1528593] Printing: No print dialog or page setup

2014-05-06 Thread Tim Golden

Changes by Tim Golden m...@timgolden.me.uk:


--
nosy:  -tim.golden

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



[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

2014-05-06 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +bquinlan

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ryder Lewis

New submission from Ryder Lewis:

Intermittently, when using asyncio.wait_for() with asyncio.open_connection() to 
cancel the open_connection() task after a timeout period, an 
asyncio.futures.InvalidStateError is raised. It seems to be a race condition, 
if the open_connection() call succeeds roughly at the same time as the timeout.

In order to recreate this issue, I used a slightly-modified version of the 
example at 
https://docs.python.org/3.4/library/asyncio-stream.html?highlight=open_connection#example

 example.py 
import asyncio
import urllib.parse
import sys

@asyncio.coroutine
def print_http_headers(url, timeout):
url = urllib.parse.urlsplit(url)
try:
reader, writer = yield from 
asyncio.wait_for(asyncio.open_connection(url.hostname, 80), timeout)
except asyncio.TimeoutError:
print('Timed out with {}-second timeout'.format(timeout))
return

query = ('HEAD {url.path} HTTP/1.0\r\n'
 'Host: {url.hostname}\r\n'
 '\r\n').format(url=url)
writer.write(query.encode('latin-1'))
while True:
line = yield from reader.readline()
if not line:
break
line = line.decode('latin1').rstrip()
if line:
print('HTTP header %s' % line)

print('Success with {}-second timeout'.format(timeout))

url = sys.argv[1]
loop = asyncio.get_event_loop()

for timeout in range(5, 0, -1):
task = asyncio.async(print_http_headers(url, timeout/100))
loop.run_until_complete(task)

loop.close()


 Output of ./example.py http://www.yahoo.com/; after running multiple 
times 
HTTP header HTTP/1.0 301 Redirect
HTTP header Date: Tue, 06 May 2014 18:07:43 GMT
HTTP header Connection: close
HTTP header Via: http/1.1 ir12.fp.ne1.yahoo.com (ApacheTrafficServer/4.0.2)
HTTP header Server: ATS
HTTP header Cache-Control: no-store
HTTP header Content-Type: text/html; charset=utf-8
HTTP header Content-Language: en
HTTP header Location: https://www.yahoo.com/
HTTP header Content-Length: 214
Success with 0.04-second timeout
Timed out with 0.03-second timeout
Timed out with 0.02-second timeout
Exception in callback bound method Future.set_result of 
FutureCANCELLED(None,)
handle: Handle(bound method Future.set_result of FutureCANCELLED, (None,))
Traceback (most recent call last):
  File /opt/python3/lib/python3.4/asyncio/events.py, line 39, in _run
self._callback(*self._args)
  File /opt/python3/lib/python3.4/asyncio/futures.py, line 298, in set_result
raise InvalidStateError('{}: {!r}'.format(self._state, self))
asyncio.futures.InvalidStateError: CANCELLED: FutureCANCELLED
Timed out with 0.01-second timeout

--
components: IO
messages: 217999
nosy: ryder.lewis
priority: normal
severity: normal
status: open
title: Intermittent asyncio.open_connection / futures.InvalidStateError
type: behavior
versions: Python 3.4

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



[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-05-06 Thread Ned Deily

Ned Deily added the comment:

I don't have a *really* strong opinion against it.  It's just that I find the 
current plethora of configuration flags to be non-intuitive and confusing (and 
there are plenty of open issues agreeing with that sentiment) and adding 
another with the name CFLAGS_NODIST doesn't help.  But, again, short of someone 
going in and doing a radical simplification of the whole configure.ac, 
Makefile.pre.in, and setup.py tangle, I guess exposing one more variable isn't 
going to make matters that much worse than they already are and it does solve a 
real problem.  (Sorry to vent on your patch, Stefan.)

--

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



[issue21121] -Werror=declaration-after-statement is added even for extension modules through setup.py

2014-05-06 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I share Ned's sentiment on this. The amount of information exposed through 
sysconfig is too large as it is because a lot of that information is only 
useful during the built of python itself. I'm pretty sure that have been 
patches in the past where users tried to use some of those variables and were 
surprised they didn't work for an installed python.

Anyways, the patch looks good.

--

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



[issue21444] __len__ can't return big numbers

2014-05-06 Thread Mark Dickinson

Mark Dickinson added the comment:

That's pretty evil. :-)

--

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ryder Lewis

Ryder Lewis added the comment:

Another run raised a different exception,
again running ./example.py http://www.yahoo.com/


Timed out with 0.05-second timeout
HTTP header HTTP/1.0 301 Redirect
HTTP header Date: Tue, 06 May 2014 18:58:53 GMT
HTTP header Connection: close
HTTP header Via: http/1.1 ir38.fp.bf1.yahoo.com (ApacheTrafficServer/4.0.2)
HTTP header Server: ATS
HTTP header Cache-Control: no-store
HTTP header Content-Type: text/html; charset=utf-8
HTTP header Content-Language: en
HTTP header Location: https://www.yahoo.com/
HTTP header Content-Length: 214
Success with 0.04-second timeout
HTTP header HTTP/1.0 301 Redirect
HTTP header Date: Tue, 06 May 2014 18:58:53 GMT
HTTP header Connection: close
HTTP header Via: http/1.1 ir45.fp.bf1.yahoo.com (ApacheTrafficServer/4.0.2)
HTTP header Server: ATS
HTTP header Cache-Control: no-store
HTTP header Content-Type: text/html; charset=utf-8
HTTP header Content-Language: en
HTTP header Location: https://www.yahoo.com/
HTTP header Content-Length: 214
Success with 0.03-second timeout
Timed out with 0.02-second timeout
Timed out with 0.01-second timeout
exception calling callback for Future at 0x7f24e43aa710 state=finished 
returned list
Traceback (most recent call last):
  File /opt/python3/lib/python3.4/concurrent/futures/_base.py, line 297, in 
_invoke_callbacks
callback(self)
  File /opt/python3/lib/python3.4/asyncio/futures.py, line 370, in lambda
new_future._copy_state, fut))
  File /opt/python3/lib/python3.4/asyncio/base_events.py, line 285, in 
call_soon_threadsafe
self._write_to_self()
  File /opt/python3/lib/python3.4/asyncio/selector_events.py, line 91, in 
_write_to_self
self._csock.send(b'x')
AttributeError: 'NoneType' object has no attribute 'send'

--

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



[issue20737] 3.3 _thread lock.acquire() timeout and threading.Event().wait() do not wake for certain values on Windows

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

In thread_nt.h:EnterNonRecursiveMutex the millisecond version (here: 2148000) 
of the seconds you passed in are converted to microseconds (so: 214800).

This is then passed to condvar.h:PyCOND_TIMEDWAIT which expects a long, whose 
32-bit limit is 2147483647. So it wraps around and becomes -2146967296. 

That value is then divided by 1000 once again to become milliseconds (-2146967) 
and passed to condvar.h:_PyCOND_WAIT_MS which expects a DWORD, which is a 
synonym for an unsigned long. Thus the signed value becomes an unsigned 
4292820329. Which then passed in as the millisecond timeout to 
WaitForSingleObjectEx.

So that's what's happening; but I'm really not sure at what stage a change 
should be made. It looks to me as if PyCOND_TIMEDWAIT should be accepting 
something more than a long, but I'm really not competent to assess the impact 
of such a change.

--

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



[issue20384] os.open() exception doesn't contain file name on Windows

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Fixed in 3.4 and later; 3.3 is no longer accepting patches

--
resolution:  - fixed
stage:  - resolved
status: open - closed
versions: +Python 3.4 -Python 3.3

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



[issue5717] os.defpath includes unix /bin on windows

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Closing, as no-one's come back after my -0 for 6 months.

--
resolution:  - wont fix
stage: commit review - resolved
status: open - closed

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



[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

Zach -- you've done most of the work on the VS projects lately. Would you mind 
having a look at this one to see if it's still relevant, please?

--
nosy: +zach.ware

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread jader fabiano

New submission from jader fabiano:

Use email.parser to catch the mime's header,when a mime has attachments the 
process is consuming 100% of the CPU. And It can take until four minutes to 
finish the header parser.

--
components: email
messages: 218008
nosy: barry, jader.fabiano, r.david.murray
priority: normal
severity: normal
status: open
title: Email Parser use 100% CPU
type: performance
versions: Python 2.7

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Can you provide more details on how to reproduce the problem, please?  For 
example, a sample message and the sequence of python calls you use to parse it.

--

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



[issue13030] Be more generic when identifying the Windows main dir in installation doc

2014-05-06 Thread Tim Golden

Tim Golden added the comment:

This is essentially superseded now by the work done over on distutils-sig and 
by the PyPA. (Which has included considering the differeng terminology of 
installation vs other paths on Windows vs Unix).

--
resolution:  - wont fix
stage: needs patch - resolved
status: open - closed

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread jader fabiano

jader fabiano added the comment:

I am openning a file and I am passing the File Descriptor to this function
Parse().parse( fp ):
This file has two attachments
Example:
self.fileDescriptor( file, 'rb')
headers = Parser().parse(self.fileDescriptor )
#Here the process starts to consume  100% of the CPU and It takes around
four minutes to go the next line.
print 'Headers OK'

The File's size is 12M

Thanks.

2014-05-06 16:31 GMT-03:00 R. David Murray rep...@bugs.python.org:


 R. David Murray added the comment:

 Can you provide more details on how to reproduce the problem, please?  For
 example, a sample message and the sequence of python calls you use to parse
 it.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue21448
 ___


--

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread jader fabiano

jader fabiano added the comment:

Sorry!
Correct line
self.fileDescriptor = open( file, 'rb')

2014-05-06 16:51 GMT-03:00 jader fabiano rep...@bugs.python.org:


 jader fabiano added the comment:

 I am openning a file and I am passing the File Descriptor to this function
 Parse().parse( fp ):
 This file has two attachments
 Example:
 self.fileDescriptor( file, 'rb')
 headers = Parser().parse(self.fileDescriptor )
 #Here the process starts to consume  100% of the CPU and It takes around
 four minutes to go the next line.
 print 'Headers OK'

 The File's size is 12M

 Thanks.

 2014-05-06 16:31 GMT-03:00 R. David Murray rep...@bugs.python.org:

 
  R. David Murray added the comment:
 
  Can you provide more details on how to reproduce the problem, please?
  For
  example, a sample message and the sequence of python calls you use to
 parse
  it.
 
  --
 
  ___
  Python tracker rep...@bugs.python.org
  http://bugs.python.org/issue21448
  ___
 

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue21448
 ___


--

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



[issue21443] asyncio logging documentation clarifications

2014-05-06 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
stage:  - needs patch
title: asyncoio logging documentation clarifications. - asyncio logging 
documentation clarifications

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

We'll need the data file as well.  This is going to be a data-dependent issue.  
With a 12MB body, I'm guessing there's some decoding pathology involved, which 
may or may not have been already fixed in python3.

To confirm this you could use HeaderParser instead of Parser, which won't try 
to decode the body.

--

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread jader fabiano

jader fabiano added the comment:

No, The file has 12Mb, because It has attachments. I am going to show an
example.

You can use a file thus:

Date: Tue,  May 10:27:17 6 -0300 (BRT)
From: em...@email.com.br
MIME-Version: 1.0
To: exam...@example.com
Subject:example

Content-Type: multipart/mixed; boundary=24f59adc-d522-11e3-a531-00265a0f1361

--24f59adc-d522-11e3-a531-00265a0f1361
Content-Type: multipart/alternative;
boundary=24f59a28-d522-11e3-a531-00265a0f1361

--24f59a28-d522-11e3-a531-00265a0f1361^M
Content-Type: text/html; charset=iso-8859-1 ^M
Content-Transfer-Encoding: 7bit

br/font color=#0 face=verdana size=3Test example/b

--24f59a28-d522-11e3-a531-00265a0f1361--

--24f59adc-d522-11e3-a531-00265a0f1361
Content-Type: application/pdf; name=Example.pdf
Content-Disposition: attachment; filename=Example.pdf
Content-Transfer-Encoding: base64

 attachment content in base64..

--24f59adc-d522-11e3-a531-00265a0f1361--

2014-05-06 17:03 GMT-03:00 R. David Murray rep...@bugs.python.org:


 R. David Murray added the comment:

 We'll need the data file as well.  This is going to be a data-dependent
 issue.  With a 12MB body, I'm guessing there's some decoding pathology
 involved, which may or may not have been already fixed in python3.

 To confirm this you could use HeaderParser instead of Parser, which won't
 try to decode the body.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue21448
 ___


--

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Sorry, I was using RFC-speak.  A message is divided into 'headers' and 'body', 
and all of the attachments are part of the body in RFC terms.  But think of it 
as 'initial headers' and 'everything else'.  Please either attach the full 
file, and/or try your test using HeaderParser and report the results.

However, it occurs to me that the attachments aren't decoded until you retrieve 
them, so whatever is going on it must be something other than a decoding issue. 
 Nevertheless, Parser actually parses the whole message, attachments included, 
so we'll need the actual message in order to reproduce this (unless you can 
reproduce it with a smaller message).

--

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



[issue21448] Email Parser use 100% CPU

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Also to clarify: HeaderParser will *also* read the entire message, it just 
won't look for MIME attachments in the 'everything else', it will just treat 
the 'everything else' as arbitrary data and record it as the payload of the top 
level Message object.

--

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



[issue10752] build_ssl.py is relying on unreliable behaviour of os.popen

2014-05-06 Thread Zachary Ware

Zachary Ware added the comment:

Still relevant, insofar as having Perl available is relevant.  That is, you 
only need Perl available if you're using vanilla OpenSSL sources, not if you're 
using sources pulled from svn.python.org (which most people should do, I would 
think).  I have never had a problem with build_ssl.py finding Perl, though.

That said, I don't see any harm in properly updating from os.popen to 
subprocess.

See also issue21141, which aims to make explicit that Perl is only needed to 
doctor up vanilla OpenSSL source.

--
versions: +Python 3.5 -Python 3.3

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

The second error is easy to explain and fix: it's a race condition between the 
OS thread used to call getaddrinfo() and the main thread. The method 
_write_to_self() in selector_events.py is hopelessly naive. It should probably 
become something like this:

def _write_to_self(self):
csock = self._csock
if csock is not None:
try:
self._csock.send(b'x')
except OSError:
pass

It is possible that the main thread closes csock at any time, and calling 
send() on a closed socket will raise OSError with errno=9 (EBADF). Fortunately 
this is because close() sets the fd to -1; so there is no worry about reuse of 
the fd.

I will investigate the first traceback next.

--

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



[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

2014-05-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Do you mean ProcessPoolExecutor? Thread based pools don't involve serialization.

It would be good for ThreadPoolExecutor to have it as well, to make it easier 
to switch between executors, but only ProcessPoolExecutor is suffering from 
serialization overhead. Threads share the same memory space after all; 
references to data get passed directly, though you might choose to copy.copy or 
copy.deepcopy a root data template so each thread has its own unique copy 
that it can mutate.

--
nosy: +josh.rosenberg

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



[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

2014-05-06 Thread Andreas van Cranenburgh

Andreas van Cranenburgh added the comment:

Yes I did mean ProcessPoolExecutor, but indeed, it's good to have for threads 
as well.

I could try to make a patch if it is likely that it would be accepted.

--

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



[issue19643] shutil rmtree fails on readonly files in Windows

2014-05-06 Thread Zachary Ware

Zachary Ware added the comment:

I'm good with just adding an example to the docs, along the lines of Paul's 
del_rw.  I think it would be better to use a more conservative example though, 
something like:

   def readonly_handler(rm_func, path, exc_info):
   if issubclass(exc_info[0], PermissionError) and exc_info[1].winerror == 
5:
   os.chmod(path, stat.S_IWRITE)
   return rm_func(path)
   raise exc_info[1]

--

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



[issue21449] Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual

2014-05-06 Thread Josh Rosenberg

New submission from Josh Rosenberg:

_PyUnicode_CompareWithId is used exclusively for equality comparisons (after 
all, identifiers aren't really sortable in a meaningful way; they're isolated 
values, not a continuum). But because _PyUnicode_CompareWithId maintains the 
general comparison behavior, not just ==/!=, it serves little purpose; while it 
checks the return of _PyUnicode_FromId, none of its callers check for failure 
anyway, so every use could just as well have been:

PyUnicode_Compare(left, _PyUnicode_FromId(right));

I've attached a patch that replaces _PyUnicode_CompareWithId with 
_PyUnicode_CompareWithIdEqual, that:

1. Only check equality vs. inequality
2. Can optimize for the case where left is an interned string by performing 
direct pointer comparison
3. Even when left is not interned, it can use the optimized unicode_compare_eq 
worker function instead of the slower generalized unicode_compare function

I've replaced all the uses of the old function I could find, and all unit tests 
pass. I don't expect to see any meaningful speed ups as a result of the change 
(the most commonly traversed code that would benefit appears to be the code 
that creates new classes, and the code that creates reprs for objects), but the 
goal here is not immediate speed ups, but enabling future speed ups.

I am looking into writing a PyDict_GetItem fastpath for looking up identifiers 
(that would remove the need to perform memory comparisons when the dictionary, 
as in keyword argument passing, is usually composed of interned keys), possibly 
in combination with making an identifier based version of 
PyArg_ParseTupleAndKeywords; with ArgumentClinic, it might become practical to 
swap in a new argument parser without having to manually change thousands of 
lines of code, and one of the simplest ways to improve speed would be to remove 
the overhead of constantly constructing, hashing, and comparing the same 
keyword strings every time a C function is called.

Adding haypo as nosy since he created the original function in #19512.

--
files: comparewithidequals.patch
keywords: patch
messages: 218022
nosy: haypo, josh.rosenberg
priority: normal
severity: normal
status: open
title: Replace _PyUnicode_CompareWithId with _PyUnicode_CompareWithIdEqual
Added file: http://bugs.python.org/file35163/comparewithidequals.patch

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



[issue21423] concurrent.futures.ThreadPoolExecutor should accept an initializer argument

2014-05-06 Thread Josh Rosenberg

Josh Rosenberg added the comment:

I'm not a core developer, but writing the patch is usually considered helpful. 
Two notes:

1. Make sure to write unit tests for any new behavior
2. I'd suggest making any such argument keyword-only; if we move closer to the 
Java executor model, that means having a lot of options, the majority of which 
would be left as the default by users. Binding the API to a particular argument 
order is sub-optimal (it makes it even harder to deprecate arguments for 
instance), so enforcing keyword only behavior ensures users can't write call 
lines that take dependencies on argument ordering.

--

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



[issue19643] shutil rmtree fails on readonly files in Windows

2014-05-06 Thread Paul Moore

Paul Moore added the comment:

Checking the exact error could be a bit fragile. I have a feeling I recently 
saw an issue somewhere with code that stopped working on Python 3.4 because the 
precise error raised for a read-only file changed. I don't recall where the 
issue was, unfortunately.

It's also worth noting that trapping too broad a set of errors won't actually 
matter much, because the retry will simply fail again if the actual problem 
wasn't a read-only file...

--

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset afe8c4bd3230 by Guido van Rossum in branch '3.4':
asyncio: Fix the second half of issue #21447: race in _write_to_self().
http://hg.python.org/cpython/rev/afe8c4bd3230

New changeset c0538334f4df by Guido van Rossum in branch 'default':
Merge 3.4-default: asyncio: Fix the second half of issue #21447: race in 
_write_to_self().
http://hg.python.org/cpython/rev/c0538334f4df

--
nosy: +python-dev

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



[issue17752] many distutils tests fail when run from the installed location

2014-05-06 Thread Matthias Klose

Matthias Klose added the comment:

so the issue here is that -L -o file is passed to the compiler, and -o is 
interpreted as the library dir, and file as an input file.

To robustify, change distutils/tests/support.py to not include empty directory 
names.

To fix, change configure.ac (RUNPATH) not to unconditionally end the 
environment variables with an empty directory.

adding Ronald, Darwin is the only platform having quotes around this. Is this 
really needed/wanted?

--
keywords: +patch
nosy: +hynek, ned.deily, ronaldoussoren
Added file: http://bugs.python.org/file35164/issue17752.diff

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



[issue17752] many distutils tests fail when run from the installed location

2014-05-06 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


--
stage: needs patch - patch review

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm a little closer to understanding the first (more common) traceback. I can 
repro it by running your demo program in a loop -- it may take a while but 
occasionally I do get the same InvalidStateError.

This appears to be an example of the problem speculated about in message #5 of 
https://code.google.com/p/tulip/issues/detail?id=58.

In order to find out which occurrence of call_later(future.set_result, None) is 
causing this, I replaced all of them (about half a dozen) with an equivalent 
lambda -- the lambda shows up in the traceback, unlike the location where 
call_soon() is called.

In this particular example, it is the last line of 
_SelectorSocketTransport.__init__() in selector_events.py (line 446).

I suspect there are other places where a similar problem can occur.  I still 
have to think more about how to fix this (without changing set_result() to 
always ignore a cancelled Future -- such a change would mask certain errors 
that I find important to catch).

--

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread Tim Peters

Tim Peters added the comment:

A bit more info:  recall that, when deleting a type object (for class B), the 
previous (list) object's gc_next got overwritten with NULL.  The new info:  its 
(the list object's) gc_refs also changed from GC_TENTATIVELY_UNREACHABLE to 
GC_UNTRACKED,  That the object became untracked is wholly consistent with that 
its gc_next became NULL but not its gc_prev.

I haven't tracked it down all the way to the offending code, but I wonder 
whether that's worth the bother.  What reason do we have to believe that

Py_DECREF(op);

CANNOT cause other objects in the `collectable` list to become recognized as 
trash too?  We're in cyclic trash, and one decref can trigger an arbitrary 
number of other objects to become trash.

So I'll attach a patch that doesn't assume the Py_DECREF is harmless, by moving 
`collectable` objects one at a time to a temporary list, and then - at the end 
- moves all survivors back to `collectable`.  That makes the error go away, but 
I can't be certain it's address the real problem (since I stopped looking for 
the code that messed with the list as a side effect of doing a decref on the 
type object for class B).

--
keywords: +patch
Added file: http://bugs.python.org/file35165/finalize.patch

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



[issue13702] relative symlinks in tarfile.extract broken (windows)

2014-05-06 Thread eryksun

eryksun added the comment:

This should be fixed in os.symlink. The Windows CreateSymbolicLink function 
can't be relied on to translate slash to backslash. It only normalizes an 
absolute link, or a path that's relative to the current working directory on a 
drive (e.g. R:../crypto) since that's stored as an absolute link. 

For example:

 os.symlink('C:/Program Files/Python34', 'Python34')
 os.system('fsutil reparsepoint query Python34')
Reparse Tag Value : 0xa00c
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Symbolic Link

Reparse Data Length: 0x0078
Reparse Data:
:  32 00 3a 00 00 00 32 00  00 00 00 00 43 00 3a 00  2.:...2.C.:.
0010:  2f 00 50 00 72 00 6f 00  67 00 72 00 61 00 6d 00  /.P.r.o.g.r.a.m.
0020:  20 00 46 00 69 00 6c 00  65 00 73 00 2f 00 50 00   .F.i.l.e.s./.P.
0030:  79 00 74 00 68 00 6f 00  6e 00 33 00 34 00 5c 00  y.t.h.o.n.3.4.\.
0040:  3f 00 3f 00 5c 00 43 00  3a 00 5c 00 50 00 72 00  ?.?.\.C.:.\.P.r.
0050:  6f 00 67 00 72 00 61 00  6d 00 20 00 46 00 69 00  o.g.r.a.m. .F.i.
0060:  6c 00 65 00 73 00 5c 00  50 00 79 00 74 00 68 00  l.e.s.\.P.y.t.h.
0070:  6f 00 6e 00 33 00 34 00   o.n.3.4.

The print name uses forward slash, but the NT substitute name uses backslash. 
In this case, GetFinalPathNameByHandle works fine (\?? is the NT DosDevices 
directory in which C: is a symbolic link to something like 
\Device\HarddiskVolume1):

 print(os.path._getfinalpathname('Python34'))
\\?\C:\Program Files\Python34

OTOH, forward slashes aren't translated in a relative link:

 os.remove('Python34')
 os.symlink('/Program Files/Python34', 'Python34')  
 os.system('fsutil reparsepoint query Python34')
Reparse Tag Value : 0xa00c
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Symbolic Link

Reparse Data Length: 0x0068
Reparse Data:
:  2e 00 2e 00 00 00 2e 00  01 00 00 00 2f 00 50 00  /.P.
0010:  72 00 6f 00 67 00 72 00  61 00 6d 00 20 00 46 00  r.o.g.r.a.m. .F.
0020:  69 00 6c 00 65 00 73 00  2f 00 50 00 79 00 74 00  i.l.e.s./.P.y.t.
0030:  68 00 6f 00 6e 00 33 00  34 00 2f 00 50 00 72 00  h.o.n.3.4./.P.r.
0040:  6f 00 67 00 72 00 61 00  6d 00 20 00 46 00 69 00  o.g.r.a.m. .F.i.
0050:  6c 00 65 00 73 00 2f 00  50 00 79 00 74 00 68 00  l.e.s./.P.y.t.h.
0060:  6f 00 6e 00 33 00 34 00   o.n.3.4.

In this case GetFinalPathNameByHandle fails because the NT executive doesn't 
interpret forward slash as a path delimiter:

 os.path._getfinalpathname('Python34')
Traceback (most recent call last):
  File stdin, line 1, in module
OSError: [WinError 123] The filename, directory name, or volume label 
syntax is incorrect: 'Python34'

I think this is a bug in CreateSymbolicLink, but os.symlink should work around 
it by first normalizing the target path to use os.sep.

--
nosy: +eryksun

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



[issue18314] Have os.unlink remove junction points

2014-05-06 Thread eryksun

eryksun added the comment:

For some read Sysinternals junction utility doesn't show the raw substitute 
name. Microsoft's fsutil shows the actual reparse data:

C:\mklink /J Python34 C:\Program Files\Python34
Junction created for Python34 === C:\Program Files\Python34

C:\fsutil reparsepoint query Python34
Reparse Tag Value : 0xa003
Tag value: Microsoft
Tag value: Name Surrogate
Tag value: Mount Point
Substitue Name offset: 0
Substitue Name length: 58
Print Name offset: 60
Print Name Length: 50
Substitute Name:   \??\C:\Program Files\Python34
Print Name:C:\Program Files\Python34

Reparse Data Length: 0x0078
Reparse Data:
:  00 00 3a 00 3c 00 32 00  5c 00 3f 00 3f 00 5c 00  ..:..2.\.?.?.\.
0010:  43 00 3a 00 5c 00 50 00  72 00 6f 00 67 00 72 00  C.:.\.P.r.o.g.r.
0020:  61 00 6d 00 20 00 46 00  69 00 6c 00 65 00 73 00  a.m. .F.i.l.e.s.
0030:  5c 00 50 00 79 00 74 00  68 00 6f 00 6e 00 33 00  \.P.y.t.h.o.n.3.
0040:  34 00 00 00 43 00 3a 00  5c 00 50 00 72 00 6f 00  4...C.:.\.P.r.o.
0050:  67 00 72 00 61 00 6d 00  20 00 46 00 69 00 6c 00  g.r.a.m. .F.i.l.
0060:  65 00 73 00 5c 00 50 00  79 00 74 00 68 00 6f 00  e.s.\.P.y.t.h.o.
0070:  6e 00 33 00 34 00 00 00   n.3.4...

fsutil reparsepoint:
http://technet.microsoft.com/en-us/library/cc785451.aspx

--

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



[issue17752] many distutils tests fail when run from the installed location

2014-05-06 Thread Ned Deily

Ned Deily added the comment:

The quotes that you removed around the DYLD_FRAMEWORK_PATH step are not needed, 
at least until the rest of configure.ac and Makefile.pre.in support paths with 
spaces et al.  However, you missed removing the single quotes around the 
DYLD_LIBRARY_PATH step here:

RUNSHARED='DYLD_LIBRARY_PATH=`pwd`${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}'

Otherwise, the patch LGTM; I tested it with --enable-framework and 
--enable-shared configs on OS X.

--

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



[issue21300] Docs (incorrectly) suggest email.policy.default is the default policy

2014-05-06 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
components: +email
nosy: +barry

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



[issue21415] Python __new__ method doc typo (it's a class and not a static method)

2014-05-06 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue21300] Docs (incorrectly) suggest email.policy.default is the default policy

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d994d75cce95 by R David Murray in branch '3.4':
#21300: Clean up the docs for the email policy arguments.
http://hg.python.org/cpython/rev/d994d75cce95

New changeset 63fa945119cb by R David Murray in branch 'default':
Merge: #21300: Clean up the docs for the email policy arguments.
http://hg.python.org/cpython/rev/63fa945119cb

--
nosy: +python-dev

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



[issue21300] Docs (incorrectly) suggest email.policy.default is the default policy

2014-05-06 Thread R. David Murray

R. David Murray added the comment:

Thanks for the heads up.

policy.default will become the default policy eventually, but first the new 
stuff has to get out of provisional status (which I expect will happen in 3.5).

I did a pass over the documentation of all of the policy arguments and cleaned 
things up.  The policy args got added at different points during development 
and this is the first time I looked at all of them together.  There were a 
number of inconsistencies (and a couple more errors).

--
resolution:  - fixed
stage:  - resolved
status: open - closed
versions:  -Python 3.3

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



[issue17752] many distutils tests fail when run from the installed location

2014-05-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset faef1da30c6d by doko in branch '2.7':
- Issue #17752: Fix distutils tests when run from the installed location.
http://hg.python.org/cpython/rev/faef1da30c6d

--
nosy: +python-dev

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread Tim Peters

Tim Peters added the comment:

Attaching a marginally cleaner version of the patch, with comments.

I think it's clear this addresses _some_ real fatal problems, but they're rare: 
 for a problem to show up, it has to be the case that finalize() reduces the 
refcount of the current object to 0, and that this also causes the immediately 
previous object in the gc list to become free'd, or at least untracked from 
gc.  Then the next current object will be taken from an insane gc_next 
member, and all bets are off.

--
Added file: http://bugs.python.org/file35166/finalize2.patch

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread Tim Peters

Tim Peters added the comment:

Oh, fudge.  There are other failure modes in the test suite after I took out 
the seemingly redundant incref/decref pair.  Adding it back in finalize3.patch.

--
Added file: http://bugs.python.org/file35167/finalize3.patch

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks Tim! I'm not sure who should review the patch, but it's not me. :-) I've 
verified that the patch stops the example program from segfaulting on OSX, and 
I assume you've verified it on Windows -- that's good enough for me. We don't 
see this happening much in asyncio, so it's a likely story that the demo 
program happens to arrange for the refcounts to be just so.

--

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



[issue21435] Segfault with cyclic reference and asyncio.Future

2014-05-06 Thread Tim Peters

Tim Peters added the comment:

Guido, it's best if Antoine reviewed it - he wrote the relevant PEP, and the 
code I'm changing.  I'm sure he'll agree it's a necessary change.

About the rarity of the bug, not only do the refcounts and cyclic structure 
have to be just right, we also need exactly the right parts of the cyclic trash 
to appear in exactly the right order in gc's generation list.  It really has 
nothing to do with asyncio.  But it's hard to provoke!  Even knowing the cause, 
I have yet to create a simple failing test case.

--

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



[issue18154] make install failed on solaris

2014-05-06 Thread Palm Kevin

Palm Kevin added the comment:

Issue can be closed. I am not able to reproduce this any more...

--
resolution:  - works for me
status: open - closed

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