[issue21340] Possible concurrency bug in asyncio, AttributeError in tasks.py

2014-04-25 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh wait, it looks like the assert failed because KeyboardInterrupt hit right at 
that point. I ran the program a few times and when I hit ^C I get a traceback 
at a different point in the code each time. This is as expected. You must have 
hit the rare case where it hit right at the assert -- then the behavior I 
described can happen.

Anyway, I think this would fix it:

--- a/asyncio/tasks.py  Fri Apr 18 09:51:35 2014 -0700
+++ b/asyncio/tasks.py  Thu Apr 24 23:44:57 2014 -0700
@@ -76,7 +76,8 @@
 return self.gen.gi_code

 def __del__(self):
-frame = self.gen.gi_frame
+gen = getattr(self, 'gen', None)
+frame = getattr(gen, 'gi_frame', None)
 if frame is not None and frame.f_lasti == -1:
 func = self.func
 code = func.__code__

--

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



[issue17552] socket.sendfile()

2014-04-25 Thread akira

akira added the comment:

 I'm confused. Why is blocksize necessary at all?

My guess, it may be used to implement socket.send()-based fallback. Its meaning 
could be the same as *length* parameter in shutil.copyfileobj

The fallback is useful if os.sendfile doesn't exists or it doesn't accept given 
parameters e.g., if *file* is not mmap-like enough for os.sendfile.

  using os.path.getsize(file.name) looks risky to me

 Why not fstat(fd) ?

os.path.getsize(file.name) in msg217121 is a pseudo-code (as said
in the comment) that expresses the intent that if *nbytes* parameter
is not specified (None) then socket.sendfile should send bytes from
the file until EOF is reached. 

In real code, if *nbytes is None*;  I would just call os.sendfile
repeatedly with a large constant *nbytes* parameter
until os.sendfile returns 0 (meaning EOF) 
without asking the file size explicitly

It assumes socket.sendfile doesn't specify its behaviour if the file
size changes between the calls.

The pseudo-code in msg217121 is my opinion about the public interface for 
socket.sendfile -- It is different from the one in the current 
socket-sendfile5.patch

--

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



[issue21348] File C:\Python27\lib\distutils\msvc9compiler.py, line 295, in query_vcvarsal l raise ValueError(str(list(result.keys()))) ValueError: [u'path']

2014-04-25 Thread Stefan Krah

Stefan Krah added the comment:

This looks like a duplicate of #7511.

--
nosy: +skrah
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - msvc9compiler.py: ValueError when trying to compile with VC 
Express

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



[issue20434] Fix error handler of _PyString_Resize() on allocation failure

2014-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4f79c3827adc by Kristján Valur Jónsson in branch '2.7':
Issue #20434 Correct error handlin of _PyString_Resize and _PyBytes_Resize
http://hg.python.org/cpython/rev/4f79c3827adc

--
nosy: +python-dev

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +zach.ware

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



[issue21225] io.py: Improve docstrings for classes

2014-04-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e33a036fd784 by Andrew Kuchling in branch '3.4':
#21225: copy docstrings from base classes
http://hg.python.org/cpython/rev/e33a036fd784

--
nosy: +python-dev

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



[issue21336] ntpath.splitdrive fails on None argument

2014-04-25 Thread Eric V. Smith

Eric V. Smith added the comment:

I'm going to close this as not a bug. Feel free to reopen it if there's use 
case for passing in None.

--
resolution:  - not a bug
stage:  - resolved
status: open - closed

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



[issue1465646] test_grp test_pwd fail

2014-04-25 Thread yaccz

yaccz added the comment:

Also fails on group + which is afaik a thing for ldap.

tested with python 2.6.9 on suse linux enterprise

--
nosy: +yaccz

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



[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns

New submission from Brian Kearns:

In file.writelines, the conditions in this if statement are bogus. If 
f-f_binary and AsReadBuffer succeeds (returns 0), AsCharBuf is still tried. 
So, for example, passing an array('c') to a file('wb').writelines fails, when 
it seems the intention of the code/comments was to have it succeed.

--
files: fix_file_writelines-py27.patch
keywords: patch
messages: 217162
nosy: bdkearns
priority: normal
severity: normal
status: open
title: bug in file.writelines accepting buffers
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file35036/fix_file_writelines-py27.patch

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



[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns

Changes by Brian Kearns bdkea...@gmail.com:


Removed file: http://bugs.python.org/file35036/fix_file_writelines-py27.patch

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



[issue21350] bug in file.writelines accepting buffers

2014-04-25 Thread Brian Kearns

Changes by Brian Kearns bdkea...@gmail.com:


Added file: http://bugs.python.org/file35037/fix_file_writelines-py27.patch

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



[issue21305] PEP 466: update os.urandom

2014-04-25 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Zachary Ware

New submission from Zachary Ware:

The new test fails with the patch applied:

==
ERROR: test_setvalueex_with_memoryview (__main__.LocalWinregTests)
--
Traceback (most recent call last):
  File P:\ath\to\2.7\cpython\lib\test\test_winreg.py, line 336, in 
test_setvalueex_with_memoryview
SetValueEx(ck, test_name, None, REG_BINARY, memoryview('val'))
TypeError: Objects of type 'memoryview' can not be used as binary registry 
values

--

--

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns

Brian Kearns added the comment:

Oops, updated test.

--
Added file: http://bugs.python.org/file35038/fix_winreg_setvalueex-py27.patch

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns

Changes by Brian Kearns bdkea...@gmail.com:


Removed file: http://bugs.python.org/file35031/fix_winreg_setvalueex-py27.patch

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



[issue17552] socket.sendfile()

2014-04-25 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Given the opinions expressed so far I:
- got rid of the blocksize parameter
- got rid of the use_fallback parameter
- added a count parameter
- used os.fstat() to figure out the total file size and passed it directly to 
sendfile()

I'm attaching socket-sendfile6.patch which includes docs and many new tests.
Hopefully this should be the final one (yet to review though).

--
Added file: http://bugs.python.org/file35039/socket-sendfile6.patch

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



[issue21344] save scores or ratios in difflib get_close_matches

2014-04-25 Thread Russell Ballestrini

Russell Ballestrini added the comment:

Adding patch to update tests to use Tim Peters suggestion of assertListEqual 
over assertEqual for list compares.

--
Added file: 
http://bugs.python.org/file35040/diff-lib-tim-peters-assert-list-equals.patch

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



[issue21347] Don't use a list argument together with shell=True in subprocess' docs

2014-04-25 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo
versions: +Python 2.7, Python 3.4

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



[issue21338] Silent mode for compileall

2014-04-25 Thread Éric Araujo

Éric Araujo added the comment:

Patch looks to me comprehensive and backward-compatible.  Thanks Thomas!

--
nosy: +eric.araujo
stage: needs patch - commit review
type:  - enhancement

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Min RK

New submission from Min RK:

Reference counts appear to be ignored at process cleanup, which allows 
inter-dependent `__del__` methods to hang on exit. The problem does not seem to 
occur for garbage collection of any other context (functions, etc.).

I have a case where one object must be cleaned up after some descendent 
objects. Those descendents hold a reference on the parent and not vice versa, 
which should guarantee that they are cleaned up before the parent. This 
guarantee is satisfied by Python 3.3 and below, but not 3.4.

The attached test script hangs at exit on most (not all) runs on 3.4, but exits 
cleanly on earlier versions.

--
components: Interpreter Core
files: tstgc.py
messages: 217168
nosy: minrk
priority: normal
severity: normal
status: open
title: refcounts not respected at process exit
versions: Python 3.4
Added file: http://bugs.python.org/file35041/tstgc.py

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Nathan Stocks

Nathan Stocks added the comment:

This affects me as well.  I have to manually clean up objects in the correct 
order in script I am working on under 3.4.0.  I have this problem under both OS 
X 10.9.2 Mavericks and under CentOS 6.5

--
nosy: +nathan.stocks

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



[issue21352] improve indexing

2014-04-25 Thread bob gailer

New submission from bob gailer:

Inconsistencies / confusion with documentation Index Tab. Example (line numbers 
added for comments that follow):

1 max
2   built-in function
3 max  (datetime.date attribute)
4   (datetime.datetime attribute)
5   (datetime.time attribute)
6 max() built-in function
7   (decimal.Context method)
8   (decimal.Decimal method)
9   (in module audioloop)

The following all lead to confusion and frustration:
Having 3 rows (1, 3, 6)that begin with max. 
Having an entry (1) that does nothing when double-clicked.
double-clicking (2) takes us to a reference rather than a definition.

RECOMMENDATION:
change to:
max() built-in function
  (sequence operation)
  (decimal.Context method)
  (decimal.Decimal method)
max
  (datetime.date attribute)
  (datetime.datetime attribute)
  (datetime.time attribute)

where double-clicking the first line goes to the max() definition
in 2. Built-in Functions


These comments apply, with a number of variations, to most built-in functions 
index entries.

--
assignee: docs@python
components: Documentation
messages: 217170
nosy: bgailer, docs@python
priority: normal
severity: normal
status: open
title: improve indexing
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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



[issue21352] improve indexing

2014-04-25 Thread Zachary Ware

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


--
versions:  -Python 3.1, Python 3.2, Python 3.3

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



[issue21344] save scores or ratios in difflib get_close_matches

2014-04-25 Thread Tim Peters

Tim Peters added the comment:

Russell, I'm still looking for a sufficiently compelling use case here:  
something tangible and useful that can be done with the new function that can't 
be easily done now.

I plan to write a web API that accepts a word, 'doge' and returns a list of 
possible suggestions and scores is not a use case for scores.  It's merely 
tautological that if you want to return scores then you need a function that 
does return scores.  A use case would more address _why_ the scores are 
useful.  What would the user of your web API _do_ with the scores?  What's the 
point?

users may want to cache (memonize) common queries for super fast look ups 
isn't a use case for scores either.  If they wanted to, they could already 
cache the results of calling `get_close_matches()` - the results of any 
function can be cached; exposing scores has nothing to do with whether results 
can be cached.

the new function will give end-users the opportunity to inspect the scoring 
algos output is also more tautological than a use case.  _Why_ would a user 
want to stare at the scores?  What useful things(s) could they do with them?

I was added to this issue because I wrote these functions to begin with.  At 
the time, I thought - and asked - about exposing the scores, but nobody 
(including me) had a _use_ for doing so that justified the added bother of 
writing  maintaining the additional code and tests and docs.

I'm stilling looking for a use here more substantial than, essentially, just 
saying well, without showing the scores we can't show the scores. To me the 
scores just aren't interesting beyond which words' scores exceed a cutoff, and 
the ordering of words based on their similarity scores - but 
`get_close_matches()` already captures those uses.  What other use(s) _do_ you 
have for the scores?  I'm afraid just to display them isn't compelling enough 
- you're the only one ever to ask for that, and you already know how to do it 
yourself ;-)

--

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Tim Peters

Tim Peters added the comment:

Just noting that, for me, the problem goes away if

del c, c2

is added as the last line of the test.  This suggests the problem is due to 
changes in end-of-life module cleanup.

Without that line, I see 3 kinds of output:

1.
del child
del child
del parent
parent deleted

2.
del parent
parent still has 2 children
parent still has 2 children
... repeated forever ...

3.
del child
del parent
parent still has 1 children
parent still has 1 children
... repeated forever ...

--
nosy: +tim.peters

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



[issue16104] Compileall script: add option to use multiple cores

2014-04-25 Thread Jim Jewett

Jim Jewett added the comment:

ProcessPoolExecutor already defaults to using cpu_count if max_workers is None. 
 Consistency with that might be useful too.  (and a default of 1 to mean 
nothing in parallel is sensible...)

--
nosy: +Jim.Jewett

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Tim Peters

Changes by Tim Peters t...@python.org:


--
nosy: +pitrou

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



[issue21344] save scores or ratios in difflib get_close_matches

2014-04-25 Thread Russell Ballestrini

Russell Ballestrini added the comment:

Tim,

You bring up some great points and insight I was missing.

To me the scores just aren't interesting beyond which words' scores exceed a 
cutoff, and the ordering of words based on their similarity scores - but 
`get_close_matches()` already captures those uses.

For a *word*, and a corpus of *possibilities*, how does one choose a 
satisfactory *cutoff* without inspecting the output of the scoring algorithm?

Personally, I don't want to inpect scores for inspection sake, I want to 
inspect scores so I can make an informed decision for the *n* and *cutoff* 
input arguments.

Its true that after reading and digesting the source code for 
`get_close_matches()` I could (and did) implement a version that returns 
scores.  My goal was to share this code and what better way then to fix the 
problem upstream.

I understand the desire to keep the standard library lean and useful to reduce 
the amount of burden the code is to maintain.  I will understand if we decide 
not to include these patches, I can always maintain a fork and share on pypi.

--

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



[issue20050] distutils should check PyPI certs when connecting to it

2014-04-25 Thread William Tisäter

Changes by William Tisäter will...@defunct.cc:


--
nosy: +tiwilliam

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



[issue21314] Document '/' in signatures

2014-04-25 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
status: open - 
title: Bizarre help - Document '/' in signatures

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-25 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.5 -Python 3.1, Python 3.2, Python 3.3

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



[issue21325] Missing Generic EXIF library for images in the standard library

2014-04-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Generic ideas like this, without specific patch or patch prospect, should be 
first posted on python-ideas. You can reopen this if there is a concrete 
proposal with some support.

However, I agree with Brett about an Exif module. We do not even have an image 
library in the stdlib. And according to
https://en.wikipedia.org/wiki/Exchangeable_image_file_format
the 'standard' is in practice a bit of a mess with constantly added extensions. 
There are multiple Exif modules on PyPi and that is where they belong, along 
with 1000s of other niche modules.
https://pypi.python.org/pypi?%3Aaction=searchterm=Exifsubmit=search

--
nosy: +terry.reedy
resolution:  - rejected
stage:  - resolved
status: open - closed
versions: +Python 3.5

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



[issue21337] Add tests for Tix

2014-04-25 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +serhiy.storchaka

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



[issue21341] Configuring 'font' with ttk.Style for 'TEntry' does not change displayed font

2014-04-25 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This appears to be a tcl/tk(ttk) issue. You rediscovered what is documented 
here:
http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-Entry.html
Table 40. ttk.Entry options
fontUse this option to specify the font of the text that will appear in the 
widget; see Section 5.4, “Type fonts”. For reasons that are unclear to the 
author, this option cannot be specified with a style.

--
nosy: +terry.reedy
resolution:  - third party
stage:  - resolved
status: open - closed
versions: +Python 3.5

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



[issue8387] use universal newline mode in csv module examples

2014-04-25 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions:  -Python 3.1, Python 3.2

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(the 3 kinds of output are probably due to hash randomization)

--

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looking into it, it's normal for refcounts to be ignored: those objects 
belong to reference cycles:

tstgc.__dict__
- p (or c, or c2)
- p.__class__ (i.e. Parent, or Child respectivel))
- Parent.__dict__
- Parent.__del__ (or Parent.__init__, or Parent.child)
- Parent.__del__.__globals__ (which is tstgc.__dict__)

Since p, c, c2 belong to reference cycles, they get collected in an undefined 
order.

Obviously, Parent.__del__ is buggy (it runs into an infinite loop when 
self.children != 0).

Before Python 3.4, the module globals would have been set to None at shutdown, 
which would have broken those cycles, but caused other well-known problems. 
It's probably impossible to find a scheme that satisfies all constraints, so 
we'll see in the future if the new scheme brings more drawbacks than advantages 
(right now, my own evaluation is obviously that it's a step forward).

--

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



[issue21351] refcounts not respected at process exit

2014-04-25 Thread Tim Peters

Tim Peters added the comment:

I think Antoine is right on all counts.  The most surprising bit may be that p, 
c, and c2 are in reference cycles, but - surprising or not - that's always been 
true.  The reason it worked before 3.4 is that CPython happened to break the 
cycles via the nasty hack of binding each module global to None at shutdown.

minrk, note that gc in CPython does not (for example) run in a separate thread. 
 That's why, when it triggers, the infinite loop in your Parent.__del__ will in 
fact run forever.  gc runs in the same thread (the main thread) as 
Parent.__del__, so spinning in the Parent.__del__ loop prevents anything else 
(including more gc) from ever being done.

Take out the infinite loop, and all three objects (p, c, c2) are collected.  
But the order in which they're collected isn't defined (because they're all in 
cyclic trash), and even changes from run to run because hash randomization 
changes the order in which they appear when traversing testgc.__dict__.

An interesting question remaining is how you _could_ force a finalization order 
in this case, in a way that doesn't rely on implementation accidents.  A clean 
way doesn't spring to my mind immediately.

--

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Haven't reviewed the patch, but you should definitely add a unit test for the 
bugfix.

--

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Brian, it's not obvious (to me) what the original issue is (crash?) and why 
the new test expects a TypeError.
Also, is it a 2.7-only issue or does it also affect Python 3?

--
nosy: +pitrou, stutzbach

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



[issue21349] crash in winreg SetValueEx with memoryview

2014-04-25 Thread Brian Kearns

Brian Kearns added the comment:

Are you aware of the old/new buffer interfaces and their usages? Did you 
actually try the code? crash would be obvious.

Objects that support only the new buffer interface define tp_as_buffer with 
fields representing the old buffer interface as null.

So, everywhere that uses the old buffer interface usually checks both 
tp_as_buffer != NULL and tp_as_buffer-bf_getreadbuffer != NULL. That second 
check is missing here before calling bf_getreadbuffer.

--

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



[issue21353] document Popen.args attribute

2014-04-25 Thread akira

New submission from akira:

It is convenient to have Popen.args available. Especially when dealing 
with multiple processes e.g., to log failures mentioning the command
that was used to spawn the child process.

subprocess module itself uses it while raising CalledProcessError or 
TimeoutExpired exceptions.

The documentation patch is attached.

--
assignee: docs@python
components: Documentation
files: docs-subprocess-document_Popen_args_attribute.patch
keywords: patch
messages: 217183
nosy: akira, docs@python
priority: normal
severity: normal
status: open
title: document Popen.args attribute
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5
Added file: 
http://bugs.python.org/file35042/docs-subprocess-document_Popen_args_attribute.patch

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