Re: PEPs should be included with the documentation download

2013-08-23 Thread Ben Finney
Chris Angelico ros...@gmail.com writes: Hence the question: How many people actually do use the downloaded docs? Maybe it'd turn out to be quite high, but it's not an unreasonable question. I think it's an unreasonable question. What would you accept as an answer? Who could possibly be

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Ian Simcock
Chris Angelico wrote: On Fri, Aug 23, 2013 at 1:26 AM, Ian Simcock ian.simc...@internode.on.net wrote: Chris Angelico wrote: A lot of programs, when their output is not going to the console, will buffer output. It's more efficient for many purposes. With Unix utilities, there's often a

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Ian Simcock
Rob Wolfe wrote: Ian Simcock ian.simc...@internode.on.net writes: When file object is used in a for loop it works like an iterator and then it uses a hidden read-ahead buffer. It might cause this kind of blocking. You can read more details here (description of method ``next``):

Re: Basic Python Query

2013-08-23 Thread Ulrich Eckhardt
Am 23.08.2013 05:28, schrieb Steven D'Aprano: On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: When the Python object goes away, it doesn't necessarily affect thethread or file it represents. That's certainly not true with file objects. When the file object goes out of scope, the

Re: Using PyQT with QT Designer

2013-08-23 Thread Phil Thompson
On Thu, 22 Aug 2013 18:08:14 -0700 (PDT), tausc...@gmail.com wrote: On Thursday, August 22, 2013 3:26:17 AM UTC-5, Phil Thompson wrote: It looks like you aren't using a layout to arrange your widgets. Explicitly specifying geometries is a bad idea. Phil Thanks.QT Designer uses set

Re: PEPs should be included with the documentation download

2013-08-23 Thread Ned Deily
In article 7wvc2xkjvz@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: Chris Angelico ros...@gmail.com writes: Hence the question: How many people actually do use the downloaded docs? Maybe it'd turn out to be quite high, but it's not an unreasonable question. I think

Sergei Ivachev

2013-08-23 Thread sepatan
Maybe someone from the Python community tried to run Python (with a possible set of standard library modules) under the Google Native Client in browser? If you have a positive experience, can share? -- http://mail.python.org/mailman/listinfo/python-list

Who run the Python for Google Native Client?

2013-08-23 Thread sepatan
Maybe someone from the Python community tried to run Python (with a possible set of standard library modules) under the Google Native Client in browser? If you have a positive experience, can share? -- http://mail.python.org/mailman/listinfo/python-list

Re: PEPs should be included with the documentation download

2013-08-23 Thread Ben Finney
Ned Deily n...@acm.org writes: In article 7wvc2xkjvz@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: Chris Angelico ros...@gmail.com writes: Hence the question: How many people actually do use the downloaded docs? Maybe it'd turn out to be quite high, but it's not an

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Gertjan Klein
Ian Simcock wrote: When I use this code I can see that the Popen works, any code between the Popen and the for will run straight away, but as soon as it gets to the for and tries to read p.stdout the code blocks until the command line program completes, then all of the lines are returned. Does

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Antoon Pardon
Op 22-08-13 07:51, Ian Simcock schreef: Greetings all. I'm using Python 2.7 under Windows and am trying to run a command line program and process the programs output as it is running. A number of web searches have indicated that the following code would work. import subprocess p =

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Antoon Pardon
Op 23-08-13 11:53, Antoon Pardon schreef: Op 22-08-13 07:51, Ian Simcock schreef: Greetings all. I'm using Python 2.7 under Windows and am trying to run a command line program and process the programs output as it is running. A number of web searches have indicated that the following code

RE: Running a command line program and reading the result as it runs

2013-08-23 Thread Joseph L. Casale
I'm using Python 2.7 under Windows and am trying to run a command line program and process the programs output as it is running. A number of web searches have indicated that the following code would work. import subprocess p = subprocess.Popen(D:\Python\Python27\Scripts\pip.exe list

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Peter Otten
Ian Simcock wrote: Greetings all. I'm using Python 2.7 under Windows and am trying to run a command line program and process the programs output as it is running. A number of web searches have indicated that the following code would work. import subprocess p =

Python variable as a string

2013-08-23 Thread Jake Angulo
Sorry this is a very basic question. I have a list *var* which after some evaluation I need to refer to *var* as a string. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string', anothervar='anotherstring') anotherdict = dict() if condition: anotherdict[akey] = adict['var']

What does sys.stdout.flush() do?

2013-08-23 Thread D. Xenakis
Somewhere i read.. sys.stdout.flush(): Flush on a file object pushes out all the data that has been buffered to that point. Can someone post here a script example with sys.stdout.flush(), where in case i commented that i could understand what the difference really would be? Whenever i try to

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Gertjan Klein
Peter Otten wrote: The following works on my linux system: import subprocess p = subprocess.Popen( [ping, google.com], stdout=subprocess.PIPE) instream = iter(p.stdout.readline, ) for line in instream: print line.rstrip() I don't have Windows available to test, but if it

Re: What does sys.stdout.flush() do?

2013-08-23 Thread Peter Otten
D. Xenakis wrote: Somewhere i read.. sys.stdout.flush(): Flush on a file object pushes out all the data that has been buffered to that point. Can someone post here a script example with sys.stdout.flush(), where in case i commented that i could understand what the difference really would

How to send broadcast IP address to network?

2013-08-23 Thread lightaiyee
I want to send a broadcast packet to all the computers connected to my home router. The following 2 lines of code do not work; host=192.168.0.102 s.connect((host, port)) Can someone advise? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send broadcast IP address to network?

2013-08-23 Thread lightaiyee
Some typo mistake. Should be host=192.168.0.255, not 192.168.0.102 On Friday, August 23, 2013 8:32:10 PM UTC+8, light...@gmail.com wrote: I want to send a broadcast packet to all the computers connected to my home router. The following 2 lines of code do not work;

Re: Using PyQT with QT Designer

2013-08-23 Thread Michael Staggs
I tried that this morning and it destroyed my form. So, right now, that's probably not what I'm looking for. But, if you look at that picture, the app isn't resized to 800x600 like it says in the ui file. The pixmaps aren't on the buttons like I set them up in the ui file. It's not using the ui

Re: How to send broadcast IP address to network?

2013-08-23 Thread Neil Cerutti
On 2013-08-23, lightai...@gmail.com lightai...@gmail.com wrote: The following 2 lines of code do not work; host=192.168.0.255 host=192.168.0.102 s.connect((host, port)) Traceback (most recent call last): File stdin, line 1, in module NameError: name 's' is not defined I bet that's not

Re: PEPs should be included with the documentation download

2013-08-23 Thread Neil Cerutti
On 2013-08-23, Chris Angelico ros...@gmail.com wrote: I'm aware of that. However, I'm also aware that many people still read things online, even with a less-than-reliable internet connection. Hence the question: How many people actually do use the downloaded docs? Maybe it'd turn out to be

Re: Python variable as a string

2013-08-23 Thread Neil Cerutti
On 2013-08-23, Jake Angulo jake.ang...@gmail.com wrote: I have a list *var* which after some evaluation I need to refer to *var* as a string. You must make a str version of var. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string', anothervar='anotherstring') anotherdict =

Re: Python variable as a string

2013-08-23 Thread Steven D'Aprano
On Fri, 23 Aug 2013 21:40:06 +1000, Jake Angulo wrote: Sorry this is a very basic question. Not so much basic as confusing. I have a list *var* which after some evaluation I need to refer to *var* as a string. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string',

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Grant Edwards
On 2013-08-22, Chris Angelico ros...@gmail.com wrote: On Fri, Aug 23, 2013 at 1:26 AM, Ian Simcock ian.simc...@internode.on.net wrote: Chris Angelico wrote: Is the program actually producing output progressively? I just tried your exact code with dir /ad /s /b and it worked fine, producing

Re: What does sys.stdout.flush() do?

2013-08-23 Thread John Gordon
In c34119f1-3e04-419d-8dd9-07dd4c648...@googlegroups.com D. Xenakis gouzouna...@hotmail.com writes: Can someone post here a script example with sys.stdout.flush(), where in case i commented that i could understand what the difference really would be? Depending what sys.stdout is connected to

Re: Can a child access parent attributes if that child added post-hoc as an attribute to the parent?

2013-08-23 Thread Bitswapper
On Thursday, August 22, 2013 5:00:38 PM UTC-5, Bitswapper wrote: On Thursday, August 22, 2013 4:26:24 PM UTC-5, Prasad, Ramit wrote: Bitswapper wrote: So I have a parent and child class: class Map(object): def __init__(self,

Re: How to send broadcast IP address to network?

2013-08-23 Thread Chris Angelico
On Fri, Aug 23, 2013 at 10:32 PM, lightai...@gmail.com wrote: I want to send a broadcast packet to all the computers connected to my home router. The following 2 lines of code do not work; host=192.168.0.102 s.connect((host, port)) Can someone advise? You can't establish a TCP socket

python interface to iMacros

2013-08-23 Thread inq1ltd
Python help, I am running iMacros from linux/firefox and doing most of what I want. But, there are times when I want to do something of the net and then back to the iMacros script. Are there any projects out there that will connect python to imacros, something on the order of pexpect?

How to add additional font face to Python 3.3.2 IDLE?

2013-08-23 Thread maildragons1
How can I add for example Droid Sans Mono to python 3.3.2 IDLE? I'm not very familliar with font faces, really. Thank's! -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic Python Query

2013-08-23 Thread Chris Angelico
On Fri, Aug 23, 2013 at 5:12 PM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Am 23.08.2013 05:28, schrieb Steven D'Aprano: On Thu, 22 Aug 2013 13:54:14 +0200, Ulrich Eckhardt wrote: When the Python object goes away, it doesn't necessarily affect thethread or file it represents.

Re: right adjusted strings containing umlauts

2013-08-23 Thread Kurt Mueller
Am 08.08.2013 18:37, schrieb Chris Angelico: On Thu, Aug 8, 2013 at 5:16 PM, Kurt Mueller kurt.alfred.muel...@gmail.com wrote: Am 08.08.2013 17:44, schrieb Peter Otten: Kurt Mueller wrote: What do I do, when input_strings/output_list has other codings like iso-8859-1? You have to know the

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread random832
On Fri, Aug 23, 2013, at 7:14, Peter Otten wrote: The following works on my linux system: instream = iter(p.stdout.readline, ) for line in instream: print line.rstrip() I don't have Windows available to test, but if it works there, too, the problem is the internal buffer

Re: Python variable as a string

2013-08-23 Thread Vlastimil Brom
2013/8/23 Jake Angulo jake.ang...@gmail.com: Sorry this is a very basic question. I have a list var which after some evaluation I need to refer to var as a string. Pseudocode: var = ['a', 'b' , 'c' , 'd'] adict = dict(var='string', anothervar='anotherstring') anotherdict = dict() if

Re: Python and mysql 3 tier programming

2013-08-23 Thread Jason Friedman
System Debian Wheezy Linux Python 2.7 Mysql 5.5.31 Apache Server I am somewhat conversant with html, css, SQL, mysql, Apache and Debian Linux. Actually I have been using Debian for over 10 year. I spent over 5 year, prior to retirement, programming database based applications in Foxpro. I

Re: How to add additional font face to Python 3.3.2 IDLE?

2013-08-23 Thread Terry Reedy
On 8/23/2013 11:49 AM, maildrago...@gmail.com wrote: How can I add for example Droid Sans Mono to python 3.3.2 IDLE? I'm not very familliar with font faces, really. I suspect that Idle just looks in the standard font directory of your system to make the list of available fonts that it

Re: Running a command line program and reading the result as it runs

2013-08-23 Thread Peter Otten
random...@fastmail.us wrote: On Fri, Aug 23, 2013, at 7:14, Peter Otten wrote: The following works on my linux system: instream = iter(p.stdout.readline, ) for line in instream: print line.rstrip() I don't have Windows available to test, but if it works there, too, the

Re: Using PyQT with QT Designer

2013-08-23 Thread Phil Thompson
On Fri, 23 Aug 2013 08:00:29 -0500, Michael Staggs tausc...@gmail.com wrote: I tried that this morning and it destroyed my form. So, right now, that's probably not what I'm looking for. But, if you look at that picture, the app isn't resized to 800x600 like it says in the ui file. The

Re: Using PyQT with QT Designer

2013-08-23 Thread Michael Staggs
Right. I know that if I redesign it I have to run pyuic4 again and that I shouldn't change that file...let qt designer do its job. But, that's exactly what I'm having the problem with...incorporating the file pyuic4 gave me... and why I posted here. If you can point me towards something I need

Re: Using PyQT with QT Designer

2013-08-23 Thread Phil Thompson
On Fri, 23 Aug 2013 12:30:41 -0500, Michael Staggs tausc...@gmail.com wrote: Right. I know that if I redesign it I have to run pyuic4 again and that I shouldn't change that file...let qt designer do its job. But, that's exactly what I'm having the problem with...incorporating the file pyuic4

Re: Using PyQT with QT Designer

2013-08-23 Thread Michael Staggs
Thanks for the manual. I will look into it but all the examples are probably c++. Ive tried zetcode and some of the other tutorials. That's the problem though. It is exactly how I want it in designer. It's perfect as it is in designer when I preview it. Here is a screenshot of the preview:

Re: Using PyQT with QT Designer

2013-08-23 Thread Michael Staggs
Again thoughI'm finished with QT Designer. I have the finished product I want exactly like I want it. But, as ive shown in the screenshots, I'm doing exactly what ive seen in zetcode and other tutorials but It doesn't seem to incorporate and act upon that ui file. The first thing you notice is

Re: Can a child access parent attributes if that child added post-hoc as an attribute to the parent?

2013-08-23 Thread Bitswapper
On Thursday, August 22, 2013 4:59:17 PM UTC-5, Ian wrote: On Thu, Aug 22, 2013 at 3:26 PM, Prasad, Ramit wrote: Bitswapper wrote: So I have a parent and child class: class Map(object): def __init__(self, name=''): self.mapName = name

Arpex Capital seleciona: Desenvolvedor Python / SP

2013-08-23 Thread zughumancapital
Arpex Capital seleciona para uma de suas empresas: Desenvolvedor Python Objetivo geral da Posição: Desenvolver software estável e de primeira linha, que será incorporado à plataforma de WiFi mais moderna atualmente. Responsabilidades: escrever software que rodará tanto no backend (Python)

Re: Using PyQT with QT Designer

2013-08-23 Thread Dave Angel
Michael Staggs wrote: That's the problem though. It is exactly how I want it in designer. It's perfect as it is in designer when I preview it. Here is a screenshot of the preview: http://i.imgur.com/ULRolq8.png The problem isn't that I can't design it in QT Designer. It is designed just

Re: How to add additional font face to Python 3.3.2 IDLE?

2013-08-23 Thread maildragons1
23 август 2013, петък, 19:33:41 UTC+3, Terry Reedy написа: On 8/23/2013 11:49 AM, maildrago...@gmail.com wrote: How can I add for example Droid Sans Mono to python 3.3.2 IDLE? I'm not very familliar with font faces, really. I suspect that Idle just looks in the standard font

can't get utf8 / unicode strings from embedded python

2013-08-23 Thread David M. Cotter
note everything works great if i use Ascii, but: in my utf8-encoded script i have this: print frøânçïé in my embedded C++ i have this: PyObject* CPython_Script::print(PyObject *args) { PyObject*resultObjP = NULL; const char

Setting the value of True

2013-08-23 Thread jeangawron
Python allows you set the value of True True = 1.3 Now this is consistent with the decision to let you set the value of various builtin names. But why is this case different: None = 1.3 File stdin, line 1 SyntaxError: cannot assign to None Mark Gawron --

Re: Using PyQT with QT Designer

2013-08-23 Thread tausciam
Thank you. I just deleted all of them, reran pyuic4 on window.ui and regenerated window.py just to make sure. Unfortunately, I get the same problem. I've got the GUI perfectly designed just like I want it in window.py... just can't figure out how to use it in my program. On Friday, August 23,

Re: Setting the value of True

2013-08-23 Thread Gary Herron
On 08/23/2013 04:38 PM, jeangaw...@gmail.com wrote: Python allows you set the value of True True = 1.3 Now this is consistent with the decision to let you set the value of various builtin names. But why is this case different: None = 1.3 File stdin, line 1 SyntaxError: cannot assign to

Re: Setting the value of True

2013-08-23 Thread Terry Reedy
On 8/23/2013 7:38 PM, jeangaw...@gmail.com wrote: Python allows you set the value of True Unqualified 'Python', used in the present tense, refers to the latest release or repository version. True = 1.3 SyntaxError: assignment to keyword True = 1.3 Now this is consistent with the

Re: Using PyQT with QT Designer

2013-08-23 Thread Lee Harr
That's the problem though. It is exactly how I want it in designer. It's perfect as it is in designer when I preview it. Here is a screenshot of the preview: http://i.imgur.com/ULRolq8.png That's not a preview. That's just the regular design view. (you can tell by the little dots in the

Re: Using PyQT with QT Designer

2013-08-23 Thread tausciam
Thank you... I found my problem class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.setupUi(self) That seems to take care of it... if I comment out everything else, I get my pristine form I

Re: Setting the value of True

2013-08-23 Thread Steven D'Aprano
On Fri, 23 Aug 2013 16:38:43 -0700, jeangawron wrote: Python allows you set the value of True True = 1.3 Only in older versions of Python. This is for historical reasons: True and False were added as built-ins relatively late in Python's history (2.2, I think) and so there is still old

Re: can't get utf8 / unicode strings from embedded python

2013-08-23 Thread Steven D'Aprano
On Fri, 23 Aug 2013 13:49:23 -0700, David M. Cotter wrote: note everything works great if i use Ascii, but: in my utf8-encoded script i have this: print frøânçïé I see you are using Python 2, in which case there are probably two or three errors being made here. Firstly, in Python

Conversion Issue in Converting code of 2.7 to 3

2013-08-23 Thread shankha
Hi, I am trying to run the following piece of code: https://greyhat.gatech.edu/wiki/index.php?title=Java_Bytecode_Tutorial/Getting_Started python Krakatau/assemble.py minimal.j. The scripts are written for 2.7. I want to convert them to 3.3. I am struck with the following error: []$ python

Re: Python script help

2013-08-23 Thread Piet van Oostrum
cool1...@gmail.com writes: Here are some scripts, how do I put them together to create the script I want? (to search a online document and download all the links in it) p.s: can I set a destination folder for the downloads? You can use os.chdir to go to the desired folder.

Re: Conversion Issue in Converting code of 2.7 to 3

2013-08-23 Thread MRAB
On 24/08/2013 03:10, shankha wrote: Hi, I am trying to run the following piece of code: https://greyhat.gatech.edu/wiki/index.php?title=Java_Bytecode_Tutorial/Getting_Started python Krakatau/assemble.py minimal.j. The scripts are written for 2.7. I want to convert them to 3.3. I am struck

Fast conversion of numbers to numerator/denominator pairs

2013-08-23 Thread Steven D'Aprano
I have a need to convert arbitrary non-complex numbers into numerator/ denominator pairs. Numbers could be ints, floats, Fractions or Decimals. For example: 2 = (2, 1) 0.25 = (1, 4) Fraction(2, 3) = (2, 3) Decimal(0.5) = (1, 2) The first three cases are easy and fast: # ints and Fractions

Exception Handling Practices / Patterns

2013-08-23 Thread snarf
Greetings, As I tread through my journey of OO I am trying to determine if there is a good approach for exception handling within classes. From my readings and gatherings - it seems I have found a common theme, but I am trying to solicit from the experts. Here is what I have found (I may be

[issue18813] Speed up slice object processing

2013-08-23 Thread Stefan Behnel
Stefan Behnel added the comment: Here is another patch that remembers the Py_ssize_t slice indices if they are known at instantiation time. It only makes a very small difference for the fannkuch benchmark, so that's no reason to add both the complexity and the (IMHO ignorable) memory

[issue17741] event-driven XML parser

2013-08-23 Thread Stefan Behnel
Stefan Behnel added the comment: Ok, so what are we going to do for the next alpha? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17741 ___ ___

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: $ PYTHONIOENCODING= ./python Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: Aborted (core dumped) As a consequence we can't set only the error handler. $ PYTHONIOENCODING=:surrogateescape ./python

[issue18713] Clearly document the use of PYTHONIOENCODING to set surrogateescape

2013-08-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- dependencies: +Empty PYTHONIOENCODING is not the same as nonexistent ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18713 ___

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file31432/empty_pythonioencoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18818 ___

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file31433/empty_pythonioencoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18818 ___

[issue18813] Speed up slice object processing

2013-08-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +mark.dickinson, serhiy.storchaka stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18813 ___

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Nick Coghlan
Nick Coghlan added the comment: Patch looks good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18818 ___ ___ Python-bugs-list mailing

[issue18816] mmap.flush() is always synchronous, hurting performance

2013-08-23 Thread Charles-François Natali
Charles-François Natali added the comment: I propose to add an optional keyword parameter with default value SYNC (compatibility) but that can be ASYNC, INVALIDATE (can be SYNC|INVALIDATE and ASYNC|INVALIDATE too). AFAICT it's mostly useless on a modern OS. MS_INVALIDATE is a no-op on

[issue18819] tarfile fills devmajor and devminor fields even for non-devices

2013-08-23 Thread Nuutti Kotivuori
New submission from Nuutti Kotivuori: when tarfile generates a tar, it uses TarInfo objects which are packed to the binary format. This packing uses itn format for filling the devmajor and devminor fields of the tar file entry, with a default value of zero. The field length is 8 characters,

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread STINNER Victor
STINNER Victor added the comment: Patch looks good to me, but you have to update Doc/using/cmdline.rst, at least to add a versionchanged section. Tests would also be nice :-) I really like the the PYTHONIOENCODING=:surrogateescape use case! -- ___

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Second variant of the patch also supports empty error handler as the default error handler (i.e. strict). $ PYTHONIOENCODING=ascii: ./python Python 3.4.0a1+ (default:5b5ef012cd4e+, Aug 23 2013, 10:18:51) [GCC 4.6.3] on linux Type help, copyright, credits or

[issue18817] Got resource warning when running Lib/aifc.py

2013-08-23 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18817 ___ ___ Python-bugs-list

[issue18807] Allow venv to create copies, even when symlinks are supported

2013-08-23 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18807 ___ ___ Python-bugs-list

[issue15175] pydoc -k zip throws segmentation fault

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yeah, pydoc will walk and import all installed Python modules, which may trigger various kinds of issues with buggy third-party stuff. Note that in 2.x, extension modules compiled with different fundamental options (such as debug/non-debug) aren't

[issue18623] Factor out the _SuppressCoreFiles context manager

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Will also be useful for issue #18808 :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18623 ___ ___

[issue17588] runpy cannot run Unicode path on Windows

2013-08-23 Thread Drekin
Drekin added the comment: There is over year old closely related issue: http://bugs.python.org/issue13758 . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17588 ___

[issue13758] compile() should not encode 'filename' (at least on Windows)

2013-08-23 Thread Drekin
Drekin added the comment: Hello. Will this be fixed? It's really annoying that you cannot pass valid unicode filename to compile(). I'm using a workaround: I just pass placeholder and then “update” the resulting code object recursively to set the correct co_filename. Afterwards the code

[issue18818] Empty PYTHONIOENCODING is not the same as nonexistent

2013-08-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18818 ___

[issue16392] import crashes on circular imports in ext modules

2013-08-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16392 ___

[issue18811] add ssl-based generator to random module

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Seriously, why are we obsessed with performance when talking about a security feature? Did anyone *actually* complain about urandom() being too slow (ok, someone complained about it eating file descriptors... :-))? The question is whether OpenSSL's random

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
New submission from July Tikhonov: According to documentation of json.dump(), concerning its 'default' option: default(obj) is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. But this function is actually never applied to

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
July Tikhonov added the comment: Oops, my patch disables 'skipkeys' argument of dump. Another version attached. -- Added file: http://bugs.python.org/file31437/json-default-dict-keys.diff ___ Python tracker rep...@bugs.python.org

[issue18820] json.dump() ignores its 'default' option when serializing dictionary keys

2013-08-23 Thread July Tikhonov
Changes by July Tikhonov july.t...@gmail.com: Removed file: http://bugs.python.org/file31436/json-default-dict-keys.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18820 ___

[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-23 Thread Radu Voicilas
Changes by Radu Voicilas radu.voici...@gmail.com: -- nosy: +raduv ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18652 ___ ___ Python-bugs-list

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I just applied the dict version of dummy to sets in http://hg.python.org/cpython/rev/f0202c3daa7a and it unexpectedly broke test_gdb again: FAIL: test_sets (test.test_gdb.PrettyPrintTests) Verify the pretty-printing of sets

[issue18821] Add .lastitem attribute to takewhile instances

2013-08-23 Thread Oscar Benjamin
New submission from Oscar Benjamin: I've often wanted to be able to query a takewhile object to discover the item that failed the predicate but the item is currently discarded. A usage example: def sum(items): it = iter(items) ints = takewhile(Integral.__instancecheck__, it)

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Checking for dummies in dicts in python-gdb.py is implicit (see PyDictObjectPtr.iteritems()): entries whose value is NULL are not printed. Set entries do not have values, so instead pySetObjectPtr.write_repr() uses a hack with the repr() of the key to check

[issue18812] PyImport_Import redundant calls to find module

2013-08-23 Thread Brett Cannon
Brett Cannon added the comment: Because that is how it has always been: http://hg.python.org/cpython/file/b9b521efeba3/Python/import.c#l3164 . It could be changed but someone out there is relying on those semantics and it's a minor thing to leave in so I don't want to mess with it.

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a patch, but I don't have a way to test it. -- Added file: http://bugs.python.org/file31438/fix_dummy.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18772

[issue18713] Clearly document the use of PYTHONIOENCODING to set surrogateescape

2013-08-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: With new subject this issue looks as a duplicate of (or tightly related to) issue12832. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18713 ___

[issue5876] __repr__ returning unicode doesn't work when called implicitly

2013-08-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In Python 3 ascii() uses the backslashreplace error handler. class T: ... def __repr__(self): ... return '\u20ac\udcff' ... print(ascii(T())) \u20ac\udcff I think using the backslashreplace error handler in repr() in Python 2.7 is good

[issue18812] PyImport_Import redundant calls to find module

2013-08-23 Thread Rob Bairos
Rob Bairos added the comment: However, if it fails __import()__ it doesn't get to the sys.modules[] call anyways. The only case affected by this are: PASS the __import()__ call, then FAIL the sys.modules[] lookup afterwards. Why will that effect anything currently out there? As it

[issue18772] Fix gdb plugin for new sets dummy object

2013-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Checking repr() perpetuates the original hack so, why it may work, I think it's better if we take the opportunity to solve it cleanly. I'll try to take a look tonight (I suppose you're under Windows?). -- ___ Python

[issue5876] __repr__ returning unicode doesn't work when called implicitly

2013-08-23 Thread STINNER Victor
STINNER Victor added the comment: This change is going to break backward compatibility. I don't think that it can be done in Python 2.7.x, and there is no Python 2.8 (PEP 404). -- ___ Python tracker rep...@bugs.python.org

[issue18816] mmap.flush() is always synchronous, hurting performance

2013-08-23 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Depending of a concrete OS implementation is not good. Linux is not the only OS out there, and I have very old machines in production yet: # uname -a Linux colquide..es 2.4.37 #4 Fri Dec 12 01:10:45 CET 2008 i686 unknown I have been hit by the VM/file

[issue17883] Fix buildbot testing of Tkinter

2013-08-23 Thread Zachary Ware
Zachary Ware added the comment: Ping! The buildbots still seem to be failing, are my proposed fixes acceptable? Both patches still apply cleanly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17883

[issue17702] os.environ converts key type from string to bytes in KeyError exception

2013-08-23 Thread Drekin
Drekin added the comment: This patch introduces a bit ugly traceback. Shouldn't there be “raise from None” or “raise from previous_exc” instead of simple raise? -- nosy: +Drekin ___ Python tracker rep...@bugs.python.org

[issue18811] add ssl-based generator to random module

2013-08-23 Thread Christian Heimes
Christian Heimes added the comment: I don't get it either. urandom is perfectly fine. I showed that urandom is just a bit slower than SSL_rand(). How about we generalize SystemRandom so users can implement a custom RNG class wby providing a method rng(amount) - bytes? Antoine Pitrou

  1   2   3   >