Re: Python 3 is killing Python
in 722929 20140601 035727 Steve Hayes hayes...@telkomsa.net wrote: No, it's a bit like flying in a Boeing 747 rather than a Concorde. The latyer may be later and more technically advanced and flew faster, but no one uses or supports it. Actually, the Concorde preceded the 747, and wasn't as technically advanced, it was just faster. -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
On 01/06/2014 07:01, Bob Martin wrote: in 722929 20140601 035727 Steve Hayes hayes...@telkomsa.net wrote: No, it's a bit like flying in a Boeing 747 rather than a Concorde. The latyer may be later and more technically advanced and flew faster, but no one uses or supports it. Actually, the Concorde preceded the 747, and wasn't as technically advanced, it was just faster. I recall Barnes Wallis slagging off the droop nose, but what did he know about aircraft? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Rustom Mody rustompm...@gmail.com: On Friday, May 30, 2014 10:37:00 PM UTC+5:30, Rustom Mody wrote: Think for example of a German wanting to write Gödel According to some conventions (s)he can write Goedel [...] | if there is an german Umlaut in the section title like 'ä' this | becomes just 'a' in the label. Is there any possibility that auctex | will substitute the 'ä' by 'ae' and not by 'a'? Answer: | '�' is not possible, since latex can not handle Umlauts in | references. For 'ae' I'm sure someone is able to provide a little | patch. As a Finnish-speaker, I hope that patch doesn't become default behavior. Too many times, we have been victimized by the German conventions. A Finnish-speaker would much rather see Järvenpää = Jarvenpaa Öllölä = Ollola Kärkkäinen = Karkkainen than Järvenpää = Jaervenpaeae Öllölä = Oelloelae Kärkkäinen = Kaerkkaeinen Marko -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
On Sun, Jun 1, 2014 at 5:58 PM, Marko Rauhamaa ma...@pacujo.net wrote: As a Finnish-speaker, I hope that patch doesn't become default behavior. Too many times, we have been victimized by the German conventions. A Finnish-speaker would much rather see Järvenpää = Jarvenpaa Öllölä = Ollola Kärkkäinen = Karkkainen than Järvenpää = Jaervenpaeae Öllölä = Oelloelae Kärkkäinen = Kaerkkaeinen It's even worse than that. The rules for ASCIIfying adorned characters vary according to context - Müller and Mueller are different names, and in many contexts should sort and compare differently, and I remember reading somewhere that there's a context in which it's more useful to decompose ü to u rather than ue. There is no safe lossy transformation that can be done to any language's words, and this is no exception. ASCIIfication has to be accepted as flawed; this issue (an inability to handle non-ASCII labels) is similar to a lot of blog URLs - http://rosuav.blogspot.com/2013/08/20th-international-g-festival-awards.html is talking about the International GS Festival awards, but the URL drops the S part. (If you absolutely have to transmit something losslessly in pure ASCII, you need a scheme like Punycode, which is a lot less clean and readable than a decomposition scheme.) Of course, the better solution is to permit the full Unicode alphabet in identifiers... ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
On Sunday, June 1, 2014 2:01:09 PM UTC+5:30, Chris Angelico wrote: On Sun, Jun 1, 2014 at 5:58 PM, Marko Rauhamaa wrote: As a Finnish-speaker, I hope that patch doesn't become default behavior. Too many times, we have been victimized by the German conventions. A Finnish-speaker would much rather see Järvenpää = Jarvenpaa Öllölä = Ollola Kärkkäinen = Karkkainen than Järvenpää = Jaervenpaeae Öllölä = Oelloelae Kärkkäinen = Kaerkkaeinen It's even worse than that. The rules for ASCIIfying adorned characters vary according to context - Müller and Mueller are different names, and in many contexts should sort and compare differently, and I remember reading somewhere that there's a context in which it's more useful to decompose ü to u rather than ue. There is no safe lossy transformation that can be done to any language's words, and this is no exception. ASCIIfication has to be accepted as flawed; this issue (an inability to handle non-ASCII labels) is similar to a lot of blog URLs - http://rosuav.blogspot.com/2013/08/20th-international-g-festival-awards.html is talking about the International GS Festival awards, but the URL drops the S part. (If you absolutely have to transmit something losslessly in pure ASCII, you need a scheme like Punycode, which is a lot less clean and readable than a decomposition scheme.) Of course, the better solution is to permit the full Unicode alphabet in identifiers... Yes that is the real point. Changing the current behavior which maps [ö,ä…] → [o,a…] to a new behavior that maps it to [oe,ae…], then arguing that this should/should not become default is the wrong battle. The more useful line is: Why have this conversion at all? Until hardly 3 years ago html authors wrote non-ASCII as chars as html entities. Now the current standard practice is directly to write the character and make sure the page is explicitly utf-8. Its only a question of time before this becomes standard practice in all domains -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
On Sun, 01 Jun 2014 18:31:09 +1000, Chris Angelico wrote: the better solution is to permit the full Unicode alphabet in identifiers... I'm not entirely sure about that. Full Unicode support in identifiers such as URLs doesn't create a brand new vulnerability, but it does increase it from a fairly minor problem to something *much* harder to deal with. It's bad enough when somebody manages to fool you into going to (say) app1e.com instead of apple.com, without also being at risk from аррlе, аpрlе, арplе and аррle (to mention just a few). At least nobody can fake .com with .соm. To put it another way: py аррlе = 23 py apple = 42 py assert аррlе == apple Traceback (most recent call last): File stdin, line 1, in module AssertionError -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
On Sun, Jun 1, 2014 at 7:06 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 01 Jun 2014 18:31:09 +1000, Chris Angelico wrote: the better solution is to permit the full Unicode alphabet in identifiers... I'm not entirely sure about that. Full Unicode support in identifiers such as URLs doesn't create a brand new vulnerability, but it does increase it from a fairly minor problem to something *much* harder to deal with. It's bad enough when somebody manages to fool you into going to (say) app1e.com instead of apple.com, without also being at risk from аррlе, аpрlе, арplе and аррle (to mention just a few). At least nobody can fake .com with .соm. To put it another way: py аррlе = 23 py apple = 42 py assert аррlе == apple Traceback (most recent call last): File stdin, line 1, in module AssertionError Yeah, that is a concern. But as you say, it's already possible to confuse rn with m (in many fonts) and i/l/1, and (on a different level) Foo, foo, _foo, _Foo, and FOO, or movement_Direction and movement_direction. If you saw one of those in one part of a program and another in another, you'd have to consume an annoying amount of mindspace to keep them separate. Note, incidentally, that I said alphabet rather than the entire Unicode character set. I do *not* support the use of, for instance, U+200B 'ZERO WIDTH SPACE' in identifiers, that's just stupid :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Suds and Python3
Hello, First, for such questions, there's always s...@python.org On 31/05/14 21:59, Paul McNett wrote: On 5/31/14, 11:36 AM, tokib...@gmail.com wrote: Suds is defacto python SOAP client, but it does not mainte recent few years. Why? The original authors don't seem to care anymore. If you search PyPi you'll see that there are many suds forks as a result. See e.g. https://pypi.python.org/pypi/suds-jurko/0.6 This was a popular topic during past month: https://mail.python.org/pipermail/soap/2014-May/thread.html Is it really the defacto? It seems like I've heard more about pysimplesoap, and looking at GitHub there have been commits in the past 4 days. Yes, suds is really the de facto soap client for python. I'd even dropped the soap client in Spyne years ago in favor of suds. Seeing suds' current situation though, I'm more and more tempted to sit home one weekend and bring it back. In general, SOAP has been falling out of favor over the past half decade at least because of its relative heaviness next to, e.g. RESTful web services usually using JSON instead of XML. Way, way simpler and more fun to do. Xml also has its strengths. Especially compared to json, which only supports 6 types: string, number, dict, list, boolean (true/false) and null. Json gets hairy very fast even when you try to do seemingly simple things like serializing arbitrary precision decimals. And from what I can tell without actually trying any of them, pysimplesoap feels like the best option currently. Not really, there are other options. See the discussions in the above link. Best, Burak -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
On Sun, 1 Jun 2014 13:35:11 +1000, Chris Angelico ros...@gmail.com wrote: boeing-l...@boeing.org people, any hour of the day or night. All you're doing is picking your technology on the basis of *one* dead-tree book that you happen to have found. Is that really the most important deciding point? Yes. -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
On Sun, 01 Jun 2014 07:01:46 BST, Bob Martin bob.mar...@excite.com wrote: in 722929 20140601 035727 Steve Hayes hayes...@telkomsa.net wrote: No, it's a bit like flying in a Boeing 747 rather than a Concorde. The latyer may be later and more technically advanced and flew faster, but no one uses or supports it. Actually, the Concorde preceded the 747, and wasn't as technically advanced, it was just faster. Boeing 747s were in airline service in 1970, Concorde didn't enter service till 4-5 years later. Not that it matters, it was just an analogy. I'm pretty certain that Python 2.x preceded Python 3.x -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
On 01/06/2014 12:41, Steve Hayes wrote: On Sun, 01 Jun 2014 07:01:46 BST, Bob Martin bob.mar...@excite.com wrote: in 722929 20140601 035727 Steve Hayes hayes...@telkomsa.net wrote: No, it's a bit like flying in a Boeing 747 rather than a Concorde. The latyer may be later and more technically advanced and flew faster, but no one uses or supports it. Actually, the Concorde preceded the 747, and wasn't as technically advanced, it was just faster. Boeing 747s were in airline service in 1970, Concorde didn't enter service till 4-5 years later. Not that it matters, it was just an analogy. I'm pretty certain that Python 2.x preceded Python 3.x Clearly you know nothing about the Python time machine :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com -- https://mail.python.org/mailman/listinfo/python-list
Drawing Sinus curve in Python
Hi Experts I am trying to draw a sine curve in Python , well first I had a script that i could draw a function curve in this way : xMax = 25.0 points = [] for i in range(100): x = (float(i)/99)*xMax y = math.sqrt(x) points.append([x,y]) s.Spline(points=points) first i have questions that : what does the line x = (float(i)/99)*xMax do ? why do we multiply it by and then when I wanted to draw a sine curve I found this one : import math for angle in range(): y = math.sin(math.radians(angle)) print(y) first , here instead of can we put 2*pi ? second i wanted to try this method instead: xMax = pi Lamda = 200 points = [] for i in range(Lamda): x = (float(i)/99)*xMax y = math.sin(x) points.append([x,y]) it actually works much better and creates an actual sine curve but the lengths are not really what i want , also if i want to draw a straight line I use this command : xMax = 1 Lamda = 200 points = [] for i in range(Lamda): x = (float(i)/99) y = xMax points.append([x,y]) but then the problem will be that I can not control the length of this line and the sine curve , that should be equal -- https://mail.python.org/mailman/listinfo/python-list
Re: Drawing Sinus curve in Python
On Sun, 01 Jun 2014 05:17:07 -0700, Farzad Torabi wrote: Hi Experts I am trying to draw a sine curve in Python , well first I had a script that i could draw a function curve in this way : xMax = 25.0 points = [] for i in range(100): x = (float(i)/99)*xMax y = math.sqrt(x) points.append([x,y]) s.Spline(points=points) What is s? Where does it come from? first i have questions that : what does the line x = (float(i)/99)*xMax do ? why do we multiply it by In older versions of Python, division / with integer arguments does integer division, like C, instead of calculator division. For example: 1/2 = returns 0 instead of 1/2 returning 0.5 like a calculator does. In these older versions of Python, you can fix that by converting one of the arguments to a float first: 1/2.0 = 0.5 So float(i)/99 converts the loop index i to a float, then divides by 99. An easier way to get the same result is i/99.0. Then, multiplying by xMax simply scales the result to be between 0 and xMax, in this case 25.0. Look at the results: when i = 0, x = 0/99.0*25 = 0.0 when i = 99, x = 99/99.0*25.9 = 25.0 every other value of i gives a corresponding value between 0 and 25. and then when I wanted to draw a sine curve I found this one : import math for angle in range(): y = math.sin(math.radians(angle)) print(y) first , here instead of can we put 2*pi ? No. The Python built-in range() function only accepts integer values. It is quite tricky to *accurately* produce floating point ranges. While it is easy to make a floating point range, it is much harder to make it accurate. You can see some discussion about the problem, and some sample code, here: http://code.activestate.com/recipes/577068 http://code.activestate.com/recipes/577878 http://code.activestate.com/recipes/577881 second i wanted to try this method instead: xMax = pi Lamda = 200 points = [] for i in range(Lamda): x = (float(i)/99)*xMax y = math.sin(x) points.append([x,y]) it actually works much better and creates an actual sine curve but the lengths are not really what i want , also if i want to draw a straight line I use this command : xMax = 1 Lamda = 200 points = [] for i in range(Lamda): x = (float(i)/99) y = xMax points.append([x,y]) In this example, you are calculating points from a straight line. x varies from 0.0 to 2.0202 in steps of 1/99, and y is always the same value, 1. but then the problem will be that I can not control the length of this line and the sine curve , that should be equal You have to get the maths right, otherwise the graph will be wrong. -- Steven D'Aprano http://import-that.dreamwidth.org/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Command prompt not shown when running Python script with subprocess on Windows
29/05/2014 20:21, ps16thypresenceisfullnessof...@gmail.com wrote: That's interesting, now I learned something else too. As I said before, though, I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. [...] Since in a Windows shortcut you don't need to put quotes around a path that doesn't contain spaces, I want to follow that behavior in my program as well. [...] So I guess I'll still have to do my shlex dance (which for some reason I keep on mistyping as shlex dane :-)) unless I can learn a better way to do it. It looks like it. Sometimes the behaviour out of the box just doesn't cut it. Don't forget, also, that you can subclass, eg, the shlex.shlex class and tweak it to do what you need. Also, is my calling os.path.expandvars only on the first argument a good idea? I want to accept environment variables in my program, but I don't want to call os.path.expandvars on all the arguments, because I want to let other programs take care of parsing their own arguments. I'd say that's a call only you can make given what you know of your requirements. That said, I'm not sure what the other programs are going to do with any embedded env vars except to expand them as you're doing. Ultimately, don't tie yourselves in knots either trying too hard to emulate Windows shortcuts or trying too hard to use shlex.split out of the box. Decide what constitutes a useful combination of features and implement them as simply as you can. [He says, winning the prize for stating the obvious :) ] TJG -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
On Sun, 01 Jun 2014 13:41:33 +0200, Steve Hayes wrote: On Sun, 01 Jun 2014 07:01:46 BST, Bob Martin bob.mar...@excite.com wrote: in 722929 20140601 035727 Steve Hayes hayes...@telkomsa.net wrote: No, it's a bit like flying in a Boeing 747 rather than a Concorde. The latyer may be later and more technically advanced and flew faster, but no one uses or supports it. Actually, the Concorde preceded the 747, and wasn't as technically advanced, it was just faster. Boeing 747s were in airline service in 1970, Concorde didn't enter service till 4-5 years later. Concord first flight march 2 1969 757 First flight Feb 9 1969 so there is not actually that much in it 747 entered service much sooner however Not that it matters, it was just an analogy. I'm pretty certain that Python 2.x preceded Python 3.x -- There seems no plan because it is all plan. -- C.S. Lewis -- https://mail.python.org/mailman/listinfo/python-list
Is MVC Design Pattern good enough?
Hi All, I had developed many database business applications using MVC design pattern with different programming languages like PHP, Java EE, VB.NET, C#, VB 6.0, VBA, etc. All of them defined the Model layer as the data management of the application domain and business logic implementation. I ready don’t understand what the data has to do with applications business logic. Nothing? Can we implement the application business logic in another layer? Yes or no? Why? Explain? Thank you all for the inputs! -- Thanks Ernest Bonat, Ph.D. Senior Software Engineer Senior Business Statistics Analyst Mobile: 503.730.4556 Email: ernest.bo...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le dimanche 1 juin 2014 03:48:07 UTC+2, Rustom Mody a écrit : On Friday, May 30, 2014 10:37:00 PM UTC+5:30, Rustom Mody wrote: You are talking about the infrastructure needed for writing unicode apps. The language need not have non-ASCII lexemes for that I am talking about something quite different. Think for example of a German wanting to write Gödel According to some conventions (s)he can write Goedel But if that is forced just because of ASCII/US-104/what-have-u it would justifiably cause irritation/offense. Curiously I just saw this tex/emacs question/answer elsewhere – particularly amusing the first 'char' of the answer. Question: | I'm a new Emacs/Auctex User. Auctex for Emacs is amazing but | there are some little things could be better. When generating a | section with c-c c-s the label ist generated automatically. But | if there is an german Umlaut in the section title like 'ä' this | becomes just 'a' in the label. Is there any possibility that | auctex will substitute the 'ä' by 'ae' and not by 'a'? Answer: | '�' is not possible, since latex can not handle Umlauts in references. | For 'ae' I'm sure someone is able to provide a little patch. %% \begin{document} A small text, αβγ. {\label{étiquette€α}}\\ See page \pageref{étiquette€α}. \end{document} # copy/paste from the generated pdf in my interactive # interpreter. A small text, αβγ. ... See page 1. ' A small text, αβγ.\nSee page 1. ' jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le mercredi 28 mai 2014 14:55:35 UTC+2, Chris Angelico a écrit : On Wed, May 28, 2014 at 9:46 PM, Greg Schroeder gmschroe...@gmail.com wrote: Please suggest, if we have any free ide for python development. Anything that writes text is fine. I recommend the standard text editor for your OS (Notepad if you use Windows, Textedit on Mac, whatever is on your GNU/Linux distro by default) unless you know exactly what you don't like about it. No. Don't use Notepad for anything! It's easy enough to get a better editor. Among its other faults, Notepad: 1) Has problems with LF line endings (they vanish, and you have hugely long lines) 2) Puts three junk bytes onto the beginning of a file that it considers saved as UTF-8 3) Doesn't understand coding cookies, and will happily save something in a different encoding like CP-1252 (which it calls ANSI) 4) Guesses encodings on load, giving rise to the famous Bush hid the facts trick - although this is unlikely to be a problem with something of decent size 5) Has issues with large files - or at least, it did last time I tried; this may no longer be true with Windows 7/8 Default text editors on the Linux distros I've used have been far better, but still less than ideal. With Debian Squeeze, I got a gedit that bugged me in several ways, which is what pushed me onto SciTE. You can certainly start coding with gedit, though. The issues that I had with it were relating to heavy-duty usage that I do, where I'm basically spending an entire day delving into code and moving stuff around. These days, though, I'd rather have one editor on both the platforms I use (Windows and Linux, each in multiple variants), as it allows me to share configs and comfortable keystrokes. There are plenty of cross-platform editors to choose from. So, I agree with your analysis, as regards gedit (know exactly what you don't like about it). If it doesn't bug you, use it. But if Notepad doesn't bug you, *still don't use it*, because it's like driving a car that isn't structurally sound. It might not be you that gets hurt by it... or it might not be for quite a while that you see the problems... but the pain will happen. ChrisA Amen. Ite missa est. -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le vendredi 30 mai 2014 19:30:27 UTC+2, Rustom Mody a écrit : On Friday, May 30, 2014 10:47:33 PM UTC+5:30, wxjm...@gmail.com wrote: = Ok, thanks for the answer. xetex does not quite work whereas pdflatex works smoothly ? Problem is a combination of 1. I am a somewhat clueless noob 2. xetex is emerging technology therefore changing fast and not stable So when something does not work I dont know whether: - its 1 (I am doing something silly) - Or 2 (I have actually hit a bug) I tried writing some small (hello-world) type text using unicode chars rather the old-fashioned \alpha type of locutions. It worked. Added a bunch of more latex packages from apt. It stopped working. -- PS It would help all if you read https://wiki.python.org/moin/GoogleGroupsPython and dont double-space earlier mails. It's not the place to discuss TeX here. (I have actually 16 more or less complete distros on my hd on Windows, all working very well. They are on my hd, but all run from an usb stick as well!) jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: Yet another simple headscratcher
# from my lib def NewMat(nr, nc, val=0.0): ... val = float(val) ... return [[val] * nc for i in range(nr)] ... import vmio6 aa = NewMat(2, 3) vmio6.pr(aa) ( 0.0e+000 0.0e+000 0.0e+000 ) ( 0.0e+000 0.0e+000 0.0e+000 ) aa[0][0] = 3.1416 vmio6.pr(aa) ( 3.14160e+000 0.0e+000 0.0e+000 ) ( 0.0e+000 0.0e+000 0.0e+000 ) aa[1][1] = 1.2345 vmio6.pr(aa) ( 3.14160e+000 0.0e+000 0.0e+000 ) ( 0.0e+000 1.23450e+000 0.0e+000 ) jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le vendredi 30 mai 2014 18:15:09 UTC+2, Rustom Mody a écrit : On Friday, May 30, 2014 8:36:54 PM UTC+5:30, wxjm...@gmail.com wrote: Out of curiosity. Are you the Rusi Mody attempting to dive in Xe(La)TeX? Yeah :-) As my blog posts labelled unicode will indicate I am a fan of using unicode in program source: http://blog.languager.org/search/label/Unicode Of course it is not exactly a coincidence that I used APL a bit in my early days. At that time it was great fun though we did not take it seriously.* It is now about time that we stop taking ASCII seriously!! And for those who dont know xetex, its is really xɘtex – a pictorial anagram if written as XƎTEX However in all fairness I should say that I cannot seem to find my way to that promised land yet: - xetex does not quite work whereas pdflatex works smoothly - mathjax is awesome however its firmly latex (not xetex) based --- * And the fact that there are recent implementations including web ones means its by no means dead: http://baruchel.hd.free.fr/apps/apl/ which I think unicode aficionados will enjoy = Ok, thanks for the answer. xetex does not quite work whereas pdflatex works smoothly ? jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
Le samedi 31 mai 2014 14:30:11 UTC+2, Steven D'Aprano a écrit : On Sat, 31 May 2014 12:07:59 +0200, Steve Hayes wrote: I'll leave Python 3.2 on my computer, but 2.7.5 will be the one I'm installing now. Even if I could *find* a book that deals with Python 3.x, couldn't afford to but yet another Python book. Version 2.7 is a good choice, and it will be around for a long time: it will be supported until at least 2020, so you should get many years of use from it. Do not be discouraged about Python 3. There are differences, but they aren't so different as to be a major barrier. By the time you have a bit of experience with 2.7, you will be more than capable of dealing with the differences with version 3. They are not different languages, think of them as slightly different dialects of the same language, like UK and South African English. == At least Py2 does not crash when using non ascii (eg sticking with cp1252). I just noticed this last week, Thursday, when presenting the absurdity of the Flexible String Representation. jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3 is killing Python
Le mercredi 28 mai 2014 22:24:15 UTC+2, Mark Lawrence a écrit : On 28/05/2014 20:58, Larry Martell wrote: On Wed, May 28, 2014 at 2:49 PM, Paul Rubin no.email@nospam.invalid mailto:no.email@nospam.invalid wrote: Larry Martell larry.mart...@gmail.com mailto:larry.mart...@gmail.com writes: Somthing I came across in my travels through the ether: [1]https://medium.com/@deliciousrobots/5d2ad703365d/ Python 3 can revive Python https://medium.com/p/2a7af4788b10 long HN comment thread: https://news.ycombinator.com/item?id=7801834 Python 3 is fine http://sealedabstract.com/rants/python-3-is-fine/ OT: wow that medium site is obnoxious. No company that I work for is using python 3 - they just have too much of an investment in a python 2 code base to switch. I'm just saying. So you're happy because you've support until at least 2020, and the people using Python 3 are happy, mainly because of the vastly improved unicode handling via the FSR and asyncio in 3.4. Presumably the only unhappy people are those who keep bleating on about forking Python to produce a 2.8, or has work on this already started without my knowledge? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence === Unicode: a reason to not use Python. jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le vendredi 30 mai 2014 16:04:18 UTC+2, Rustom Mody a écrit : On Friday, May 30, 2014 7:24:10 PM UTC+5:30, Marko Rauhamaa wrote: Rustom Mody wrote: 3. Search unopened files (grep) for a string or re. How do you do this with emacs? I find a menagerie of greppish commands -- rgrep, lgrep, grep-find etc To grep for a pattern in the directory of the active buffer: M-x grep Run grep (like this): grep -nH -e Well... lgrep is cleverer than grep (in a stupid sort of way :D ) Was just wondering if there were some other tricks Out of curiosity. Are you the Rusi Mody attempting to dive in Xe(La)TeX? jmf -- https://mail.python.org/mailman/listinfo/python-list
Re: IDE for python
Le vendredi 30 mai 2014 18:38:04 UTC+2, Mark Lawrence a écrit : On 30/05/2014 17:15, Rustom Mody wrote: On Friday, May 30, 2014 8:36:54 PM UTC+5:30, wxjm...@gmail.com wrote: It is now about time that we stop taking ASCII seriously!! This can't happen in the Python world until there is a sensible approach to unicode. Ah, but wait a minute, the ball was set rolling with Python 3.0. Then came PEP 393 and the Flexible String Representation in Python 3.3 and some strings came down in size by a factor of 75% and in most cases it was faster. Just what do some people want in life, jam on it? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com A guy who is understanding unicode would not have even spent its time in writing a PEP 393 proposal. I skip the discussion(s) I read here and there about PDF. Put this comment in relation with my Xe(La)TeX knowledge. jmf -- https://mail.python.org/mailman/listinfo/python-list
[OT] Re: Is MVC Design Pattern good enough?
On Sun, 01 Jun 2014 10:37:24 -0700, Ernest Bonat, Ph.D. wrote: ... MVC design pattern ... defined the Model layer as the data management of the application domain and business logic implementation ... Can we implement the application business logic in another layer? Yes or no? Why? Explain? This is not a Python-specific question, but as far as I'm concerned, you can certainly add structure, modularity, testability, maintainability, readability, flexibility, etc. to your Model (with a capital M). And if that means separating your data management (which usually translates to persistence) from your business logic, then that's what it means. HTH, Dan -- https://mail.python.org/mailman/listinfo/python-list
Segmentation fault (core dumped) while using Cplex Python API
Hello Everyone, I am trying to solve a mixed-integer problem using Cplex Python API and I get this error Segmentation fault (core dumped). i am not able to figure out the reason for this. Traceback srva@hades:~$ python RW10.py --output test --logPath log --xml topology.xml Start Time: 2014-6-1-20-56-39 CPLEX Parameter File Version 12.5.0.0 CPX_PARAM_TILIM 3600 CPX_PARAM_TRELIM 2.00 CPX_PARAM_EPGAP 0.03 CPX_PARAM_EACHCUTLIM 21 CPX_PARAM_FLOWCOVERS 0 CPX_PARAM_FLOWPATHS 0 CPX_PARAM_CLIQUES 0 CPX_PARAM_DISJCUTS 0 CPX_PARAM_COVERS 0 CPX_PARAM_ZEROHALFCUTS 0 CPX_PARAM_MIRCUTS 0 CPX_PARAM_MCFCUTS 0 CPX_PARAM_IMPLBD 0 CPX_PARAM_GUBCOVERS 0 CPX_PARAM_AGGCUTLIM 3 Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Solving Segmentation fault (core dumped) A few lines from the log file: Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Tried aggregator 1 time. MIP Presolve eliminated 12648 rows and 1321088 columns. MIP Presolve modified 180 coefficients. Reduced MIP has 12840 rows, 29800 columns, and 136000 nonzeros. Reduced MIP has 29800 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time = 0.49 sec. (368.57 ticks) I would be grateful if someone can help me fix this. Thank You -- https://mail.python.org/mailman/listinfo/python-list
Re: Segmentation fault (core dumped) while using Cplex Python API
On 06/01/2014 12:28 PM, varun...@gmail.com wrote: Hello Everyone, I am trying to solve a mixed-integer problem using Cplex Python API and I get this error Segmentation fault (core dumped). i am not able to figure out the reason for this. Traceback srva@hades:~$ python RW10.py --output test --logPath log --xml topology.xml Start Time: 2014-6-1-20-56-39 CPLEX Parameter File Version 12.5.0.0 CPX_PARAM_TILIM 3600 CPX_PARAM_TRELIM 2.00 CPX_PARAM_EPGAP 0.03 CPX_PARAM_EACHCUTLIM 21 CPX_PARAM_FLOWCOVERS 0 CPX_PARAM_FLOWPATHS 0 CPX_PARAM_CLIQUES 0 CPX_PARAM_DISJCUTS 0 CPX_PARAM_COVERS 0 CPX_PARAM_ZEROHALFCUTS 0 CPX_PARAM_MIRCUTS 0 CPX_PARAM_MCFCUTS 0 CPX_PARAM_IMPLBD 0 CPX_PARAM_GUBCOVERS 0 CPX_PARAM_AGGCUTLIM 3 Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Solving Segmentation fault (core dumped) A few lines from the log file: Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Tried aggregator 1 time. MIP Presolve eliminated 12648 rows and 1321088 columns. MIP Presolve modified 180 coefficients. Reduced MIP has 12840 rows, 29800 columns, and 136000 nonzeros. Reduced MIP has 29800 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time = 0.49 sec. (368.57 ticks) I would be grateful if someone can help me fix this. Thank You You might be better off finding a CPLEX forum to ask this question. Nothing in this question looks like Python, (except I see you do run a Python script), the segmentation fault is most likely in CPLEX not in Python, and I've never seen CPLEX mention mentioned in this Python newsgroup. None of which means you won't get an answer here, but I think a CPLEX specific forum would be a better bet. Gary Herron -- https://mail.python.org/mailman/listinfo/python-list
Re: Multi-line commands with 'python -c'
Peter Otten __pete...@web.de wrote: Duncan Booth wrote: Chris Angelico ros...@gmail.com wrote: On Sat, May 31, 2014 at 7:42 AM, Devin Jeanpierre jeanpierr...@gmail.com wrote: In unix shells you can literally use a new line. Or is that only bash? You can in bash, I know, but it's fiddly to type it; and more importantly, it's not a good point in the this is cleaner than a series of pipes argument. My primary recommendation, of course, was a three-line script saved as an actual file, but for a more direct parallel to the pipe-it-three-ways model, I wanted to use -c. and you also wrote originally that it's fiddly to edit. I think that Windows Powershell has (at least in the current ISE command line) got the editing a bit better. It's a minor difference though and it has taken Microsoft about 30 years to get to that point. What may be a larger difference, or may just be my lack of Linux-foo, is this: PS C:\python33 $script = @ import os for root, dirs, files in os.walk(.): if len(dirs + files) == 1: print(root) @ PS C:\python33 python -c $script .\Doc .\Lib\concurrent\__pycache__ .\Lib\curses\__pycache__ ... which is a style I've found useful for example when running a group of related timeit.py commands as I can put things like multi-line setup statements in a variable and then have a simpler command to repeat. But bash as far as I can won't let me do that: $ script='import os for root, dirs, files in os.walk(.): if len(dirs + files) == 1: print(root) ' $ python -c $script File string, line 1 import ^ SyntaxError: invalid syntax $ script='import os for root, dirs, files in os.walk(.): if len(dirs + files) == 1: print(root) ' $ python3 -c $script . ./heureka $ python3 -c 'import sys; print(sys.argv)' $script ['-c', 'import', 'os', 'for', 'root,', 'dirs,', 'files', 'in', 'os.walk(.):', 'if', 'len(dirs', '+', 'files)', '==', '1:', 'print(root)'] $ python3 -c 'import sys; print(sys.argv)' $script ['-c', 'import os\nfor root, dirs, files in os.walk(.):\nif len(dirs + files) == 1:\nprint(root)\n'] Thanks, I thought there must be a way to do that (and I should have remembered it). It nicely shows up the difference between the *nix shells that are all about processing the command line as a string and the Powershell way where it is all about objects (so a single value stays as a single argument). -- Duncan Booth -- https://mail.python.org/mailman/listinfo/python-list
Re: Segmentation fault (core dumped) while using Cplex Python API
varun...@gmail.com writes: Hello Everyone, I am trying to solve a mixed-integer problem using Cplex Python API and I get this error Segmentation fault (core dumped). i am not able to figure out the reason for this. Traceback srva@hades:~$ python RW10.py --output test --logPath log --xml topology.xml Start Time: 2014-6-1-20-56-39 CPLEX Parameter File Version 12.5.0.0 CPX_PARAM_TILIM 3600 CPX_PARAM_TRELIM 2.00 CPX_PARAM_EPGAP 0.03 CPX_PARAM_EACHCUTLIM 21 CPX_PARAM_FLOWCOVERS 0 CPX_PARAM_FLOWPATHS 0 CPX_PARAM_CLIQUES 0 CPX_PARAM_DISJCUTS 0 CPX_PARAM_COVERS 0 CPX_PARAM_ZEROHALFCUTS 0 CPX_PARAM_MIRCUTS 0 CPX_PARAM_MCFCUTS 0 CPX_PARAM_IMPLBD 0 CPX_PARAM_GUBCOVERS 0 CPX_PARAM_AGGCUTLIM 3 Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Solving Segmentation fault (core dumped) A few lines from the log file: Completion Time: 972.63 Num Columns: 1350888 Num Rows: 25488 Tried aggregator 1 time. MIP Presolve eliminated 12648 rows and 1321088 columns. MIP Presolve modified 180 coefficients. Reduced MIP has 12840 rows, 29800 columns, and 136000 nonzeros. Reduced MIP has 29800 binaries, 0 generals, 0 SOSs, and 0 indicators. Presolve time = 0.49 sec. (368.57 ticks) I would be grateful if someone can help me fix this. Install and enable faulthandler https://pypi.python.org/pypi/faulthandler/ to see where Segmentation fault happens -- akira -- https://mail.python.org/mailman/listinfo/python-list
ImportError: No module named _gdb
So I'm trying to implement pretty printing information using gdb-python27 on Windows7 Hopefully, someone experienced the same issue. GDB is working fine, but when I run gdb-python27 I got the following error (related to a python import): C:\MinGW\bingdb-python27.exe Traceback (most recent call last): File string, line 70, in module File string, line 67, in GdbSetPythonDirectory File c:\mingw\share\gdb/python\gdb\__init__.py, line 19, in module import _gdb ImportError: No module named _gdb GNU gdb (GDB) 7.5 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as i686-pc-mingw32. For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/. warning: File C:\MinGW\bin\.gdbinit auto-loading has been declined by your `auto-load safe-path' set to $debugdir:$datadir/auto-load. (gdb) Does anybody have any clue about this issue? Best, Marcelo. PS: I posted same question to MinGW group, but maybe the issue is related to Python. Below, config information: OS Windows 7 C:\MinGW\bincat .gdbinit python import sys sys.path.insert(0, 'c:/gdb-printers/python') from libstdcxx.v6.printers import register_libstdcxx_printers register_libstdcxx_printers (None) end C:\MinGW\includegcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --ena ble-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv -prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T Thread model: win32 gcc version 4.8.1 (GCC) C:\MinGW\includepython Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. w32api.h (version): #define __W32API_VERSION 3.17 #define __W32API_MAJOR_VERSION 3 #define __W32API_MINOR_VERSION 17 _mingw.h (version): #define __MINGW_VERSION 4.0 #define __MINGW_MAJOR_VERSION 4 #define __MINGW_MINOR_VERSION 0 #define __MINGW_PATCHLEVEL 0 /* The following four macros are deprecated and will be removed * in the release greater than 4.1. */ #define __MINGW32_VERSION 3.20 #define __MINGW32_MAJOR_VERSION 3 #define __MINGW32_MINOR_VERSION 20 #define __MINGW32_PATCHLEVEL0 -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.2 has some deadly infection
On 1 June 2014 12:26, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: with cross-platform behavior preferred over system-dependent one -- It's not clear how cross-platform behaviour has anything to do with the Internet age. Python has preferred cross-platform behaviour forever, except for those features and modules which are explicitly intended to be interfaces to system-dependent features. (E.g. a lot of functions in the os module are thin wrappers around OS features. Hence the name of the module.) There is the behaviour of defaulting input and output to the system encoding. I personally think we would all be better off if Python (and Java, and many other languages) defaulted to UTF-8. This hopefully would eventually have the effect of producers changing to output UTF-8 by default, and consumers learning to manually specify an encoding when it's not UTF-8 (due to invalid codepoints). I'm currently working on a product that interacts with lots of other products. These other products can be using any encoding - but most of the functions that interact with I/O assume the system default encoding of the machine that is collecting the data. The product has been in production for nearly a decade, so there's a lot of pushback against changes deep in the code for fear that it will break working systems. The fact that they are working largely by accident appears to escape them ... FWIW, changing to use iso-latin-1 by default would be the most sensible option (effectively treating everything as bytes), with the option for another encoding if/when more information is known (e.g. there's often a call to return the encoding, and the output of that call is guaranteed to be ASCII). Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list
[RELEASE] Python 2.7.7
I'm happy to announce the immediate availability of Python 2.7.7. Python 2.7.7 is a regularly scheduled bugfix release for the Python 2.7 series. This release includes months of accumulated bugfixes. All the changes in Python 2.7.7 are described in detail in the Misc/NEWS file of the source tarball. You can view it online at http://hg.python.org/cpython/raw-file/f89216059edf/Misc/NEWS The 2.7.7 release also contains fixes for two severe, if arcane, potential security vulnerabilities. The first was the possibility of reading arbitrary process memory using JSONDecoder.raw_decode. [1] (No other json APIs are affected.) The second security issue is an integer overflow in the strop module. [2] (You actually have no reason whatsoever to use the strop module.) Another security note for 2.7.7 is that the release includes a backport from Python 3 of hmac.compare_digest. This begins the implementation of PEP 466, Network Security Enhancements for Python 2.7.x. Downloads are at https://python.org/download/releases/2.7.7/ This is a production release. As always, please report bugs to http://bugs.python.org/ Build great things, Benjamin Peterson 2.7 Release Manager (on behalf of all of Python's contributors) [1] http://bugs.python.org/issue21529 [2] http://bugs.python.org/issue21530 -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.2 has some deadly infection
On Mon, 02 Jun 2014 08:54:33 +1000, Tim Delaney wrote: On 1 June 2014 12:26, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: with cross-platform behavior preferred over system-dependent one -- It's not clear how cross-platform behaviour has anything to do with the Internet age. Python has preferred cross-platform behaviour forever, except for those features and modules which are explicitly intended to be interfaces to system-dependent features. (E.g. a lot of functions in the os module are thin wrappers around OS features. Hence the name of the module.) There is the behaviour of defaulting input and output to the system encoding. That's a tricky one, but I think on balance that is a case where defaulting to the system encoding is the right thing to do. Input and out occurs on the local system you are running on, which by definition isn't cross-platform. (Non-local I/O is possible, but requires work -- it doesn't just happen.) I personally think we would all be better off if Python (and Java, and many other languages) defaulted to UTF-8. This hopefully would eventually have the effect of producers changing to output UTF-8 by default, and consumers learning to manually specify an encoding when it's not UTF-8 (due to invalid codepoints). UTF-8 everywhere should be our ultimate aim. Then we can forget about legacy encodings except when digging out ancient documents from archived floppy disks :-) I'm currently working on a product that interacts with lots of other products. These other products can be using any encoding - but most of the functions that interact with I/O assume the system default encoding of the machine that is collecting the data. The product has been in production for nearly a decade, so there's a lot of pushback against changes deep in the code for fear that it will break working systems. The fact that they are working largely by accident appears to escape them ... FWIW, changing to use iso-latin-1 by default would be the most sensible option (effectively treating everything as bytes), with the option for another encoding if/when more information is known (e.g. there's often a call to return the encoding, and the output of that call is guaranteed to be ASCII). Python 2 does what you suggest, and it is *broken*. Python 2.7 creates moji-bake, while Python 3 gets it right: [steve@ando ~]$ python2.7 -c print u'δжç' δжç [steve@ando ~]$ python3.3 -c print(u'δжç') δжç Latin-1 is one of those legacy encodings which needs to die, not to be entrenched as the default. My terminal uses UTF-8 by default (as it should), and if I use the terminal to input δжç, Python ought to see what I input, not Latin-1 moji-bake. If I were to use Windows with a legacy code page, then I couldn't even enter δжç on the command line since none of the legacy encodings support that set of characters at the same time. I don't know exactly what I would get if I tried (say, by copying and pasting text from a Unicode-aware application), but I'd see that it was weird *in the shell* before it even reaches Python. On the other hand, if I were to input something supported by the legacy encoding, let's say I entered αβγ while using ISO-8859-7 (Greek), then Python ought to see αβγ and not moji-bake: py b = αβγ.encode('iso-8859-7') # what the shell generates py b.decode('latin-1') # what Python interprets those bytes as 'áâã' Defaulting to the system encoding means that Python input and output just works, to the degree that input and output on your system just works. If your system is crippled by the use of a legacy encoding, then Python will at least be *no worse* than your system. -- Steven D'Aprano http://import-that.dreamwidth.org/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.2 has some deadly infection
On 2 June 2014 11:14, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 02 Jun 2014 08:54:33 +1000, Tim Delaney wrote: I'm currently working on a product that interacts with lots of other products. These other products can be using any encoding - but most of the functions that interact with I/O assume the system default encoding of the machine that is collecting the data. The product has been in production for nearly a decade, so there's a lot of pushback against changes deep in the code for fear that it will break working systems. The fact that they are working largely by accident appears to escape them ... FWIW, changing to use iso-latin-1 by default would be the most sensible option (effectively treating everything as bytes), with the option for another encoding if/when more information is known (e.g. there's often a call to return the encoding, and the output of that call is guaranteed to be ASCII). Python 2 does what you suggest, and it is *broken*. Python 2.7 creates moji-bake, while Python 3 gets it right: The purpose of my example was to show a case where no thought was put into encodings - the assumption was that the system encoding and the remote system encoding would be the same. This is most definitely not the case a lot of the time. I also should have been more clear that *in the particular situation I was talking about* iso-latin-1 as default would be the right thing to do, not in the general case. Quite often we won't know the correct encoding until we've executed a command via ssh - iso-latin-1 will allow us to extract the info we need (which will generally be 7-bit ASCII) without the possibility of an invalid encoding. Sure we may get mojibake, but that's better than the alternative when we don't yet know the correct encoding. Latin-1 is one of those legacy encodings which needs to die, not to be entrenched as the default. My terminal uses UTF-8 by default (as it should), and if I use the terminal to input δжç, Python ought to see what I input, not Latin-1 moji-bake. For some purposes, there needs to be a way to treat an arbitrary stream of bytes as an arbitrary stream of 8-bit characters. iso-latin-1 is a convenient way to do that. It's not the only way, but settling on it and being consistent is better than not having a way. Tim Delaney -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.2 has some deadly infection
On Monday, June 2, 2014 7:53:05 AM UTC+5:30, Tim Delaney wrote: On 2 June 2014 11:14, Steven D'Aprano steve+comp@pearwood.info wrote: Latin-1 is one of those legacy encodings which needs to die, not to be entrenched as the default. My terminal uses UTF-8 by default (as it should), and if I use the terminal to input δжç, Python ought to see what I input, not Latin-1 moji-bake. For some purposes, there needs to be a way to treat an arbitrary stream of bytes as an arbitrary stream of 8-bit characters. iso-latin-1 is a convenient way to do that. It's not the only way, but settling on it and being consistent is better than not having a way. Here is a quote from the oracle docs: http://docs.oracle.com/cd/E23824_01/html/E26033/glmbx.html#glmar | The C locale, also known as the POSIX locale, is the POSIX system | default locale for all POSIX-compliant systems. In more layman language | ASCII also known as the 'Unix locale' is the default for all *nix | compliant systems which is a key aspect of what Ive called 'The UNIX Assumption' : http://blog.languager.org/2014/04/unicode-and-unix-assumption.html -- https://mail.python.org/mailman/listinfo/python-list
Connect to VectorWise database usin Python
Hi, Using python(2.7.2) I am not able to connect to Vector Wise database. Can you suggest me how I can connect to it. If you don't mind step by step :(. Regards, Sukesh. -- https://mail.python.org/mailman/listinfo/python-list
parsley parsing question
how do you parse multi line text with parsley? here is a work in progress and I'm trying to figure out why I need to split the text and process per line vrs all at one go. thanks for any help. --- eric Here's the whole body of code --- import parsley # # grammar to parse # # useswskeywordargumenteol # templatewstemplate name # returnsws(stdout|file: filename|storage name) # rememberswsstorage name # alt form # templatewstemplate name[:storage name] # test targets def do_uses(a,b): print do_uses %s - %s -% (a,b) def do_returns(a): print do_returns %s% (a) def do_template(a): print do_templates %s% (a) # parsleyfied grammar TF_grammar = r kwToken = (letter|digit|'_')* uses_statement = 'uses' ws kwToken:kwT ':' anything*:roL '\n'{0,1} - do_uses (.join(kwT), .join(roL)) returns_statement = 'returns' ws kwToken:kwT '\n'{0,1} - do_returns(.join(kwT)) template_statement = 'template' ws kwToken:kwT '\n'{0,1} - do_template(.join(kwT)) bow = (uses_statement | returns_statement | template_statement) ws # action_table = { do_uses: do_uses, do_returns: do_returns, do_template: do_template, } # alt path: split lines and parse them one at time def run_bot(body_of_text): break up the body of text for i in body_of_text.split(\n): if len(i) != 0: # why is this test needed? x = parsley.makeGrammar(TF_grammar,action_table) x(i).bow() xxx=uses foo: this is some text returns xyzzy template templatename # multi-line solution x = parsley.makeGrammar(TF_grammar,action_table) x(xxx).bow() test line-at-a-time solution run_bot(xxx) -- bad result (multi-line) is --- $ python parsleytest.py do_uses foo - this is some text returns xyzzy template templatename - good result should be --- $ python parsleytest.py do_uses foo this is some text do_returns xyzzy do_template template templatename -- https://mail.python.org/mailman/listinfo/python-list
[issue21476] Inconsitent behaviour between BytesParser.parse and Parser.parse
Vajrasky Kok added the comment: Ok, here is the updated patch based on R. David Murray's help. Thanks! -- Added file: http://bugs.python.org/file35424/bytes_parser_dont_close_file_v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21476 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21623] build ssl failed use vs2010 express
Changes by Ned Deily n...@acm.org: -- nosy: +steve.dower, zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21623 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18132] buttons in turtledemo disappear on small screens
Terry J. Reedy added the comment: I believe I have read more than one warning to not mix grid and pack in the same master, as your patch does. For example: http://effbot.org/tkinterbook/grid.htm, An option would be to grid everything. I believe grid would also fix issue #21597, so I may try it and see if it fixes both issue without introducing a scrollbar problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18132 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit
Gregory P. Smith added the comment: Here's a patch with a unittest that reproduces the problem with fixes to stop using any end_fds. The max fd is only ever used in the absolute fallback situation where no way to get a list of open fd's is available. In that case it is obtained from sysconf() at the time it is needed rather than module load time as sysconf() is async-signal-safe. I'm not worried about calling close() an additional time on EINTR in the single threaded child process prior to exec(). The most that will happen is one extra call with a different error if the fd is in a bad state from the previous one. That is better than any chance of one being left open. -- stage: - patch review type: security - behavior Added file: http://bugs.python.org/file35425/issue21618-34-gps01.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Stefan Behnel added the comment: I tried the same with a Cython compiled version of select.py in the latest CPython 3.5 build. It pretty clearly shows that select2 is pretty much always faster than sorting, by a factor of 2-5x or so. I'll also attach the annotated source file that Cython generates. *** CPython 3.5 (de01f7c37b53) == Single call mode == Nsort select7 select23 select47 select97 select select2 50000.0000.0010.0010.0010.0010.0010.001 10.0010.0030.0020.0020.0020.0030.002 50.0050.0150.0100.0100.0100.0130.008 100.0120.0320.0230.0230.0230.0270.017 500.0850.1740.1310.1290.1550.1670.103 1000.1900.3750.3000.2720.3110.4560.292 2000.4220.8280.5880.5790.6890.8650.560 3000.6801.1870.9180.9060.9151.4270.801 4000.9481.5741.1801.1461.1771.6591.004 5001.2532.0271.6841.5231.5981.8741.085 6001.5772.4411.8921.7541.7872.6591.055 7001.9342.8702.1282.0622.0933.2891.274 8002.2793.3042.4302.4212.4712.5692.449 9002.5603.7672.8352.7682.7713.0892.348 10002.7904.1233.1533.0443.0974.3663.764 11003.1994.6053.6583.4673.3833.8674.599 Total elapsed time: 9.13 minutes *** Cython / CPython 3.5 == Single call mode == Nsort select7 select23 select47 select97 select select2 50000.0000.0010.0000.0000.0010.0000.000 10.0010.0010.0010.0010.0010.0000.000 50.0060.0060.0050.0050.0060.0010.001 100.0130.0140.0110.0120.0130.0040.004 500.0890.0910.0730.0750.0790.0480.049 1000.2000.1920.1560.1580.1940.0810.073 2000.4510.4170.3240.3550.4040.2100.135 3000.6780.6140.4960.5010.5300.2910.277 4000.9800.8350.7200.6800.7180.4020.441 5001.2761.1970.8460.8570.9050.4910.425 6001.5351.2741.0671.0401.0870.5340.451 7001.8421.5001.2261.2141.2790.5490.507 8002.1681.7261.3841.3981.4910.5570.535 9002.4381.9871.5661.5821.6600.9660.544 10002.7682.1871.7471.7731.9111.1160.640 11003.1162.4171.9221.9502.0631.2831.024 Total elapsed time: 5.48 minutes -- nosy: +scoder Added file: http://bugs.python.org/file35426/select.pxd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Changes by Stefan Behnel sco...@users.sourceforge.net: Added file: http://bugs.python.org/file35427/select.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Stefan Behnel added the comment: Here's also the pathological average of three calls case. As Steven suggests, it shows that select() suffers quite heavily (algorithmically), but select2() also suffers enough to jump up to about 2/3 of the runtime of sorting (so it's still 1/3 faster even here). This sounds like select2 should be much faster on random data (run 1) and about as fast on sorted data (runs 2+3). Not unexpected, given the algorithmical characteristics of Timsort. == Average of three calls mode == Nsort select7 select23 select47 select97 select select2 50000.0000.0020.0010.0010.0020.0010.000 10.0010.0040.0030.0030.0030.0010.001 50.0060.0180.0170.0160.0160.0110.003 100.0130.0370.0290.0310.0370.0160.009 500.0910.2460.2040.2160.2270.2180.057 1000.2050.5350.4430.4340.4590.5300.156 2000.4581.1370.9170.9221.0522.1240.328 3000.7341.7431.4481.5101.6072.8050.500 4001.0102.4001.8882.0292.1573.0390.655 5001.2783.0212.4582.4042.7174.7890.853 6001.5713.6292.8733.0943.2794.1361.030 7001.8844.2583.5203.6213.5307.7881.312 8002.1984.9774.0424.1754.0809.0351.446 9002.5255.5554.5394.7234.633 10.9331.608 10002.8446.3454.9295.0355.588 10.3981.852 11003.1947.0815.8225.9736.1838.2912.111 Total elapsed time: 13.33 minutes -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21605] Add tests for Tkinter images
Roundup Robot added the comment: New changeset fcbb15edb73a by Serhiy Storchaka in branch '2.7': Issue #21605: Added tests for Tkinter images. http://hg.python.org/cpython/rev/fcbb15edb73a New changeset 6c8b2ab55976 by Serhiy Storchaka in branch '3.4': Issue #21605: Added tests for Tkinter images. http://hg.python.org/cpython/rev/6c8b2ab55976 New changeset 13254db884e9 by Serhiy Storchaka in branch 'default': Issue #21605: Added tests for Tkinter images. http://hg.python.org/cpython/rev/13254db884e9 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21605 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21605] Add tests for Tkinter images
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/issue21605 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21459] DragonFlyBSD support
Thomas Klausner added the comment: Actually, there are even less changes needed nowadays. Please apply this really small patch. -- Added file: http://bugs.python.org/file35428/dragonfly.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21459] DragonFlyBSD support
Changes by Thomas Klausner t...@giga.or.at: Removed file: http://bugs.python.org/file35195/dragonfly.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Stefan Behnel added the comment: Updating the type declaration file to remove the dependency on the list builtin and allow arbitrary containers. The test code has this dependency (calls a.sort()), but the current statistics module in the stdlib does not (calls sorted()). Timings do not change, at least not more than you would expect by randomisation (i.e. repeated runs go up and down within the same bounds). Note that the timings are still specific to lists and would be higher for other containers. -- Added file: http://bugs.python.org/file35429/select.pxd ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Changes by Stefan Behnel sco...@users.sourceforge.net: Added file: http://bugs.python.org/file35430/select.html ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21625] help()'s more-mode is frustrating
New submission from Ned Batchelder: From the #python IRC channel: ``` [07:55:29] tonysar hello.new to programming and python, i use mac terminal but problem i have is , when i use help function of python to look up something , i lose my prompt and i have no idea how to go back , what i do is close the terminal and restart , is there any way to go back to prompt again ? [07:57:12] nedbattonysar: type a q [07:57:26] nedbattonysar: it works like the unix-standard more program. [07:58:10] nedbattonysar: looking at it through your eyes, it's crazy-unhelpful that it only accepts a q [07:58:42] tonysar nedbat: thanks but i can not type anything , after using help(object) i get the info on object i look and there is END at the bottom of python terminal and i can not type anything after or before [07:59:03] nedbattonysar: what happens if you type q ? [07:59:24] nedbattonysar: just the single letter q [07:59:41] tonysar nedbat . thanks [07:59:47] tonysar the q worked [08:01:08] tonysar nedbat:Thanks. typing q got me back to prompt again . thanks again ``` Why does help() enter a more-mode for even short help? Why doesn't ENTER get you out of it? Why doesn't the prompt have a suggestion of how to get out of it? Why does it clear the screen when you are done with it, removing all the help from the screen? It seems very geeky, and not that help-ful. I'm sure there's something we can do to make this a little easier for newbs. -- messages: 219497 nosy: nedbat priority: normal severity: normal status: open title: help()'s more-mode is frustrating versions: Python 2.7, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21625 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21592] Make statistics.median run in linear time
Julian Taylor added the comment: in the case of the median you can archive similar performance to a multiselect by simply calling min([len(data) // 2 + 1]) for the second order statistic which you need for the averaging of even number of elements. maybe an interesting datapoint would be to compare with numpys selection algorithm which is a intromultiselect (implemented in C for native datattypes). It uses a standard median of 3 quickselect with a cutoff in recursion depth to median of median of group of 5. the multiselect is implemented using a sorted list of kth order statistics and reducing the search space for each kth by maintaining a stack of all visited pivots. E.g. if you search for 30 and 100, when during the search for 30 one has visited pivot 70 and 110, the search for 100 only needs to select in l[70:110]. The not particularly readable implementation is in: ./numpy/core/src/npysort/selection.c.src unfortunately for object types it currently falls back to quicksort so you can't directly compare performance with the pure python variants. -- nosy: +jtaylor ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21592 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded
Changes by Serhiy Storchaka storch...@gmail.com: Removed file: http://bugs.python.org/file35402/tkinter_bytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21580 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file35431/tkinter_bytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21580 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21580] PhotoImage(data=...) apparently has to be UTF-8 or Base-64 encoded
Serhiy Storchaka added the comment: Unfortunately we can't use this straightforward and universal solution in Python 2. Here is a patch which adds special workarounds to fix this issue in 2.7. -- Added file: http://bugs.python.org/file35432/tkinter_bytes-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21580 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21459] DragonFlyBSD support
Thomas Klausner added the comment: Semaphore handling needs another change. if sem_open etc. are not provided by the operating system, do not export them (Modules/_multiprocessing/multiprocessing.c). Updated diff attached. That part of the diff might affect more operating systems. -- Added file: http://bugs.python.org/file35433/dragonfly.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21459] DragonFlyBSD support
Changes by Thomas Klausner t...@giga.or.at: Removed file: http://bugs.python.org/file35428/dragonfly.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21459 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21552] String length overflow in Tkinter
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/issue21552 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21626] Add options width and compact to pickle cli
New submission from B. Clausius: The attached patch add this options to python3 -m pickle cli: -w WIDTH, --width WIDTH maximum number of characters per line -c, --compact display as many items as will fit on each output line The options are forwarded as kwargs to pprint.pprint -- components: Library (Lib) files: pickle_cli-options_width_and_compact.patch keywords: patch messages: 219501 nosy: barcc priority: normal severity: normal status: open title: Add options width and compact to pickle cli type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file35434/pickle_cli-options_width_and_compact.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21626 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21626] Add options width and compact to pickle cli
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +alexandre.vassalotti, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21626 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Saimadhav Heblikar added the comment: This patch tries to enable mock_Tk.Text._decode to handle the following patterns insert linestart insert lineend insert wordstart insert wordend insert +x chars insert -x chars These additions are required for testing AutoExpand and are written keeping the same in mind. Also, adds respective tests for test_decode in test_text.py. I would like to know if my approach is acceptable or whether it needs changes. issue18292 is about adding unittests for AutoExpand. (A 2.7 patch will be submitted once the above changes become acceptable) -- nosy: +jesstess, sahutd Added file: http://bugs.python.org/file35435/mock-text-_decode.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18504 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21623] build ssl failed use vs2010 express
Mo Jia added the comment: Another error is . cd D:\Hg\Python\Python\PCbuild\ D:\Hg\Python\Python\PCbuild\python_d.exe build_ssl.py Release Win32 -a Found a working perl at 'C:\Perl\bin\perl.exe' Traceback (most recent call last): File build_ssl.py, line 253, in module main() File build_ssl.py, line 181, in main ssl_dir = get_ssl_dir() File build_ssl.py, line 70, in get_ssl_dir m = re.search('openssl-([^]+)', f.read()) UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command cd D:\Hg\Python\Python\PCbuild\ [D:\Hg\Python\Python\PCbuild\ssl. vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: D:\Hg\Python\Python\PCbuild\python_d.exe build_ssl.py Release Win32 -a [D:\Hg\ Python\Python\PCbuild\ssl.vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: exited with code 1. [D:\Hg\Python\Python\PCbuild\ssl.vcxproj] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21623 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
Saimadhav Heblikar added the comment: Attached patch adds unittest for idlelib`s AutoExpand. Depends on issue18504 for Text's mocking abilities. -- keywords: +patch nosy: +jesstess, sahutd Added file: http://bugs.python.org/file35436/test-autoexpand.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18292 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons
Serhiy Storchaka added the comment: I think that even if we accept this change (I am unsure in this), a warning should be raised only when bytes and unicode objects are equal. When they are not equal, a warning should not be raised, because this matches Python 3 behavior. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21401 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1669539] Improve Windows os.path.join (ntpath.join) smart joining
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1669539 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21231] Issue a python 3 warning when old style classes are defined.
Changes by Serhiy Storchaka storch...@gmail.com: -- status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18492] Allow all resources if not running under regrtest.py
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18492 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19656] Add Py3k warning for non-ascii bytes literals
Serhiy Storchaka added the comment: Benjamin, what you think about this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19656 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: patch review - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20361 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20168] Derby: Convert the _tkinter module to use Argument Clinic
Serhiy Storchaka added the comment: Synchronized with tip. -- Added file: http://bugs.python.org/file35437/tkinter_clinic_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20168 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20148] Derby: Convert the _sre module to use Argument Clinic
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file35438/sre_clinic_3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20148 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14019] Unify tests for str.format and string.Formatter
moijes12 added the comment: Note that this issue wasn't about the formatter module - it relates to the str.format() method and the string.Formatter *class*. I would tend to agree with Nick and Eric. From what I see in the patch, the tests are for formatter module and not the string.Formatter class. -- nosy: +moijes12 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14019 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit
Steven Stewart-Gallus added the comment: Thank you for the very quick patch Gregory P. Smith. It's fair enough if you don't bother to fix the EINTR issue. One small note: +Confirm that issue21618 is fixed (mail fail under valgrind). That's a typo right? Shouldn't it be may instead of mail? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21627] Concurrently closing files and iterating over the open files directory is not well specified
New submission from Steven Stewart-Gallus: Hello, I noticed some possible bad behaviour while working on Python issue 21618 (see http://bugs.python.org/issue21618). Python has the following code in _posixsubmodules.c for closing extra files before spawning a process: static void _close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep) { int fd_dir_fd; if (start_fd = end_fd) return; fd_dir_fd = _Py_open(FD_DIR, O_RDONLY); if (fd_dir_fd == -1) { /* No way to get a list of open fds. */ _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep); return; } else { char buffer[sizeof(struct linux_dirent64)]; int bytes; while ((bytes = syscall(SYS_getdents64, fd_dir_fd, (struct linux_dirent64 *)buffer, sizeof(buffer))) 0) { struct linux_dirent64 *entry; int offset; for (offset = 0; offset bytes; offset += entry-d_reclen) { int fd; entry = (struct linux_dirent64 *)(buffer + offset); if ((fd = _pos_int_from_ascii(entry-d_name)) 0) continue; /* Not a number. */ if (fd != fd_dir_fd fd = start_fd fd end_fd !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) { while (close(fd) 0 errno == EINTR); } } } close(fd_dir_fd); } } In the code FD_DIR is /proc/self/fd on Linux. I'm not sure this code is correct. This seems as if it would have the same problems as iterating over a list and modifying it at the same time. I can think of a few solutions but they all have problems. One could allocate a list of open files once and then iterate through that list and close the files but this is not signal safe so this solution is incorrect. One possible workaround is to use mmap to allocate the memory. This is a direct system call and I don't see a reason for it not to be signal safe but I'm not sure. One neat hack would be too mmap the memory ahead of time and then rely on lazy paging to allocate the memory lazily. Another solution is to search for the largest open file and then iterate over and close all the possible file descriptors in between. So far most possible solutions just seem really hacky to me though. I feel the best solution is to let the OS close the files and to set the O_CLOEXEC flag on the files that need to be closed. -- messages: 219510 nosy: sstewartgallus priority: normal severity: normal status: open title: Concurrently closing files and iterating over the open files directory is not well specified ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21627 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21628] 2to3 does not fix zip in some cases
New submission from RobertG: Consider this program def foo(a,b): return min(zip(a,b)[2]) print foo(range(5), (0,9,-9)) With the default options, 2to3 rewrites this as def foo(a,b): return min(zip(a,b)[2]) print(foo(list(range(5)), (0,9,-9))) For some reason, 2to3 fails to wrap the call to zip in a list, even though the 2to3 documentation says that there is a fixer which does this. Obviously, the generated code will not work in Python 3 since you can't subscript an iterator. -- components: 2to3 (2.x to 3.x conversion tool) messages: 219511 nosy: RobertG priority: normal severity: normal status: open title: 2to3 does not fix zip in some cases versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21628 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21629] clinic.py --converters fails
New submission from Serhiy Storchaka: $ ./python Tools/clinic/clinic.py --converters Legacy converters: Traceback (most recent call last): File Tools/clinic/clinic.py, line 4199, in module sys.exit(main(sys.argv[1:])) File Tools/clinic/clinic.py, line 4131, in main print('' + ' '.join(c for c in legacy if c[0].isupper())) File Tools/clinic/clinic.py, line 4131, in genexpr print('' + ' '.join(c for c in legacy if c[0].isupper())) IndexError: string index out of range As I see, the problem is in the self converter which has empty format_unit. -- components: Demos and Tools messages: 219512 nosy: larry, serhiy.storchaka priority: normal severity: normal status: open title: clinic.py --converters fails type: behavior versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21629 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21630] List Dict bug?
New submission from Robert w: outer for loop loops n 1 times, when it should loop one time. Variations are possible tht the bug doesn't occur. -- components: Interpreter Core files: bug.py messages: 219513 nosy: Robert.w priority: normal severity: normal status: open title: List Dict bug? type: behavior versions: Python 2.7, Python 3.3 Added file: http://bugs.python.org/file35439/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21630] List Dict bug?
Changes by Robert w robert...@googlemail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21631] List/Dict Combination Bug
New submission from Robert w: outer for loop loops more than one time, which should be impossible. -- components: Interpreter Core files: bug.py messages: 219514 nosy: Robert.w priority: normal severity: normal status: open title: List/Dict Combination Bug type: behavior versions: Python 2.7, Python 3.3 Added file: http://bugs.python.org/file35440/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21631 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21631] List/Dict Combination Bug
SilentGhost added the comment: Robert, could you please post a reduced code that generates the bug. Preferably, a interpreter output. Including information about your python version, OS, etc. For example: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type help, copyright, credits or license for more information. elements = [{'type': 2, 'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}}] for i in elements: ... print(i) ... {'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', '11H']}, 'type': 2} As you see from my example, I wasn't able to reproduce the issue you're reporting. -- nosy: +SilentGhost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21631 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21625] help()'s more-mode is frustrating
eryksun added the comment: Why does help() enter a more-mode for even short help? `more` exits if there's less than a page of a text. The default for `less` is to quit when q is entered. You may be interested in the option -e (quit-at-eof). Why doesn't ENTER get you out of it? ENTER scrolls. Type a number N to scroll by N lines. Why does it clear the screen when you are done with it, removing all the help from the screen? The option -X (no-init) should stop `less` from clearing the screen. Why doesn't the prompt have a suggestion of how to get out of it? I guess no one thought to add that when `less` is used. You can customize the pager using the PAGER environment variable, as used by other commands such as `man`. $ PAGER='less -eX' python3 -c 'help(help)' Help on _Helper in module site object: class _Helper(builtins.object) [...] You can also set pydoc.pager directly, which is what IDLE does: pydoc.pager = pydoc.plainpager help(help) Help on _Helper in module site object: [...] plainpager is the default if the TERM environment variable is dumb or emacs, or if sys.stdout isn't a tty. Otheriwse if the system has neither `less` nor `more`, the pager is set to pydoc.ttypager. On Windows, text is written to a temp file using tempfilepager. Other platforms pipe the text using pipepager. This should also work for Windows in Python 3, which implements os.popen with subprocess.Popen. Here's a test using GnuWin32 head.exe and tr.exe: cmd = 'head -n3 | tr [:lower:] [:upper:]' pydoc.pager = lambda t: pydoc.pipepager(t, cmd) help(help) HELP ON _HELPER IN MODULE _SITEBUILTINS OBJECT: CLASS _HELPER(BUILTINS.OBJECT) -- nosy: +eryksun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21625 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21628] 2to3 does not fix zip in some cases
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21628 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21630] List Dict bug?
R. David Murray added the comment: If I put a 'print(one iteration) at the top of the loop, that string is printed exactly once. I presume you realized that and that is why you closed this? -- nosy: +r.david.murray resolution: - not a bug ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21631] List/Dict Combination Bug
R. David Murray added the comment: Oh, this is the same code as in issue 21630 that you closed. Since the loop is only executed once (as confirmed by adding a print), I suspect you have a bug in your expectations of the output :) -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21631 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19656] Add Py3k warning for non-ascii bytes literals
Roundup Robot added the comment: New changeset 6bd21268876e by Serhiy Storchaka in branch '2.7': Issue #19656: Running Python with the -3 option now also warns about http://hg.python.org/cpython/rev/6bd21268876e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19656 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19656] Add Py3k warning for non-ascii bytes literals
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19656 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21625] help()'s more-mode is frustrating
Ned Batchelder added the comment: Thanks, this is a very complete explanation of the machinery behind the scenes. I think we would do beginners a service if we made the behavior a bit less obscure. Are there ways that we could (for example) have the prompt say END (q to quit) instead of just END? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21625 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21632] Idle: sychronize text files across versions as appropriate.
New submission from Terry J. Reedy: Spinoff of #7136: In pushing the patch for that issue, I discovered that formatting changes for help.txt (and maybe /Doc/library/idle.rst) had been applied unevenly. See msg192141, which suggests this issue. 3.3 versus 3.4 differences are moot, so this now means 2.7 versus 3.4+. -- assignee: terry.reedy messages: 219521 nosy: terry.reedy priority: normal severity: normal stage: needs patch status: open title: Idle: sychronize text files across versions as appropriate. type: behavior versions: Python 2.7, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21632 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20886] Disabling logging to ~/.python_history is not simple enough
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20886 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10652] test___all_ + test_tcl fails (Windows installed binary)
Terry J. Reedy added the comment: Zach, do you have any further thoughts in light of patches pushed since? What do you think is the exact remaining issue? -- assignee: terry.reedy - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10652 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21468] NNTPLib connections become corrupt after long periods of activity
Changes by Jakub Wilk jw...@jwilk.net: -- nosy: +jwilk ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21468 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit
Roundup Robot added the comment: New changeset 5453b9c59cd7 by Gregory P. Smith in branch '3.4': Don't restrict ourselves to a max fd when closing fds before exec() http://hg.python.org/cpython/rev/5453b9c59cd7 New changeset 012329c8c4ec by Gregory P. Smith in branch 'default': Don't restrict ourselves to a max fd when closing fds before exec() http://hg.python.org/cpython/rev/012329c8c4ec -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21573] Clean up turtle.py code formatting
Raymond Hettinger added the comment: I would like to provide a final review before of any proposed changes. Also, along the way, I would happy to provide suggestions for more substantive changes (instead of shallow PEP 8 or PyLint changes). The primary defect in the modules is that the code got adultified somewhere along the way and needs to migrate back to the sort of straight-forward code that kids can read and model their code after. I've use this code to help train adults to teach kids and found that it needs to use a simpler feature set. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21573 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21618] POpen does not close fds when fds have been inherited from a process with a higher resource limit
Gregory P. Smith added the comment: Backported to subprocess32 in https://code.google.com/p/python-subprocess32/source/detail?r=1c27bfe7e98f78e6aaa746b5c0a4d902a956e2a5 -- resolution: - fixed stage: patch review - commit review status: open - closed versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21618 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20640] Idle: test configHelpSourceEdit
Terry J. Reedy added the comment: Please redo 3.3 patch for current 3.4 (after htest change). -- title: Adds idle test for configHelpSourceEdit - Idle: test configHelpSourceEdit versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20640 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18410] Idle: test SearchDialog.py
Terry J. Reedy added the comment: #18592 has a patch for SearchDialogBase. -- title: IDLE Improvements: Unit test for SearchDialog.py - Idle: test SearchDialog.py versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18410 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20567] test_idle causes test_ttk_guionly 'can't invoke event command: application has been destroyed' messages from Tk
Terry J. Reedy added the comment: Probably still need to add note to idle_test/README.txt. -- stage: commit review - needs patch versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20567 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20800] Cannot run gui tests twice.
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 3.5 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20800] Cannot run gui tests twice.
Ned Deily added the comment: For what it's worth, I don't see the problem on OS X (haven't tried it recently on a Linux system), so it might be a Windows only issue. It's become clearer that some test combinations can only be safely run with the regrtest -j option to run them as separate subprocesses. I Does -m test -j2 -ugui test_ttk_guionly test_ttk_guionly help? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20800 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com