PyCon UK 2012

2012-07-11 Thread Michael Foord
Hello All, We're pleased to announce that the PyCon UK 2012 conference is open for bookings at http://pyconuk.org. The Early Bird rate is available until 12 August, and there is a Concession rate available for Students, Nurses, and Unwaged right up to the conference date. PyCon UK runs from

Re: Opening multiple Files in Different Encoding

2012-07-11 Thread Steven D'Aprano
On Tue, 10 Jul 2012 10:46:08 -0700, Subhabrata wrote: Dear Group, I kept a good number of files in a folder. Now I want to read all of them. They are in different formats and different encoding. Using listdir/glob.glob I am able to find the list but how to open/read or process them for

lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown --

Re: lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? And more importantly, what's the simplest way to achieve the latter? :) -- Psss, psss, put it

Re: lambda in list comprehension acting funny

2012-07-11 Thread Jurko Gospodnetić
Hi. funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) This gives me 16 When I was excepting 1 Does anyone know why? Just the way Python lambda expressions bind their variable references. Inner 'i' references the outer scope's 'i' variable and not its value 'at the

Re: lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) This gives me 16 When I was excepting 1 Does anyone know why? Just the way Python lambda expressions bind their variable references. Inner 'i' references the outer scope's 'i' variable and not its value 'at the

Re: Tkinter.event.widget: handler gets name instead of widget.

2012-07-11 Thread Frederic Rentsch
On Tue, 2012-07-10 at 18:06 -0700, Rick Johnson wrote: Also: Q3: Why are you explicitly setting the name of your subFrame widgets instead of allowing Tkinter to assign a unique name?...AND are you aware of the conflicts that can arise from such changes[1]? I find custom-named widgets

introduction and first question about multithreading

2012-07-11 Thread Vojtěch Polášek
Greetings, My name is Vojta and I am blind student. I am slowly learning Python for about 4 years and I like it alot, mostly its ability to run on various platforms. My primary system is Ubuntu 12.04, but I have Windows XP at hand. I am using python 2.7. I have learned basics from the book A byte

Re: lambda in list comprehension acting funny

2012-07-11 Thread Colin J. Williams
On 11/07/2012 2:41 AM, Daniel Fetchinson wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] print funcs[0]( 2 ) print funcs[1]( 2 ) print funcs[2]( 2 ) This gives me 16 16 16 When I was excepting 1 2 4 Does anyone know why? Cheers, Daniel I don't understand why you would expect 1, 2,

Re: introduction and first question about multithreading

2012-07-11 Thread Roy Smith
In article mailman.2011.1341994717.4697.python-l...@python.org, Vojt®ßch Pol®¢‰ek krec...@gmail.com wrote: Then the menu module kicks in and should launch its own loop checking for pygame keyboard events, but right after doing it it prints: [xcb] Unknown sequence number while

ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator

2012-07-11 Thread Chris Gonnerman
I've held off announcing this until I was sure it was really stable; it's been 19 days since I made the last change to it, so here goes. PollyReports is my Python module for report generation. It is designed to be, quite literally, the simplest thing that can possibly work in the field of PDF

[newbie] Python and Qt4 Designer

2012-07-11 Thread Jean Dubois
I'm trying to combine python-code made with QT4 designer with plain python statements like file = open(test,w) Can anyone tell me what I have to add to the following code just to open a file when clicking on the load-button and closing it by clicking on the save button. #!/usr/bin/env python #

Re: lambda in list comprehension acting funny

2012-07-11 Thread Ian Kelly
On Wed, Jul 11, 2012 at 4:28 AM, Colin J. Williams c...@ncf.ca wrote: I don't understand why you would expect 1, 2, 4. Because: funcs[0](2) == 2 ** 0 == 1 funcs[1](2) == 2 ** 1 == 2 funcs[2](2) == 2 ** 2 == 4 Perhaps parentheses will help the order of evaluation: funcs = [(lambda x: x**i)

Re: Opening multiple Files in Different Encoding

2012-07-11 Thread subhabangalore
On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote: Dear Group, I kept a good number of files in a folder. Now I want to read all of them. They are in different formats and different encoding. Using listdir/glob.glob I am able to find the list but how to open/read or process

Re: lambda in list comprehension acting funny

2012-07-11 Thread John Ladasky
Exactly. It's threads like these which remind me why I never use lambda. I would rather give a function an explicit name and adhere to the familiar Python syntax, despite the two extra lines of code. I don't even like the name lambda. It doesn't tell you what it is (unless you're John

Re: Opening multiple Files in Different Encoding

2012-07-11 Thread Oscar Benjamin
On 11 July 2012 19:15, subhabangal...@gmail.com wrote: On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote: Dear Group, I kept a good number of files in a folder. Now I want to read all of them. They are in different formats and different encoding. Using listdir/glob.glob

Re: lambda in list comprehension acting funny

2012-07-11 Thread Hans Mulder
On 11/07/12 20:38:18, woooee wrote: You should not be using lambda in this case .for x in [2, 3]: .funcs = [x**ctr for ctr in range( 5 )] .for p in range(5): .print x, funcs[p] .print The list is called funcs because it is meant to contain functions. Your code does not

Re: Opening multiple Files in Different Encoding

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 11:15:02 -0700, subhabangalore wrote: On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote: Dear Group, I kept a good number of files in a folder. Now I want to read all of them. They are in different formats and different encoding. Using listdir/glob.glob I

Re: lambda in list comprehension acting funny

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 11:38:18 -0700, woooee wrote: You should not be using lambda in this case .for x in [2, 3]: .funcs = [x**ctr for ctr in range( 5 )] .for p in range(5): .print x, funcs[p] .print If you change the requirements, it's always easy to solve problems.

Re: ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator

2012-07-11 Thread Simon Cropper
On 12/07/12 00:06, Chris Gonnerman wrote: I've held off announcing this until I was sure it was really stable; it's been 19 days since I made the last change to it, so here goes. PollyReports is my Python module for report generation. It is designed to be, quite literally, the simplest thing

Re: lambda in list comprehension acting funny

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 13:21:34 -0700, John Ladasky wrote: Exactly. It's threads like these which remind me why I never use lambda. I would rather give a function an explicit name and adhere to the familiar Python syntax, despite the two extra lines of code. lambda is familiar Python syntax,

Re: [newbie] Python and Qt4 Designer

2012-07-11 Thread Vincent Vande Vyvre
On 11/07/12 17:37, Jean Dubois wrote: I'm trying to combine python-code made with QT4 designer with plain python statements like file = open(test,w) Can anyone tell me what I have to add to the following code just to open a file when clicking on the load-button and closing it by clicking on

Automatic setup of meta path hooks?

2012-07-11 Thread jwp
Hi, I'm working on a meta path hook that performs compilation of C extension modules on import ( github.com/jwp/py-c ; pip install c ). It mostly works, but I'm having a hard time finding a standard way to automatically install the hook upon interpreter startup. I've thought about just having

Re: lambda in list comprehension acting funny

2012-07-11 Thread Daniel Fetchinson
You should not be using lambda in this case .for x in [2, 3]: .funcs = [x**ctr for ctr in range( 5 )] .for p in range(5): .print x, funcs[p] .print If you change the requirements, it's always easy to solve problems. But it is the wrong problem that you have solved.

ANN: Zeus - Windows IDE for Python

2012-07-11 Thread jussij
The latest Zeus IDE Version 3.97o is now available: http://www.zeusedit.com/python.html This latest Zeus release adds improved Python debugger support. Other Pyhon language features include syntax highlighting, code completion, smart indenting, class browsing and code folding. Zeus is also

Re: lambda in list comprehension acting funny

2012-07-11 Thread 88888 Dihedral
On Thursday, July 12, 2012 12:34:33 AM UTC+8, Ian wrote: On Wed, Jul 11, 2012 at 4:28 AM, Colin J. Williams lt;c...@ncf.cagt; wrote: gt; I don#39;t understand why you would expect 1, 2, 4. Because: funcs[0](2) == 2 ** 0 == 1 funcs[1](2) == 2 ** 1 == 2 funcs[2](2) == 2 ** 2 == 4 gt;

Re: lambda in list comprehension acting funny

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 21:05:30 -0400, Dennis Lee Bieber wrote: {non sequitur: I still recall my archaic C++ class with the OOAD assignment of designing said calculator -- we never had to implement one, just design the basic classes/methods/attributes [on 3x5 cards] for a four-banger. I managed

Re: lambda in list comprehension acting funny

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 20:39:45 -0700, 8 Dihedral wrote: I'll contribute my way of python programming: def powerb(x, b): # return x**b Here's a shorter version: py pow built-in function pow One functor is enough! Nothing we have been discussing in this thread has been a functor,

Re: lambda in list comprehension acting funny

2012-07-11 Thread Steven D'Aprano
On Wed, 11 Jul 2012 08:41:57 +0200, Daniel Fetchinson wrote: funcs = [ lambda x: x**i for i in range( 5 ) ] Here's another solution: from functools import partial funcs = [partial(lambda i, x: x**i, i) for i in range(5)] Notice that the arguments i and x are defined in the opposite order.

Re: lambda in list comprehension acting funny

2012-07-11 Thread Terry Reedy
On 7/11/2012 11:53 PM, Steven D'Aprano wrote: On Wed, 11 Jul 2012 21:05:30 -0400, Dennis Lee Bieber wrote: {non sequitur: I still recall my archaic C++ class with the OOAD assignment of designing said calculator -- we never had to implement one, just design the basic classes/methods/attributes

Re: lambda in list comprehension acting funny

2012-07-11 Thread 88888 Dihedral
On Thursday, July 12, 2012 11:51:04 AM UTC+8, Steven D#39;Aprano wrote: On Wed, 11 Jul 2012 20:39:45 -0700, 8 Dihedral wrote: gt; I#39;ll contribute my way of python programming: gt; gt; def powerb(x, b): # gt; return x**b Here#39;s a shorter version: pygt; pow lt;built-in

Re: lambda in list comprehension acting funny

2012-07-11 Thread John O'Hagan
On Wed, 11 Jul 2012 13:21:34 -0700 (PDT) John Ladasky john_lada...@sbcglobal.net wrote: Exactly. It's threads like these which remind me why I never use lambda. I would rather give a function an explicit name and adhere to the familiar Python syntax, despite the two extra lines of code. I

Re: ANN: PollyReports 1.5 -- Band-oriented PDF Report Generator

2012-07-11 Thread Andreas Perstinger
On Thu, 12 Jul 2012 10:41:52 +1000 Simon Cropper simoncrop...@fossworkflowguides.com wrote: That said... with more than a passing interest in software and content licensing I looked at how the work was licensed. A none-standard license like this makes most people stop and think will this be

[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I think the issue is grossly underspecified. The title of the issue is sys.stdin is broken which says nothing about the way in which it is broken. Taking Roger's literal description, and his msg165191, the complaint is that input() no

[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset b90482742ee0 by Martin v. Löwis in branch '3.2': Issue #15319: Revert wrapping of sys.stdin. Patch by Serhiy Storchaka. http://hg.python.org/cpython/rev/b90482742ee0 -- nosy: +python-dev

[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Here is a patch that creates some unit tests for the existing getopt argument parsing code. In response to the comments, I'm thinking of a less invasive approach that involves wrapping argparse's parse_args() to return getopt-like

[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 42424c1f605c by Martin v. Löwis in branch '2.7': Issue #15319: Revert wrapping of sys.stdin. Patch by Serhiy Storchaka. http://hg.python.org/cpython/rev/42424c1f605c --

[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15319 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It's *clearly* not a duplicate. While #15319 is fixed, this issue remains - so it can't possibly be a duplicate. -- nosy: +loewis resolution: duplicate - superseder: IDLE - readline, isatty, and input broken -

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___ ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I propose the attached patch to block write() calls. -- keywords: +patch Added file: http://bugs.python.org/file26350/blockwrite.diff ___ Python tracker rep...@bugs.python.org

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Revised -- Added file: http://bugs.python.org/file26351/blockwrite.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: There is indeed a race condition here. Fortunately unit tests take much more time than the generator loop. Is it enough to turn the generator into a fixed list? Or is the late binding behavior of args_tuple important? (For example,

[issue3405] Add support for the new data option supported by event generate (Tk 8.5)

2012-07-11 Thread Mark Summerfield
Mark Summerfield m...@qtrac.eu added the comment: According to the Tcl/Tk docs the 'data' field is a string (i.e., for any user data) and the 'detail' field contains some internal data (so shouldn't be messed with); see http://www.tcl.tk/man/tcl8.5/TkCmd/event.htm#M16 Anyway, I hope you add a

[issue15324] --match does not work for regrtest

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: The long form of the -m/--match option does not work with regrtest because it does not accept an argument. For example (observe the lack of an error in the second invocation)-- $ ./python.exe -m test -m option -m requires argument

[issue15319] IDLE - sys.stdin, sys.stdout, etc are broken

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: title: IDLE - input() is broken. - IDLE - sys.stdin is broken. Well, now, with the modified header, I'm not going to open a separate issue. Here is a patch that fixes almost all IDLE sys.std* issues. -- title: IDLE - readline,

[issue15319] IDLE - sys.stdin, sys.stdout, etc are broken

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Serhiy: this issue is closed, so your patch won't be considered. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15319 ___

[issue15319] IDLE - readline, isatty, and input broken

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Sorry, I missed the morning's discussion. -- title: IDLE - sys.stdin, sys.stdout, etc are broken - IDLE - readline, isatty, and input broken ___ Python tracker rep...@bugs.python.org

[issue15323] Provide target name in output message when Mock.assert_called_once_with fails

2012-07-11 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Looks good, thanks. -- assignee: - michael.foord nosy: +michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15323 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: sys.std* streams have many other issues. sys.stdin.readable() Traceback (most recent call last): File pyshell#4, line 1, in module sys.stdin.readable() AttributeError: readable sys.stdout.writable() Traceback (most recent call

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Added getvar method to PyShell.console. -- Added file: http://bugs.python.org/file26354/idle_stdstreams-3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Serhiy: can you please explicitly list what issues your patch fixes? I can think of many *more* issues that your patch doesn't fix, e.g. sys.stdin.read(sys) and sys.stdout.read(). I'm quite opposed to monkey-patching, so I won't commit any

[issue15325] --fromfile does not work for regrtest

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: The long form of the -f/--fromfile option does not work. It does not read its required argument. For example (observe that the second invocation raises no error)-- $ ./python.exe -m test -f option -f requires argument Use --help

[issue15324] --match does not work for regrtest

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Note that issue 15302 will fix this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15324 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: As an additional note: the change to monkey-patching breaks the test isinstance(sys.stdout, io.TextIOBase) which currently succeeds. -- ___ Python tracker rep...@bugs.python.org

[issue15326] --random does not work for regrtest

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: The long form of the -r/--random option does not work: $ ./python.exe -m test --random No handler for option --random. Please report this as a bug at http://bugs.python.org. Note that issue 15302 will fix this. --

[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Attached is a first version of a complete patch. Note that I found three bugs in the current argument parsing code in the course of working on this patch: issue 15324, issue 15325, and issue 15326 (because of various typos in the

[issue15327] Argparse: main arguments and subparser arguments indistinguishable

2012-07-11 Thread Ingo Fischer
New submission from Ingo Fischer fredistdurs...@googlemail.com: I have an argument called '--verbose' in the main parser. Then I add a subparser called 'command', to which I add an argument with the same name '--verbose' (See attached script). When I process these args, I cannot decide

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Serhiy: can you please explicitly list what issues your patch fixes? issue12967. And sys.std* in IDLE lacks other common sys.std* methods and attributes. I can think of many *more* issues that your patch doesn't fix, e.g.

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: I don't think the late binding is necessary. But it looks like late binding could be preserved simply by constructing args_tuple inside the worker thread instead of in the generator. Really, only test needs to be yielded. Nothing else

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: As an additional note: the change to monkey-patching breaks the test isinstance(sys.stdout, io.TextIOBase) which currently succeeds. Agree, this is a regression. However isinstance(sys.stdout, io.TextIOBase) is False now in

[issue1346874] httplib simply ignores CONTINUE

2012-07-11 Thread André Cruz
André Cruz an...@cabine.org added the comment: Attached is an updated patch against 2.7.3. It solves a bug in the tests and implements Carl's suggestion. The new tests pass and it updates the documentation as well. As for inclusion in 2.7, as this is in fact solving a bug, I would vote for

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I was about to say yes, listiter.__next__ is atomic (it should, really), but that's not true (Hint: there is a Py_DECREF in the code...). The script below crashes with: Fatal Python error: Objects/listobject.c:2774 object at

[issue3405] Add support for the new data option supported by event generate (Tk 8.5)

2012-07-11 Thread O.C.
O.C. oc-spa...@laposte.net added the comment: I don't agree with this comment. 1) The 'detail' field also contains a string, one of the following: NotifyAncestor, NotifyNonlinearVirtual,... 2) When an event is received, the 'detail' and 'user_data' fields are de facto mixed up. Indeed, the

[issue15302] Use argparse instead of getopt in test.regrtest

2012-07-11 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15302 ___ ___

[issue8823] urllib2 does not catch httplib.BadStatusLine

2012-07-11 Thread Greg Roodt
Greg Roodt gro...@gmail.com added the comment: By the way, the issue can be recreated by running the following: netcat -l -p -e echo HTTP/1.1 1000 OK python -c import urllib2; urllib2.urlopen('http://localhost:') This happens on 2.6, 2.7 and 3 by the looks of it. --

[issue15328] datetime.strptime slow

2012-07-11 Thread Lars Nordin
New submission from Lars Nordin lars.nor...@gmail.com: The datetime.strptime works well enough for me it is just slow. I recently added a comparison to a log parsing script to skip log lines earlier than a set date. After doing so my script ran much slower. I am processing 4,784,212 log lines

[issue15328] datetime.strptime slow

2012-07-11 Thread Lars Nordin
Lars Nordin lars.nor...@gmail.com added the comment: Running the script without any timestamp comparison (and parsing more log lines), gives these performance numbers: log lines: 7,173,101 time output: real1m9.892s user0m53.563s sys 0m1.592s --

[issue15328] datetime.strptime slow

2012-07-11 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Thanks for the report. However, do you have a patch to propose? Otherwise I'm not sure there is a reason to keep this issue open...one can always say various things are slow; that by itself is not a bug. Performance enhancement

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: issue9290 also has relation to this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: issue7163 is another PseudoFile-related issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue7897] Support parametrized tests in unittest

2012-07-11 Thread florian-rathgeber
Changes by florian-rathgeber florian.rathge...@gmail.com: -- nosy: +florian-rathgeber ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7897 ___ ___

[issue12600] Add example of using load_tests to parameterise Test Cases

2012-07-11 Thread florian-rathgeber
Changes by florian-rathgeber florian.rathge...@gmail.com: -- nosy: +florian-rathgeber ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12600 ___ ___

[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eric.araujo, tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15322 ___ ___

[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks, Chris. I haven't tested the patch but it looks fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15300 ___

[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Looks like a duplicate; I can’t search right now (try sysconfig + build). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15322 ___

[issue7163] IDLE suppresses sys.stdout.write() return value

2012-07-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7163 ___ ___ Python-bugs-list

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Amaury's patch looks obviously fine. As for the original issue: yes, I thought I saw a traceback once due to that. Using list.pop() (or deque.pop()) instead would probably be good enough. -- stage: - patch review versions: +Python 2.7,

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15320 ___ ___ Python-bugs-list

[issue14797] Deprecate imp.find_module()/load_module()

2012-07-11 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14797 ___ ___ Python-bugs-list

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread rg3
rg3 sarbalap+freshm...@gmail.com added the comment: I don't know if the behavior is considered a bug or just undocumented, but under Python 2.7.3 it's still the same. locale.getpreferredencoding() does return UTF-8, but the second element in the tuple locale.getdefaultlocale() is

[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 724a6e0e35f0 by Antoine Pitrou in branch '3.2': Issue #15300: Ensure the temporary test working directories are in the same parent folder when running tests in multiprocess mode from a Python build.

[issue15300] test directory doubly-nested running tests with -j/--multiprocess

2012-07-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed now. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15300

[issue5815] locale.getdefaultlocale() missing corner case

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: The patch is not work for ca_ES@valencia locale. And there are issues for such locales: ks_in@devanagari, ks...@devanagari.utf-8, sd, sd...@devanagari.utf-8 (ks_in@devanagari in locale_alias maps to ks...@devanagari.utf-8 and sd to

[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: I searched a little before. There is issue 12141, sysconfig.get_config_vars('srcdir') fails in specific cases, but that issue is closed. In the comments there, Antoine seems to be describing the bug I describe here, but I'm not sure

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: implements textio badly is *not* a well-defined issue. First it is a personal judgement: some think it's really bad, some think it's quite ok. More importantly, such issue has no clear success criterion: how do we know we are done - can

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Attaching a patch for the original issue using deque. -- Added file: http://bugs.python.org/file26359/issue-15320-1.patch ___ Python tracker rep...@bugs.python.org

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: In any case,*this* issue is about sys.stdin being writable. I already got confused with all these closing/reopening/renaming of issues and floating code. Should I open my own issue even if it duplicates and supersedes some other? Any

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Hmm, actually the patch is not ok, because of the -F option which uses an infinite iterator. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15320

[issue13866] {urllib, urllib.parse}.urlencode should not use quote_plus

2012-07-11 Thread jin
jin j...@mediatomb.cc added the comment: I just ran into exactly the same problem and was quite disappointed to see that urlencode does not provide an option to use percent encoding. My use case: I'm preparing some metadata on the server side that is stored as an url encoded string, the

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: Added file: http://bugs.python.org/file26360/blockfile-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: Removed file: http://bugs.python.org/file26360/blockfile-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: Added file: http://bugs.python.org/file26361/blockfile-3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15318 ___

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I already got confused with all these closing/reopening/renaming of issues and floating code. Should I open my own issue even if it duplicates and supersedes some other? I personally think it would be best if these issues where closed

[issue15329] clarify which deque methods are thread-safe

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: I think it would help to clarify which collections.deque methods are thread-safe: http://docs.python.org/dev/library/collections.html?highlight=deque#collections.deque Currently, the documentation says that Deques support

[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Chris Jerdonek
New submission from Chris Jerdonek chris.jerdo...@gmail.com: It seems like it would be useful if collections.deque had a thread-safe method that could rotate(1) and return the rotated value. This would let deque to act as a thread-safe circular buffer (e.g. if serving jobs to multiple threads

[issue15318] IDLE - sys.stdin is writeable

2012-07-11 Thread Roger Serwy
Roger Serwy roger.se...@gmail.com added the comment: I tested blockfile-3.diff against the latest code in the repository. sys.stdin.write returns the wrong error message when passed a non-string. Presently it returns io.UnsupportedOperation instead of TypeError: must be str, not ... The

[issue15320] thread-safety issue in regrtest.main()

2012-07-11 Thread Chris Jerdonek
Chris Jerdonek chris.jerdo...@gmail.com added the comment: Good catch. Here is a patch that takes --forever mode into account. I wrote this patch with the assumption that it shouldn't hurt if multiple threads call deque.extend() at the same time. -- Added file:

[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger priority: normal - low versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15330 ___

[issue15330] allow deque to act as a thread-safe circular buffer

2012-07-11 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: By thread-safe you mean that the operation should be atomic? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15330 ___

  1   2   >