Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-20 Thread Mark Janssen
On Thu, Apr 18, 2013 at 11:31 PM, Jason Wilkins jason.a.wilk...@gmail.com wrote: I don't quite think I understand what you are saying. Are you saying that mathematical models are not a good foundation for computer science because computers are really made out of electronic gates? No, I'm

Free book, Hacking Secret Ciphers with Python

2013-04-20 Thread asweigart
I've released my third book, Hacking Secret Ciphers with Python for free under a Creative Commons license. This book is aimed at people who have no experience programming or with cryptography. The book goes through writing Python programs that not only implement several ciphers but also can

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-20 Thread Mark Janssen
I think there is some misunderstanding here. Being mathematical in academic work is a way of making our ideas rigorous and precise, instead of trying to peddle wooly nonsense. I'm sorry. I am responsible for the misunderstanding. I used the word math when I really mean symbolic logic

Re: [TYPES] The type/object distinction and possible synthesis of OOP and imperative programming languages

2013-04-20 Thread 88888 Dihedral
Ned Batchelder於 2013年4月20日星期六UTC+8上午12時41分03秒寫道: On 4/19/2013 12:16 PM, Steven D'Aprano wrote: On Fri, 19 Apr 2013 12:02:00 -0400, Roy Smith wrote: PS: a great C++ interview question is, What's the difference between a class and a struct? Amazing how few self-professed C++

Re: Encoding NaN in JSON

2013-04-20 Thread Chris “Kwpolska” Warrick
On Fri, Apr 19, 2013 at 9:42 PM, Grant Edwards invalid@invalid.invalid wrote: The OP asked for a string, and I thought you were proposing the string 'null'. If one is to use a string, then 'NaN' makes the most sense, since it can be converted back into a floating point NaN object. I infer

Re: Free book, Hacking Secret Ciphers with Python

2013-04-20 Thread Karim
On 20/04/2013 08:37, asweig...@gmail.com wrote: I've released my third book, Hacking Secret Ciphers with Python for free under a Creative Commons license. This book is aimed at people who have no experience programming or with cryptography. The book goes through writing Python programs that

Re: Different cache filename

2013-04-20 Thread Dave Angel
On 04/20/2013 01:37 AM, Fabian PyDEV wrote: Hi, when load a module mymodule.py with importlib.machinery.SourceFileLoader a bytecode file is created as mymodule.cpython-33.pyc. If I load a module mymodule.ext.py the same way the same bytecode file is created as mymodule.cpython-33.pyc. Is

Re: unzipping a zipx file

2013-04-20 Thread Serhiy Storchaka
19.04.13 20:59, b_erickson1 написав(ла): I have python 2.6.2 and I trying to get it to unzip a file made with winzip pro. The file extension is zipx. This is on a windows machine where I have to send them all that files necessary to run. I am packaging this with py2exe. I can open the

Re: Ubuntu package python3 does not include tkinter

2013-04-20 Thread Sibylle Koczian
Am 19.04.2013 19:42, schrieb lcrocker: I understand that for something like a server distribution, but Ubuntu is a user-focused desktop distribution. It has a GUI, always. The purpose of a distro like that is to give users a good experience. If I install Python on Windows, I get to use Python.

itertools.groupby

2013-04-20 Thread Jason Friedman
I have a file such as: $ cat my_data Starting a new group a b c Starting a new group 1 2 3 4 Starting a new group X Y Z Starting a new group I am wanting a list of lists: ['a', 'b', 'c'] ['1', '2', '3', '4'] ['X', 'Y', 'Z'] [] I wrote this:

Is Unicode support so hard...

2013-04-20 Thread jmfauth
In a previous post, http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# , Chris “Kwpolska” Warrick wrote: “Is Unicode support so hard, especially in the 21st century?” -- Unicode is not really complicate and it works very well (more than two decades of

Re: Is Unicode support so hard...

2013-04-20 Thread Ned Batchelder
On 4/20/2013 1:12 PM, jmfauth wrote: In a previous post, http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# , Chris “Kwpolska” Warrick wrote: “Is Unicode support so hard, especially in the 21st century?” -- Unicode is not really complicate and it works

Re: itertools.groupby

2013-04-20 Thread Ned Batchelder
On 4/20/2013 1:09 PM, Jason Friedman wrote: I have a file such as: $ cat my_data Starting a new group a b c Starting a new group 1 2 3 4 Starting a new group X Y Z Starting a new group I am wanting a list of lists: ['a', 'b', 'c'] ['1', '2', '3', '4'] ['X', 'Y', 'Z'] [] I wrote this:

Re: Is Unicode support so hard...

2013-04-20 Thread Benjamin Kaplan
On Sat, Apr 20, 2013 at 10:22 AM, Ned Batchelder n...@nedbatchelder.com wrote: On 4/20/2013 1:12 PM, jmfauth wrote: In a previous post, http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# , Chris “Kwpolska” Warrick wrote: “Is Unicode support so hard,

Re: Is Unicode support so hard...

2013-04-20 Thread Chris Angelico
On Sun, Apr 21, 2013 at 3:22 AM, Ned Batchelder n...@nedbatchelder.com wrote: I'm totally confused about what you are saying. What does make a better Unicode than Unicode mean? Are you saying that Python is guilty of this? In what way? Can you provide specifics? Or are you saying that you

Re: Is Unicode support so hard...

2013-04-20 Thread Chris “Kwpolska” Warrick
On Sat, Apr 20, 2013 at 8:02 PM, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Sat, Apr 20, 2013 at 10:22 AM, Ned Batchelder n...@nedbatchelder.com wrote: On 4/20/2013 1:12 PM, jmfauth wrote: In a previous post,

Re: Is Unicode support so hard...

2013-04-20 Thread Mark Lawrence
On 20/04/2013 19:02, Benjamin Kaplan wrote: On Sat, Apr 20, 2013 at 10:22 AM, Ned Batchelder n...@nedbatchelder.com wrote: On 4/20/2013 1:12 PM, jmfauth wrote: In a previous post, http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# , Chris “Kwpolska”

Dear Human !!!!!!!!!!!!!!

2013-04-20 Thread BV BV
Dear Human! The lecturer says at the beginning of the video, I am talking to you as a human; it does not matter whether you are Christian, Jew, Buddhist or Hindu. It does not matter whether you are a worshipper of idols, atheist, religious, secularist, a man or woman. I talk and address you as a

Include and lib files for Visual Studio?

2013-04-20 Thread xucaen
I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like to use python 3.3.1 if possible. I found the msi on

Re: itertools.groupby

2013-04-20 Thread Wolfgang Maier
Jason Friedman jsf80238 at gmail.com writes: I have a file such as: $ cat my_data  Starting a new group a b c Starting a new group 1 2 3 4 Starting a new group X Y Z Starting a new group I am wanting a list of lists: ['a', 'b', 'c'] ['1', '2', '3', '4'] ['X',

Re: Include and lib files for Visual Studio?

2013-04-20 Thread Andrew Berg
On 2013.04.20 15:59, xuc...@gmail.com wrote: I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like to use

Re: Include and lib files for Visual Studio?

2013-04-20 Thread David Robinow
On Sat, Apr 20, 2013 at 4:59 PM, xuc...@gmail.com wrote: I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like

Re: Cross-compiling Python for ARM?

2013-04-20 Thread Gilles
On Tue, 16 Apr 2013 17:22:55 +0300, Anssi Saari a...@sci.fi wrote: In any case, cross compiling Python shouldn't be that hard. I just recently built 2.7.3 for my OpenWRT router since the packaged Python didn't have readline support (some long standing linking issue with readline and ncurses and

Re: Is Unicode support so hard...

2013-04-20 Thread Neil Hodgson
Hi jmf, This gives me plenty of ideas to test the flexible string representation (FSR). I should recognize this FSR is failing particulary very well... This is too vague for me. Which string representation should Python use? 1) UTF-32 2) UTF-8 3) Python 3.3 -- 1, 2, or 4 bytes per

There must be a better way

2013-04-20 Thread Colin J. Williams
Below is part of a script which shows the changes made to permit the script to run on either Python 2.7 or Python 3.2. I was surprised to see that the CSV next method is no longer available. Suggestions welcome. Colin W. def main(): global inData, inFile if ver == '2':

Re: There must be a better way

2013-04-20 Thread Chris Rebert
On Sat, Apr 20, 2013 at 4:46 PM, Colin J. Williams c...@ncf.ca wrote: Below is part of a script which shows the changes made to permit the script to run on either Python 2.7 or Python 3.2. I was surprised to see that the CSV next method is no longer available. Suggestions welcome. snip

Re: There must be a better way

2013-04-20 Thread Steven D'Aprano
On Sat, 20 Apr 2013 19:46:07 -0400, Colin J. Williams wrote: Below is part of a script which shows the changes made to permit the script to run on either Python 2.7 or Python 3.2. I was surprised to see that the CSV next method is no longer available. This makes no sense. What's the CSV

Re: itertools.groupby

2013-04-20 Thread Steven D'Aprano
On Sat, 20 Apr 2013 11:09:42 -0600, Jason Friedman wrote: I have a file such as: $ cat my_data Starting a new group a b c Starting a new group 1 2 3 4 Starting a new group X Y Z Starting a new group I am wanting a list of lists: ['a', 'b', 'c'] ['1', '2', '3', '4'] ['X',

Re: There must be a better way

2013-04-20 Thread Tim Chase
On 2013-04-21 00:06, Steven D'Aprano wrote: On Sat, 20 Apr 2013 19:46:07 -0400, Colin J. Williams wrote: Below is part of a script which shows the changes made to permit the script to run on either Python 2.7 or Python 3.2. I was surprised to see that the CSV next method is no longer

Re: Include and lib files for Visual Studio?

2013-04-20 Thread Terry Jan Reedy
On 4/20/2013 4:59 PM, xuc...@gmail.com wrote: I am looking for the Python include and lib files for windows. I have a c++ project that I am importing into Visual Studio 2010 (express) and it links python. I need the include and lib files for windows. Where can I get them? I'd like to use

Re: There must be a better way

2013-04-20 Thread Terry Jan Reedy
On 4/20/2013 8:34 PM, Tim Chase wrote: In 2.x, the csv.reader() class (and csv.DictReader() class) offered a .next() method that is absent in 3.x In Py 3, .next was renamed to .__next__ for *all* iterators. The intention is that one iterate with for item in iterable or use builtin functions

Re: Is Unicode support so hard...

2013-04-20 Thread Ethan Furman
On 04/20/2013 11:14 AM, Chris Angelico wrote: Flash forward to current date, and jmf has hijacked so many threads to moan about PEP 393 that I'm actually happy about this one, simply because he gave it a new subject line and one appropriate to a discussion about Unicode. +1000 --

Re: Is Unicode support so hard...

2013-04-20 Thread rusi
On Apr 21, 4:03 am, Neil Hodgson nhodg...@iinet.net.au wrote:     Hi jmf, This gives me plenty of ideas to test the flexible string representation (FSR). I should recognize this FSR is failing particulary very well...     This is too vague for me.     Which string representation should

clear the screen

2013-04-20 Thread Yuanyuan Li
How to clear the screen? For example, in the two player game. One player sets a number and the second player guesses the number. When the first player enters the number, it should be cleared so that the second number is not able to see it. My question is how to clear the number. Thank you! --

Re: Is Unicode support so hard...

2013-04-20 Thread Steven D'Aprano
On Sat, 20 Apr 2013 18:37:00 -0700, rusi wrote: According to jmf python sucks up to ASCII (those big bad Americans… of whom Steven is the first…) Watch who you're calling an American, mate. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Unicode support so hard...

2013-04-20 Thread Chris Angelico
On Sun, Apr 21, 2013 at 1:36 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 20 Apr 2013 18:37:00 -0700, rusi wrote: According to jmf python sucks up to ASCII (those big bad Americans… of whom Steven is the first…) Watch who you're calling an American, mate. I think

[issue3693] Obscure array.array error message

2013-04-20 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: Here's a patch to fix the exception. -- keywords: +patch Added file: http://bugs.python.org/file29949/fix_array_err_msg.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3693

[issue17468] Generator memory leak

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: I'll create a separate issue for the tp_del - __del__ question, since that's a language design decision that *does* need Guido's input, but doesn't relate to the broader question of generators, cycles and potential memory leaks. --

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Nick Coghlan
New submission from Nick Coghlan: This came up in issue 17468: currently, populating tp_del from C (as generators now do) doesn't automatically create a __del__ wrapper visible from Python. The rationale given in the initial commit is that there's no need to define a wrapper, since tp_del

[issue17468] Generator memory leak

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 17800 is anyone wants to weigh in on the tp_del - __del__ question (I ended up not adding Guido back to that one either, since the original design was based on an assumption that's now demonstrably false, so it makes sense to update the behaviour)

[issue17801] Tools/scripts/gprof2html.py: `#! /usr/bin/env python32.3`

2013-04-20 Thread C Anthony Risinger
New submission from C Anthony Risinger: http://hg.python.org/cpython/file/d499189e7758/Tools/scripts/gprof2html.py#l1 ...should be self explanatory. i didn't run into this myself, but i saw that the Archlinux package was fixing it via `sed`, without the customary link to upstream... so here

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: Would this mean that the destructor could be run more than once (or prematurely)? -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17800 ___

[issue17468] Generator memory leak

2013-04-20 Thread Anssi Kääriäinen
Anssi Kääriäinen added the comment: I wonder if it would be better to reword the garbage collection docs to mention that Python can't collect objects if they are part of a reference cycle, and some of the objects in the reference cycle need to run code at gc time. Then mention that such

[issue1635741] Interpreter seems to leak references after finalization

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz, pconnell ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1635741 ___ ___

[issue17408] second python execution fails when embedding

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz, pconnell ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17408 ___ ___

[issue17802] html.HTMLParser raises UnboundLocalError:

2013-04-20 Thread Baptiste Mispelon
New submission from Baptiste Mispelon: When trying to parse the string `ab`, the parser raises an UnboundLocalError: {{{ from html.parser import HTMLParser p = HTMLParser() p.feed('ab') p.close() Traceback (most recent call last): File stdin, line 1, in module File

[issue9634] Add timeout parameter to Queue.join()

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9634 ___ ___ Python-bugs-list

[issue17468] Generator memory leak

2013-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I wonder if it would be better to reword the garbage collection docs to mention that Python can't collect objects if they are part of a reference cycle, and some of the objects in the reference cycle need to run code at gc time. Then mention that such

[issue17545] os.listdir and os.path.join inconsistent on empty path

2013-04-20 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- keywords: +easy stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17545 ___

[issue17802] html.HTMLParser raises UnboundLocalError:

2013-04-20 Thread R. David Murray
R. David Murray added the comment: Thanks for the report. Yes, that's in a complicated bit of error recovery code, and clearly you found a path through it that doesn't have a corresponding test :) -- keywords: +easy nosy: +ezio.melotti, r.david.murray stage: - needs patch type:

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Sounds reasonable to me. Note that it won't remove the special-casing in gcmodule.c: static int has_finalizer(PyObject *op) { if (PyGen_CheckExact(op)) return PyGen_NeedsFinalizing((PyGenObject *)op); else return op-ob_type-tp_del !=

[issue17802] html.HTMLParser raises UnboundLocalError:

2013-04-20 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: - ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17802 ___ ___

[issue17803] Calling Tkinter.Tk() with a baseName keyword argument throws UnboundLocalError

2013-04-20 Thread Yasuhiro Fujii
New submission from Yasuhiro Fujii: Calling Tkinter.Tk() with baseName keyword argument throws UnboundLocalError on Python 2.7.4. A process to reproduce the bug: import Tkinter Tkinter.Tk(baseName=test) Traceback (most recent call last): File stdin, line 1, in module File

[issue17468] Generator memory leak

2013-04-20 Thread Anssi Kääriäinen
Anssi Kääriäinen added the comment: I was imagining that the collection should happen in two passes. First check for tp_dels and call them if safe (single tp_del in cycle allowed). Then free the memory. The first pass is already there, it just doesn't collect callable tp_dels. If it would be

[issue14531] Backtrace should not attempt to open stdin file

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14531 ___ ___ Python-bugs-list

[issue17272] request.full_url: unexpected results on assignment

2013-04-20 Thread R. David Murray
R. David Murray added the comment: Thanks for working on this, Demian. I made some review comments, mostly style things about the tests. There's one substantial comment about the change in behaivor of the full_url property though (before patch it does not include the fragment, after the

[issue17795] backwards-incompatible change in SysLogHandler with unix domain sockets

2013-04-20 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- hgrepos: +183 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17795 ___ ___ Python-bugs-list

[issue17795] backwards-incompatible change in SysLogHandler with unix domain sockets

2013-04-20 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: Added file: http://bugs.python.org/file29950/6e46f4e08717.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17795 ___

[issue17795] backwards-incompatible change in SysLogHandler with unix domain sockets

2013-04-20 Thread Vinay Sajip
Vinay Sajip added the comment: I've attached an alternative patch. The default socktype stays as socket.SOCK_DGRAM, but you can specify socktype=None to get the SOCK_DGRAM falling back to SOCK_STREAM behaviour. Can you confirm that this alternative approach works in your environment? (This

[issue17803] Calling Tkinter.Tk() with a baseName keyword argument throws UnboundLocalError

2013-04-20 Thread R. David Murray
R. David Murray added the comment: Thanks for the report and patch. It would be nice to turn that test into a unit test. I've run the test on 3.4; this appears to be a 2.7 only bug. -- nosy: +r.david.murray stage: - test needed ___ Python tracker

[issue17468] Generator memory leak

2013-04-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: In a sense, doing something like with self.lock in a generator is already a leak. Even if there wasn't a cycle, collection could be arbitrarily delayed (in partincular on non-CPython VMs). I wonder if making generators context managers which call close()

[issue17468] Generator memory leak

2013-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Those are two different issues: - not calling the finalizer in a timely manner - never calling the finalizer and creating a memory leak through gc.garbage -- ___ Python tracker rep...@bugs.python.org

[issue14621] Hash function is not randomized properly

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz, pconnell ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14621 ___ ___

[issue17468] Generator memory leak

2013-04-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: I realize, but if people were responsible and closed their generators, the second one would be as much of a problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17468

[issue6359] pyexpat.c calls trace function incorrectly for exceptions

2013-04-20 Thread Ned Batchelder
Ned Batchelder added the comment: Attached a patch which simply removes the code that invokes the trace function. -- keywords: +patch Added file: http://bugs.python.org/file29951/6539.patch ___ Python tracker rep...@bugs.python.org

[issue17192] libffi-3.0.13 import

2013-04-20 Thread koobs
koobs added the comment: These break what was addressed in #11729 for default, 3,x and 3.3. 2.7 seems to have made it through unscathed. I'm not sure where or how the old code was introduced, but the clang fix has been upstreamed and is correct in the pure libffi 3.0.13 sources Failure to

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: What exactly would calling such a wrapper do? -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17800 ___

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Martin Morrison
Martin Morrison added the comment: On 20/04/2013 03:54, Benjamin Peterson wrote: It would be great to have a test for that. :) I was afraid you'd say that. ;-) I'll look at adding test cases to cover the functions not currently covered (seems most of the print functions aren't, and all of the

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Martin Morrison
Changes by Martin Morrison m...@ensoft.co.uk: -- nosy: +isoschiz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17800 ___ ___ Python-bugs-list

[issue17192] libffi-3.0.13 import

2013-04-20 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17192 ___ ___

[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-20 Thread koobs
koobs added the comment: heads-up: Tests are still failing on FreeBSD (gcc clang) buildbots: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%20dtrace%202.7/builds/472/steps/test/logs/stdio

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17800 ___ ___ Python-bugs-list mailing

[issue17468] Generator memory leak

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: We can't make ordinary generators innately context managers, as it makes the error too hard to detect when you accidentally leave out @contextmanager when using a generator to write a custom one. You can already use contextlib.closing to forcibly close them

[issue968063] Add fileinput.islastline()

2013-04-20 Thread Mark Lawrence
Mark Lawrence added the comment: The latest patch still applies cleanly, can we have it reviewed please. -- nosy: +BreamoreBoy versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue968063

[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2013-04-20 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Ezio, the problem with your patch is that it also gives a warning on this code, which is totally safe: def good(): exc = None try: bar(int(sys.argv[1])) except KeyError as e: print('ke') exc = e except ValueError as e:

[issue17468] Generator memory leak

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: To get back to Anssi's original suggestion... I think Anssi's proposal to allow finalisation to be skipped for try/except/else is legitimate. It's only finally clauses that we try to guarantee will execute, there's no such promise implied for ordinary except

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: Calling __del__ explicitly shouldn't be any worse than doing the same thing for any other type implemented in Python (or, in the case of generators, calling close() multiple times). What I'm mostly interested in is the can this type cause uncollectable cycles

[issue17800] Expose __del__ when tp_del is populated from C code

2013-04-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: I don't understand why we need to invent a protocol for this. The gc module already has methods and members for introspecting the collection. I don't think the gen special casing currently needs to be generalized. (What would use it?) --

[issue17468] Generator memory leak

2013-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: We *don't care* if the generator *would* have caught the thrown GeneratorExit, we only care about ensuring that finally blocks are executed (including those implied by with statements). So if there aren't any finally clauses or with statements in the block

[issue17800] Add gc.needs_finalizing() to check if an object needs finalising

2013-04-20 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I've figured out that rather than exposing __del__ if tp_del is populated, or generalising the generator special case, the simplest way to make this info accessible is to be able to ask the *garbage collector* if it thinks an object needs finalising.

[issue17547] checking whether gcc supports ParseTuple __format__... erroneously returns yes with gcc 4.8

2013-04-20 Thread Alex Leach
Alex Leach added the comment: The configure.ac patch works for me, on x86_64 Arch Linux. I just updated to GCC-4.8.0 and came across an overwhelming number of these warnings when compiling extension modules. Thanks for the simple fix David. Tested on hg branch 2.7; the testsuite completes

[issue16694] Add pure Python operator module

2013-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 97834382c6cc by Antoine Pitrou in branch 'default': Issue #16694: Add a pure Python implementation of the operator module. http://hg.python.org/cpython/rev/97834382c6cc -- nosy: +python-dev ___ Python

[issue16694] Add pure Python operator module

2013-04-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've now commited the latest patch. Thank you very much, Zachary! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue17409] resource.setrlimit doesn't respect -1

2013-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 186f6bb3e46a by R David Murray in branch '3.3': #17409: Document RLIM_INFINITY and use it to clarify the setrlimit docs. http://hg.python.org/cpython/rev/186f6bb3e46a New changeset 9c4db76d073e by R David Murray in branch '2.7': #17409: Document

[issue17409] resource.setrlimit doesn't respect -1

2013-04-20 Thread R. David Murray
R. David Murray added the comment: There being no objection :) I've committed the patch. -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue16942] urllib still doesn't support persistent connections

2013-04-20 Thread Senthil Kumaran
Senthil Kumaran added the comment: Agree with Demian Brecht. This issue is being closed in when two issues cover the requirements discussed here. * issue# 16901 - For Enhancing FileCookieJar * issue# 9740 - For supporting persistant HTTP 1.1 connections. (:-( on me) -- nosy:

[issue17646] traceback.py has a lot of code duplication

2013-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could print_exception() in Lib/idlelib/run.py reuse new traceback functions? -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17646

[issue14805] Support display of both __cause__ and __context__

2013-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And don't forget about print_exception() in Lib/idlelib/run.py. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14805 ___

[issue17409] resource.setrlimit doesn't respect -1

2013-04-20 Thread Paul Price
Paul Price added the comment: Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17409 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2013-04-20 Thread R. David Murray
R. David Murray added the comment: The message in both branches of the if talk about empty labels, which is probably my fault since I got the sense of the if wrong in my suggestion. One of them should be about the label being too long. The one that should be the 'empty' message also doesn't

[issue17795] backwards-incompatible change in SysLogHandler with unix domain sockets

2013-04-20 Thread Mike Lundy
Mike Lundy added the comment: It doesn't fix it unless I change the configuration (and in some cases the code) for every SyslogHandler across all of our projects, plus every single library we use. Google around For SysLogHandler /dev/log socktype and then compare with SysLogHandler /dev/log.

[issue4934] tp_del and tp_version_tag undocumented

2013-04-20 Thread Alex Leach
Alex Leach added the comment: I've just ran into tp_version_tag, when running the boost python testsuite and wondered what it was... Since upgrading to GCC 4.8, I've started to get a lot more warnings with Python extensions, e.g.:- boost/python/opaque_pointer_converter.hpp:122:14: warning:

[issue14805] Support display of both __cause__ and __context__

2013-04-20 Thread Philip Jenvey
Philip Jenvey added the comment: and the code module (after #17442 is resolved) -- nosy: +pjenvey ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14805 ___

[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17656 ___ ___ Python-bugs-list

[issue17785] Use faster URL shortener for perf.py

2013-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1488e1f55f61 by Alexandre Vassalotti in branch 'default': Issue #17785: Use a faster URL shortener for perf.py http://hg.python.org/benchmarks/rev/1488e1f55f61 -- nosy: +python-dev ___ Python tracker

[issue17785] Use faster URL shortener for perf.py

2013-04-20 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17785

[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

2013-04-20 Thread Christian Heimes
Christian Heimes added the comment: it seems like file() can't handle unicode file names on FreeBSD. The FS encoding is 'US-ASCII' on Snakebite's FreeBSD box. /home/cpython/users/christian.heimes/2.7/Lib/zipfile.py(1078)_extract_member() - with self.open(member, pwd=pwd) as source, \ (Pdb)

[issue17720] pickle.py's load_appends should call append() on objects other than lists

2013-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 37139694aed0 by Alexandre Vassalotti in branch '3.3': Isuse #17720: Fix APPENDS handling in the Python implementation of Unpickler http://hg.python.org/cpython/rev/37139694aed0 -- nosy: +python-dev ___

[issue17720] pickle.py's load_appends should call append() on objects other than lists

2013-04-20 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti alexan...@peadrop.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17720

[issue17804] streaming struct unpacking

2013-04-20 Thread Antoine Pitrou
New submission from Antoine Pitrou: For certain applications, you want to unpack repeatedly the same pattern. This came in issue17618 (base85 decoding), where you want to unpack a stream of bytes as 32-bit big-endian unsigned ints. The solution adopted in issue17618 patch

  1   2   >