Re: socket issue with recv()

2014-08-24 Thread dieter
Arthur Clarck aclar...@gmail.com writes: ... The problem I have now is the following. I have a script to connect to some telecom service. The script is forking (parent/child) The child is only reading what comes from the remote server. Here the problematic code: total = '' while True:

Re: Simple question

2014-08-24 Thread John Ladasky
On Saturday, August 23, 2014 6:10:29 AM UTC-7, explode...@gmail.com wrote: Can some one explain why this happens: True, False = False, True print True, False False True Shush! That's one of Python's most closely-guarded secrets! Every politician on Earth will want to learn to program

Re: Simple question

2014-08-24 Thread Chris Angelico
On Sun, Aug 24, 2014 at 3:55 PM, John Ladasky john_lada...@sbcglobal.net wrote: Shush! That's one of Python's most closely-guarded secrets! Every politician on Earth will want to learn to program in Python after seeing that! Not really, the legal profession has known about this for

Re: Working with decimals

2014-08-24 Thread Larry Hudson
On 08/23/2014 02:13 PM, Seymore4Head wrote: On Sat, 23 Aug 2014 13:47:20 -0400, Seymore4Head I found this function that I will be saving for later. def make_it_money(number): import math return '$' + str(format(math.floor(number * 100) / 100, ',.2f')) (I still need more practice to

Best place to start of learning the raspberry pi

2014-08-24 Thread Nicholas Cannon
Hey I bought a raspberry pi, a bread board and all this electronics stuff and i really enjoy programming stuff in python and i have had a decent of practise with python. I really wont to get into making things with electronics(i have had a lot of practise with soldering as well) and then

Re: the output in reference of descriptor.

2014-08-24 Thread Steven D'Aprano
luofeiyu wrote: let me paste it again to make my question more clear: c2.d __get__() is called __main__.C2 object at 0x0297BE10 class '__main__.C2' __main__.C object at 0x0297BBA8 You have an instance c2. You do an attribute lookup on d, which is a

Re: Python vs C++

2014-08-24 Thread Robert Kern
On 2014-08-22 01:26, Chris Angelico wrote: On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde joseph.martinot-laga...@m4x.org wrote: For information, Cython works with C++ now: http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. Now isn't that cool! Every time Cython gets

Re: Som confusion about the python library installation

2014-08-24 Thread Heinz Schmitz
Michael Torrie wrote: You could try Ubuntu 14.04. Don't forget to mention the hardware requirements for 14.04. Me thinks that a single core CPU and a medium class graphics card won't make the user happy with it. Wouldn't it be friendly to the resources of our world if at least some software

Re: Python vs C++

2014-08-24 Thread Joseph Martinot-Lagarde
Le 23/08/2014 16:21, Chris Angelico a écrit : On Sun, Aug 24, 2014 at 12:02 AM, Ian Kelly ian.g.ke...@gmail.com wrote: I don't know how fast lilypond is, but perhaps one could write an editor that wraps lilypond and invokes it in realtime to show the output in an adjacent panel, perhaps with a

Re: Working with decimals

2014-08-24 Thread Seymore4Head
On Sun, 24 Aug 2014 00:04:29 -0700, Larry Hudson org...@yahoo.com wrote: On 08/23/2014 02:13 PM, Seymore4Head wrote: On Sat, 23 Aug 2014 13:47:20 -0400, Seymore4Head I found this function that I will be saving for later. def make_it_money(number): import math return '$' +

Re: Working with decimals

2014-08-24 Thread Seymore4Head
On Sun, 24 Aug 2014 00:04:29 -0700, Larry Hudson org...@yahoo.com wrote: On 08/23/2014 02:13 PM, Seymore4Head wrote: On Sat, 23 Aug 2014 13:47:20 -0400, Seymore4Head I found this function that I will be saving for later. def make_it_money(number): import math return '$' +

Challenge to convert a simple IDL code into Python

2014-08-24 Thread Cleo Drakos
Here is IDL code: pro read_binary_file file = 3B42RT.2014010318.7.bin num_lon = 1440 num_lat = 480 data = {header: bytarr(num_lon*2), precip: intarr(num_lon,num_lat), precip_error: intarr(num_lon,num_lat), $ source_of_estimate: bytarr(num_lon,num_lat), precip_uncal:

Re: Challenge to convert a simple IDL code into Python

2014-08-24 Thread Gary Herron
On 08/24/2014 08:38 AM, Cleo Drakos wrote: Here is IDL code: |pro read_binary_file file= 3B42RT.2014010318.7.bin num_lon= 1440 num_lat= 480 data= {header: bytarr(num_lon*2), precip: intarr(num_lon,num_lat), precip_error: intarr(num_lon,num_lat), $ source_of_estimate:

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 23 August 2014 23:53, Chris Angelico ros...@gmail.com wrote: On Sun, Aug 24, 2014 at 8:47 AM, Joshua Landau jos...@landau.ws wrote: On 23 August 2014 23:31, Chris Angelico ros...@gmail.com wrote: I'd say never is too strong (there are times when it's right to put an import inside a

Re: Working with decimals

2014-08-24 Thread Ian Kelly
On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau jos...@landau.ws wrote: Is math not already imported by start-up? Why would it be? -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with decimals

2014-08-24 Thread Ian Kelly
On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau jos...@landau.ws wrote: Is math not already imported by start-up? Why would it be? It's easy to check, by the way: $ python -c import sys; print(sys.modules['math'])

Re: Global indent

2014-08-24 Thread Joshua Landau
On 23 August 2014 22:55, Rustom Mody rustompm...@gmail.com wrote: On Sunday, August 24, 2014 2:27:56 AM UTC+5:30, Joshua Landau wrote: Ay, so is any editor with an API. I use Sublime mostly because it's pretty, fast and has a Python-based API. The only actual feature it has that some others

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:19, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau jos...@landau.ws wrote: Is math not already imported by start-up? Why would it be? It's easy to check, by

Re: Som confusion about the python library installation

2014-08-24 Thread Michael Torrie
On 08/24/2014 03:17 AM, Heinz Schmitz wrote: Don't forget to mention the hardware requirements for 14.04. Me thinks that a single core CPU and a medium class graphics card won't make the user happy with it. Wouldn't it be friendly to the resources of our world if at least some software was

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:25, Joshua Landau jos...@landau.ws wrote: On 24 August 2014 20:19, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau jos...@landau.ws wrote: Is math not already

Re: Working with decimals

2014-08-24 Thread Ian Kelly
On Sun, Aug 24, 2014 at 1:25 PM, Joshua Landau jos...@landau.ws wrote: On 24 August 2014 20:19, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau jos...@landau.ws wrote: Is math

Re: Working with decimals

2014-08-24 Thread Ian Kelly
On Sun, Aug 24, 2014 at 1:29 PM, Joshua Landau jos...@landau.ws wrote: On 24 August 2014 20:25, Joshua Landau jos...@landau.ws wrote: On 24 August 2014 20:19, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Sun, Aug 24, 2014

[ANN] Pylint 1.3.1 / Astroid 1.2.1 released

2014-08-24 Thread Claudiu Popa
Hello! I'm happy to announce that Pylint 1.3.1 and Astroid 1.2.1 were released. These releases include some bugfixes with the new string formatting checker and a couple of crash fixes. Please note that Pylint 1.3.X is the last version of Pylint which supports Python 2.5 and 2.6. Enjoy! --

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:40, Ian Kelly ian.g.ke...@gmail.com wrote: That's the same check I posted, just using the in operator instead of a straight lookup and raising an error. I think I need to take a break from the internet. This is the second time in as many threads that I've responded with

Re: Working with decimals

2014-08-24 Thread Larry Hudson
On 08/24/2014 08:12 AM, Seymore4Head wrote: [snip] I almost moved, but I was looking at the print out again for this one: print('%3d $%-13.2f $%-14.2f' % (count, payment, balance)) I can't understand why the $%-13.2f is pushed against the first column, but the $%-14.2f is not. It seems like

Re: Working with decimals

2014-08-24 Thread Seymore4Head
On Sun, 24 Aug 2014 14:24:19 -0700, Larry Hudson org...@yahoo.com wrote: On 08/24/2014 08:12 AM, Seymore4Head wrote: [snip] I almost moved, but I was looking at the print out again for this one: print('%3d $%-13.2f $%-14.2f' % (count, payment, balance)) I can't understand why the $%-13.2f is

Python makes Dilbert's list

2014-08-24 Thread Terry Reedy
For Sunday, Aug 24, 2014. http://www.dilbert.com/dyn/str_strip/0//000/20/2/5000/500/225504/225504.strip.sunday.gif -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: what do you get with 1 divide by 998001, interesting results

2014-08-24 Thread Everything You Need To Know
eyntk: I have a certain affection for your videos. I'm not sure they are useful to all, but maybe interesting to some. Kudos to all who try to spread their interest and knowledge. But this is a tough and very fair and generous crowd here I believe. Its probably better to listen and

Re: Python makes Dilbert's list

2014-08-24 Thread William Ray Wing
On Aug 24, 2014, at 7:18 PM, Terry Reedy tjre...@udel.edu wrote: For Sunday, Aug 24, 2014. http://www.dilbert.com/dyn/str_strip/0//000/20/2/5000/500/225504/225504.strip.sunday.gif — And at the risk of straying a bit OT, here is what Dilbert should have pointed his

Re: Working with decimals

2014-08-24 Thread Steven D'Aprano
Joshua Landau wrote: python -c import sys; print('math' in sys.modules) False An even easier check: python -c import time; a = time.time(); import math; b = time.time(); print(b-a) 0.0006012916564941406 python -c import math, time; a = time.time(); import math; b = time.time();

Re: Working with decimals

2014-08-24 Thread Chris Angelico
On Mon, Aug 25, 2014 at 12:16 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Joshua Landau wrote: python -c import sys; print('math' in sys.modules) False An even easier check: python -c import time; a = time.time(); import math; b = time.time(); print(b-a)

Re: what do you get with 1 divide by 998001, interesting results

2014-08-24 Thread Chris Angelico
On Mon, Aug 25, 2014 at 10:04 AM, Everything You Need To Know ey...@outlook.com wrote: *** Please do not respond, I would like to see this thread dissapear and reintroduce myself in 4 weeks! Just so you know, asking people to not respond almost never works. :) On the flip side, asking for

GO vs Python

2014-08-24 Thread Rodrick Brown
I spent a few weeks looking at Go and have to say you can see a lot of Python's influence in Go, however my question to this list for others who are doing real work with Go and Python have you encountered any scenarios in which Go outmatched Python in terms of elegance or performance? --RB --

Re: Working with decimals

2014-08-24 Thread Steven D'Aprano
Chris Angelico wrote: I love this list. We can go off on a ridiculously long tangent, simply because I said that it's only *usually* best to put imports at the top of the file. We all agree that it normally is indeed best to hoist them, and here we are, arguing over measurement methods on

Re: GO vs Python

2014-08-24 Thread Sam Fourman Jr.
On Sun, Aug 24, 2014 at 9:36 PM, Rodrick Brown rodrick.br...@gmail.com wrote: I spent a few weeks looking at Go and have to say you can see a lot of Python's influence in Go, however my question to this list for others who are doing real work with Go and Python have you encountered any

Re: Working with decimals

2014-08-24 Thread Chris Angelico
On Mon, Aug 25, 2014 at 12:51 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Chris Angelico wrote: I love this list. We can go off on a ridiculously long tangent, simply because I said that it's only *usually* best to put imports at the top of the file. We all agree that it

Re: GO vs Python

2014-08-24 Thread Chris Angelico
On Mon, Aug 25, 2014 at 12:57 PM, Sam Fourman Jr. sfour...@gmail.com wrote: my initial reason for even looking at GO, was because, I noticed that if I wanted to move my largest clients app from Python 2.x to 3.x it was almost a rewrite. and then when I noticed the libraries for python 3.x

Re: Challenge to convert a simple IDL code into Python

2014-08-24 Thread Steven D'Aprano
Cleo Drakos wrote: Thanks for your response. The IDL code reads the given binary file, and prints out the data inside it. The binary file structure is provided using the variable 'data' in the IDL code. Then it print the only required data that in side the 'data that is precip. However

Re: GO vs Python

2014-08-24 Thread Sam Fourman Jr.
On Sun, Aug 24, 2014 at 10:07 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Aug 25, 2014 at 12:57 PM, Sam Fourman Jr. sfour...@gmail.com wrote: my initial reason for even looking at GO, was because, I noticed that if I wanted to move my largest clients app from Python 2.x to 3.x it

Re: GO vs Python

2014-08-24 Thread Chris Angelico
On Mon, Aug 25, 2014 at 1:27 PM, Sam Fourman Jr. sfour...@gmail.com wrote: I remember doing some browsing around, and the pooco people that make jinja2 were not fans of python3(I forget the blog post), I got scared because a very large portion of my income was based on a single client... So

Python and RTSP client

2014-08-24 Thread Akshay Verma
I have to read a RTSP stream in my program and return network status while doing so. Can anybody guide me through it? I have searched online, there are few repos on github, gstreamer python binding and others. Which one is better? Best Regards, Akshay Verma. --

Re: GO vs Python

2014-08-24 Thread Terry Reedy
On 8/24/2014 10:57 PM, Sam Fourman Jr. wrote: my initial reason for even looking at GO, was because, I noticed that if I wanted to move my largest clients app from Python 2.x to 3.x it was almost a rewrite. idlelib comprises about 60 .py files. The 2.7 versus 3.4 versions are perhaps 99%

[issue22236] Do not use _default_root in Tkinter tests

2014-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 32fdaf401e50 by Serhiy Storchaka in branch '2.7': Issue #22236: Tkinter tests now don't reuse default root window. New root http://hg.python.org/cpython/rev/32fdaf401e50 New changeset dd1dffe6f0d2 by Serhiy Storchaka in branch '3.4': Issue #22236:

[issue22263] Add a resource for CLI tests

2014-08-24 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Some modules have command-line interface (not always documented and tested). Their tests run a lot of subprocesses and requires long time, often longer than other tests of corresponding module. However command-line interface itself is much less important

[issue22236] Do not use _default_root in Tkinter tests

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Terry and Zachary for your reviews. I have committed the patch in haste because other issues depend on it. -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - resolved status: open - closed

[issue22260] Rearrange tkinter tests, use test discovery

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Currently Tkinter tests are splitted on four tests: test_tcl, test_tk, test_ttk_textonly, test_ttk_guionly. Ttk tests are separated because ttk is optional on Tk 8.4 and because ttk is separate large part of Tkinter. test_tcl and test_ttk_textonly are

[issue22258] Use FD_CLOEXEC in Python/fileutils.c

2014-08-24 Thread Igor Pashev
Igor Pashev added the comment: errno is 25 (#define ENOTTY 25 /* Inappropriate ioctl for device */) It does not make sense to me to call unworkable ioctl() each time before other methods :-) I would consider adding a configure check for working ioctl() (but it won't work for cross

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Ezio Melotti
Ezio Melotti added the comment: I think similar functions should be added in the unicodedata module rather than the string module or as str methods. If I'm not mistaken this was already proposed in another issue. In C we already added macros like IS_{HIGH|LOW|}_SURROGATE and possibly others

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: The purpose of these changes it to provide tools specifically for working with surrogate escaped data, not for working with arbitrary lone Unicode surrogates. escaped_surrogates is not defined by the Unicode spec, it's defined by the behaviour of the

[issue22261] Document how to use Concurrent Build when using MsBuild

2014-08-24 Thread sbspider
sbspider added the comment: Ok, thank you. Just wanted to confirm this, as I plan to help out on the code/documentation as well (and hence want to understand the process beforehand). I look forward to working on Python in the future. -- ___ Python

[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue15795. It would be good to make shutil, zipfile and tarfile interfaces consistent. I think we need more graduated interface matching coretools. --preserve[=ATTR_LIST] preserve the specified attributes (default:

[issue20912] [zipfile.py]: Make zip directory attributes more friendly for MS-Windows

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could shutil experts please comment this patch? -- nosy: +christian.heimes, hynek, tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20912 ___

[issue22257] PEP 432: Redesign the interpreter startup sequence

2014-08-24 Thread sbspider
Changes by sbspider rajsho...@gmail.com: -- nosy: +sbspider ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22257 ___ ___ Python-bugs-list mailing

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou rep...@bugs.python.org wrote: Who are those people? #16745 was opened by you :-) MvL, in #4555 (msg176486). Platform specific maybe, but no hack: I was thinking about storing the DSO handle in the PyModuleObject struct and add functions to

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with Ezio in all points. escaped_surrogates is inefficient for any purposes and incomplete. _match_surrogates can be created in more efficient way. clean() has too general and misleading name. redecode() looks just ridiculous, this cumbersome

[issue22034] posixpath.join() and bytearray

2014-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset d9607a71456e by Serhiy Storchaka in branch '3.4': Issue #22034: Got rid of misleading error message for bytearray arguments in http://hg.python.org/cpython/rev/d9607a71456e New changeset db600c927b2b by Serhiy Storchaka in branch 'default': Issue

[issue22034] posixpath.join() and bytearray

2014-08-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22034 ___

[issue22207] Test for integer overflow on Py_ssize_t: explicitly cast to size_t

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think there are too many changes. Here is simpler patch which get rid of all warnings in Objects/unicodeobject.c on my computer (gcc 4.6.3, 32-bit Linux). -- Added file: http://bugs.python.org/file36451/unicode_2.patch

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Guys, you're Python 3 unicode experts, already thoroughly familiar with how surrogateescape works. These features are not for you. The exact implementations don't matter. These need to exist, and they need to be documented with detailed explanations. People

[issue22133] IDLE: Set correct WM_CLASS on X11

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Grepping idlelib for 'toplevel, there are about 10. Do all of the Toplevels get put on the activity bar? I would not expect that popups like calltip would. I don't know how dialogs and calltip popups behave on Gnome Shell. But I think we should do this

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Ezio Melotti
Ezio Melotti added the comment: That's why I think a function like redecode is a bad idea. With Python 2 I've seen lot of people blindingly trying .decode when .encode failed (and the other way around) whenever they were getting an UnicodeError (and the fact that decoding Unicode results in an

[issue17896] Move Windows external libs from src\..\ to src\externals

2014-08-24 Thread Mark Lawrence
Mark Lawrence added the comment: I see that this has also been raised on #22262. As nobody has objected can't we just get on with it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17896

[issue22258] Use FD_CLOEXEC in Python/fileutils.c

2014-08-24 Thread STINNER Victor
STINNER Victor added the comment: I propose to only call ioctl() once, and then remember (in a static variable) that it doesn't work and then always call fcntl(). I can work on a patch. -- ___ Python tracker rep...@bugs.python.org

[issue22264] Add wsgiref.fix_encoding

2014-08-24 Thread Nick Coghlan
New submission from Nick Coghlan: The WSGI 1.1 standard mandates that binary data be decoded as latin-1 text: http://www.python.org/dev/peps/pep-/#unicode-issues This means that many WSGI headers will in fact contain *improperly encoded data*. Developers working directly with WSGI (rather

[issue22264] Add wsgiref.util.fix_encoding

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: This would be a better fit for the util submodule rather than the top level package. -- title: Add wsgiref.fix_encoding - Add wsgiref.util.fix_encoding ___ Python tracker rep...@bugs.python.org

[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Last tweak, since the purpose is to fix the original incorrect decoding to latin-1, this should be defined as a decoding operation: def fix_decoding(data, encoding, errors=surrogateescape): return data.encode(latin-1).decode(encoding, errors)

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: The redecode thing is a distraction from my core concern here, so I've split that out to issue #22264, a separate RFE for a wsgiref.fix_encoding function. For this issue, my main concern is the function to *clean* a string of escaped binary data, so it can be

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What problem is purposed to solve clean_surrogate_escapes()? Could you please provide user scenario or two? Possible alternative implementation is: def clean_surrogate_escapes(s): return s.encode('utf-8', 'surrogatepass').decode('utf-8', 'replace') It

[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- components: +Library (Lib), Unicode nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22264

[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide an example how this helper will improve stdlib or user code? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22264 ___

[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +pje ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22264 ___ ___ Python-bugs-list

[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Updated to use assertEqual -- Added file: http://bugs.python.org/file36452/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259 ___

[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Brian Kearns
Changes by Brian Kearns bdkea...@gmail.com: Removed file: http://bugs.python.org/file36450/fdopen-directory.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22259 ___

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 24/08/2014 04:56, Stefan Krah a écrit : I'm not sure about OS X, but I would be surprised if it did not work. To my limited knowledge, Capsules are slow, see also here (the penultimate paragraph): They are slow if you have to lookup and unwrap a capsule

[issue18814] Add tools for cleaning surrogate escaped strings

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: My main use case is for passing data to other applications that *don't* have their Unicode handling in order - I want to be able to use Python to do the data scrubbing, but at the moment it requires intimate knowledge of the codec error handling system to do

[issue16808] inspect.stack() should return list of named tuples

2014-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: It seems like this patch had been overlooked. I refreshed it for 3.5, added a couple tests, and pushed it. Thank you, Daniel! -- assignee: meador.inge - nosy: +pitrou resolution: - fixed stage: commit review - resolved status: open - closed

[issue16808] inspect.stack() should return list of named tuples

2014-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset d03730abd2f6 by Antoine Pitrou in branch 'default': Issue #16808: inspect.stack() now returns a named tuple instead of a tuple. http://hg.python.org/cpython/rev/d03730abd2f6 -- nosy: +python-dev ___

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah
Stefan Krah added the comment: Ah yes, the array of function pointers is directly accessible. I did not look close enough -- reading the word spam 100x in the docs always makes me skim the text. ;) -- ___ Python tracker rep...@bugs.python.org

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: MvL, in #4555 (msg176486). Ok, I'm cc'ing Martin then :-) Note RTLD_LOCAL seems to be the default with dlopen(). Now I don't know how that behaves when you have a chained library loading, e.g.: Apache -- dlopen(Python dll) -- dlopen(_decimal dll) _decimal

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Stefan Krah
Stefan Krah added the comment: Antoine Pitrou rep...@bugs.python.org wrote: (which means that, perhaps, the answer is to make the mpd_ prefix configurable with a #define?) I don't know 100% what you have in mind, but Debian and Arch already ship --with-system-libmpdec, so only the mpd_*

[issue22194] access to cdecimal / libmpdec API

2014-08-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 24/08/2014 11:11, Stefan Krah a écrit : Antoine Pitrou rep...@bugs.python.org wrote: (which means that, perhaps, the answer is to make the mpd_ prefix configurable with a #define?) I don't know 100% what you have in mind, but Debian and Arch already

[issue22264] Add wsgiref.util.fix_decoding

2014-08-24 Thread Nick Coghlan
Nick Coghlan added the comment: Current cryptic incantation that requires deep knowledge of the encoding system to follow: data = data.encode(latin-1).decode(utf-8, surrogateescape) Replacement that is not only more self-documenting, but also gives you something specific to look up in

[issue22259] fdopen of directory causes segmentation fault

2014-08-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6e67a0394957 by Benjamin Peterson in branch '2.7': don't segfault when trying to fdopen() a fd for a dir (closes #22259) http://hg.python.org/cpython/rev/6e67a0394957 -- nosy: +python-dev resolution: - fixed stage: patch review - resolved

[issue22240] argparse support for python -m module in help

2014-08-24 Thread Miki Tebeka
Miki Tebeka added the comment: New patch with handling of zip files. -- Added file: http://bugs.python.org/file36453/prog2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22240 ___

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2014-08-24 Thread Antti Haapala
Antti Haapala added the comment: On Python 2.7 urlparse.urlparse, parsing None, () or 0 will throw AttributeError because these classes do not have any 'find' method. [] has the find method, but will fail with TypeError, because the built-in caching requires that the input be hashable.

[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-08-24 Thread Dan O'Reilly
Dan O'Reilly added the comment: So, concurrent.futures is fixed now. Unless someone wants to patch multiprocessing.Pool, I am closing this issue. I realize I'm 3 years late on this, but I've put together a patch for multiprocessing.Pool. Should a process in a Pool unexpectedly exit

[issue22240] argparse support for python -m module in help

2014-08-24 Thread paul j3
paul j3 added the comment: The patch tests assume the test is being run in a particular way: python -m unittest ... But I often use python3 -m unittest ... or python3 test_argparse.py both of which fail these tests. Testing this change might be more difficult than implementing

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: The test fails on Python implementations with non-refcounted GCs without this line. -- files: test_itertools.patch keywords: patch messages: 225835 nosy: bdkearns priority: normal severity: normal status: open title: fix reliance on refcounting in

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: tarfile.gzopen relies on refcounting to close the fileobj when the fileobj is created during the call to gzopen (when it is not passed in). Since the fileobj is created outside of GzipFile, GzipFile does not take responsibility for closing the fileobj (so no

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Should go on py3k branches too... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22265 ___ ___ Python-bugs-list

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22265 ___ ___ Python-bugs-list mailing

[issue22266] fix reliance on refcounting in tarfile.gzopen

2014-08-24 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22266 ___ ___ Python-bugs-list mailing

[issue22265] fix reliance on refcounting in test_itertools

2014-08-24 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22265 ___ ___

[issue22240] argparse support for python -m module in help

2014-08-24 Thread paul j3
paul j3 added the comment: What if the package is run without `-m`? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22240 ___ ___

[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns
New submission from Brian Kearns: The test fails on Python implementations with non-refcounted GCs without these lines. Should go on py3k branches also. -- files: test_weakref.patch keywords: patch messages: 225839 nosy: bdkearns priority: normal severity: normal status: open title:

[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Alex Gaynor
Alex Gaynor added the comment: Perhaps these should use the gc_collect function in test_support? -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22267 ___

[issue22267] fix reliance on refcounting in test_weakref

2014-08-24 Thread Brian Kearns
Brian Kearns added the comment: Possibly. But if so then one would argue there are plenty of other instances where gc_collect should be used, both within test_weakref and the rest of the test suite. Chose gc.collect here as it was used all over test_weakref.py, gc_collect never being used,

[issue22268] mrohasattr and mrogetattr

2014-08-24 Thread Gregory Salvan
New submission from Gregory Salvan: It's a small refactoring. Lurking at collections.abc I found a lot of: any(attr in B.__dict__ for B in C.__mro__) also repeated in typing.py of mypy: https://github.com/JukkaL/mypy/blob/master/lib-typing/3.2/typing.py#L117 It seems to be a common

[issue22269] Resolve distutils option conflicts with priorities

2014-08-24 Thread Min RK
New submission from Min RK: Background: Some Python distros (OS X, Debian, Homebrew, others) want the default installation prefix for packages to differ from sys.prefix. OS X and Debian accomplish this by patching distutils itself, with special cases like `if sys.prefix ==

[issue21480] A build now requires...

2014-08-24 Thread paul j3
paul j3 added the comment: I ran into a (possibly) related compiling problem (for 'default', 3.5 branch) in `asdl.py`: class Module(AST): def __init__(self, name, dfns): ... self.types = {type.name: type.value for type in dfns} The dictionary comprehension

  1   2   >