Logging all uncaught exceptions

2014-07-14 Thread Steven D'Aprano
I want to catch all uncaught exceptions in my application, log them, then handle as normal. Which, in practice, means a traceback. Is this the right way to do it? import logging import sys logger = logging.getLogger('mylogger') def my_handler(type, value, tb): msg = Uncaught %s: %s %

Re: Logging all uncaught exceptions

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 06:09:32 +, Steven D'Aprano wrote: I want to catch all uncaught exceptions in my application, log them, then handle as normal. Which, in practice, means a traceback. Is this the right way to do it? I think I've answered my own question, which leads to the next

Re: Logging all uncaught exceptions

2014-07-14 Thread Chris Angelico
On Mon, Jul 14, 2014 at 7:07 PM, Steven D'Aprano st...@pearwood.info wrote: but the exception info which should have been generated by mylogger.exception doesn't appear anywhere I can see. What am I doing wrong? I'm not specifically familiar with the logging module, but something I'd look at

Re: Logging all uncaught exceptions

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 19:21:44 +1000, Chris Angelico wrote: On Mon, Jul 14, 2014 at 7:07 PM, Steven D'Aprano st...@pearwood.info wrote: but the exception info which should have been generated by mylogger.exception doesn't appear anywhere I can see. What am I doing wrong? I'm not

Re: Multiprocessing question

2014-07-14 Thread Roy Smith
In article 53c34400$0$9505$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 13 Jul 2014 19:53:09 -0400, Paul LaFollette wrote: I have thrown together a little C/UNIX program that forks a child process, then proceeds to let the child

Do I need to call close on the handle returned by urlopen?

2014-07-14 Thread krzysztof.zelechowski
The tutorial says that I should use with open to close the file handle properly. The reference documentation for urlopen mentions that the handle returned is like a file handle but the code samples below do not bother to close the handle at all. Isn’t it inconsistent? --

Re: Do I need to call close on the handle returned by urlopen?

2014-07-14 Thread Skip Montanaro
The tutorial says that I should use with open to close the file handle properly. The reference documentation for urlopen mentions that the handle returned is like a file handle but the code samples below do not bother to close the handle at all. Isn’t it inconsistent? I think two things

Re: Do I need to call close on the handle returned by urlopen?

2014-07-14 Thread krzysztof.zelechowski
http://bugs.python.org/issue12955 Użytkownik napisał w wiadomości grup dyskusyjnych:lq0sar$r6e$1...@mx1.internetia.pl... The tutorial says that I should use with open to close the file handle properly. The reference documentation for urlopen mentions that the handle returned is like a file

python-aware wdiff?

2014-07-14 Thread Roy Smith
Does anybody know of a wdiff-like tool (http://www.gnu.org/software/wdiff/) which is aware of python syntax and can show token changes instead of word changes. Wdiff is can turn -if not metar.is_in_temp_range_f(situation.weather.low_temperature, situation.weather.high_temperature): +

Re: Do I need to call close on the handle returned by urlopen?

2014-07-14 Thread Mark Lawrence
On 14/07/2014 15:59, krzysztof.zelechow...@syncron.com wrote: The tutorial says that I should use with open to close the file handle properly. The reference documentation for urlopen mentions that the handle returned is like a file handle but the code samples below do not bother to close the

Not enough memory.

2014-07-14 Thread 水静流深
import os help(os.path) Not enough memory.‍ Why i get it?Not enough memory , not help info?,not-- https://mail.python.org/mailman/listinfo/python-list

Re: Not enough memory.

2014-07-14 Thread Mark Lawrence
On 14/07/2014 14:16, 水静流深 wrote: import os help(os.path) Not enough memory.‍ Why i get it?Not enough memory , not help info?,not A known problem see http://bugs.python.org/issue19914 -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: Not enough memory.

2014-07-14 Thread Zachary Ware
On Mon, Jul 14, 2014 at 8:16 AM, 水静流深 1248283...@qq.com wrote: import os help(os.path) Not enough memory.‍ Why i get it?Not enough memory , not help info?,not In future, it's very helpful to tell us what OS is running which version of Python when you get an error, but in this case I'm

Re: NaN comparisons - Call For Anecdotes

2014-07-14 Thread Anders J. Munch
alister wrote: I don't have time to start this discussion over again on another mailing list. Don't anyone on those lists read python-list also? they possibly do, but prefer to keep discussions to the proper forum The semantics of the Python programming language is on-topic for python-list.

Re: Not enough memory.

2014-07-14 Thread Mark Lawrence
On 14/07/2014 17:40, Zachary Ware wrote: On Mon, Jul 14, 2014 at 8:16 AM, 水静流深 1248283...@qq.com wrote: import os help(os.path) Not enough memory.‍ Why i get it?Not enough memory , not help info?,not In future, it's very helpful to tell us what OS is running which version of Python when you

Re: NaN comparisons - Call For Anecdotes

2014-07-14 Thread Mark Lawrence
On 14/07/2014 17:44, Anders J. Munch wrote: alister wrote: I don't have time to start this discussion over again on another mailing list. Don't anyone on those lists read python-list also? they possibly do, but prefer to keep discussions to the proper forum The semantics of the Python

Re: NaN comparisons - Call For Anecdotes

2014-07-14 Thread Ian Kelly
On Mon, Jul 14, 2014 at 10:44 AM, Anders J. Munch 2...@jmunch.dk wrote: alister wrote: I don't have time to start this discussion over again on another mailing list. Don't anyone on those lists read python-list also? they possibly do, but prefer to keep discussions to the proper forum

Re: python-aware wdiff?

2014-07-14 Thread Terry Reedy
On 7/14/2014 11:12 AM, Roy Smith wrote: Does anybody know of a wdiff-like tool (http://www.gnu.org/software/wdiff/) which is aware of python syntax and can show token changes instead of word changes. Wdiff is can turn -if not metar.is

Re: Twitter Client on Terminal by Python

2014-07-14 Thread Terry Reedy
On 7/13/2014 11:51 PM, Chris Angelico wrote: On Mon, Jul 14, 2014 at 12:18 PM, Orakaro nhatminh...@gmail.com wrote: I use README.md for Github and README.rst for PyPi. Is there a way to use only one file for both sites ? Ah. I don't know; check the docs for one or the other and see what

Re: python-aware wdiff?

2014-07-14 Thread Ian Kelly
On Mon, Jul 14, 2014 at 2:01 PM, Terry Reedy tjre...@udel.edu wrote: The under-known difflib.differ shows within line differences. Your example would look like: -if not metar.is_in_temp_range_f(...): ? ^ +if not info.is_in_temp_range_f ? Deletions and

Re: Python 3 is killing Python

2014-07-14 Thread Rick Johnson
On Wednesday, May 28, 2014 3:15:45 PM UTC-5, Chris Angelico wrote: On Thu, May 29, 2014 at 5:58 AM, Larry Martell wrote: 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. And that's not a problem.

Re: Python 3 is killing Python

2014-07-14 Thread Rick Johnson
On Wednesday, May 28, 2014 7:41:53 PM UTC-5, Terry Reedy wrote: Claim: Python 3 languishes in disuse. Fact: in 2013, there were around 14 million downloads of windows installers for each of 2.7.x and 3.3.x. 3.3 is over twice as popular as 3.2 (to be expected). Terry, you cannot simply take

Re: Python 3 is killing Python

2014-07-14 Thread mm0fmf
On 14/07/2014 23:12, Rick Johnson wrote: I SHUTTER TO THINK! It's I shudder to think! shut·ter [shuht-er] noun 1. a solid or louvered movable cover for a window. 2. a movable cover, slide, etc., for an opening. 3. a person or thing that shuts. 4. Photography . a mechanical device for

Re: Python 3 is killing Python

2014-07-14 Thread MRAB
On 2014-07-14 23:12, Rick Johnson wrote: On Wednesday, May 28, 2014 3:15:45 PM UTC-5, Chris Angelico wrote: On Thu, May 29, 2014 at 5:58 AM, Larry Martell wrote: 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

initializing parameters class in Python only once?

2014-07-14 Thread Catherine M Moroney
Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of parameters (whose values are static) that I want to make available to the rest of the code with

initializing parameters class in Python only once?

2014-07-14 Thread Catherine M Moroney
Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of parameters (whose values are static) that I want to make available to the rest of the code with

Re: initializing parameters class in Python only once?

2014-07-14 Thread Rob Gaddi
On Mon, 14 Jul 2014 15:24:26 -0700 Catherine M Moroney catherine.m.moro...@jpl.nasa.gov wrote: Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of

Re: initializing parameters class in Python only once?

2014-07-14 Thread Chris Kaynor
On Mon, Jul 14, 2014 at 3:24 PM, Catherine M Moroney catherine.m.moro...@jpl.nasa.gov wrote: Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of

Re: Python 3 is killing Python

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 8:12 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: If the powers that be cannot handle the heat, then they should withdraw Python from the public and then they can decree any ridiculous fascist rules they please, until then, what's that old adage about reaping

Re: initializing parameters class in Python only once?

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 8:32 AM, Catherine M Moroney catherine.m.moro...@jpl.nasa.gov wrote: The actual scope of the problem is very small, so memory/cpu time is not an issue. I'm just looking for the most pythonic/elegant way of doing this. Small job? Use the simplest possible technique. Just

Re: Python 3 is killing Python

2014-07-14 Thread Mark Lawrence
On 15/07/2014 00:28, Chris Angelico wrote: On Tue, Jul 15, 2014 at 8:12 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: Image, for a moment, a world WITHOUT the great USA! Imagine. If you were worth the effort, I could easily image a world without the USA, by Photoshopping something out

Re: initializing parameters class in Python only once?

2014-07-14 Thread Ben Finney
Catherine M Moroney catherine.m.moro...@jpl.nasa.gov writes: The problem: I'm writing a large Python program and I have a bunch of parameters (whose values are static) that I want to make available to the rest of the code with minimum overhead and duplicate processing. Better than putting

Re: initializing parameters class in Python only once?

2014-07-14 Thread Mark Lawrence
On 14/07/2014 23:32, Catherine M Moroney wrote: Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of parameters (whose values are static) that I want to

Iterating through set

2014-07-14 Thread LJ
Hi All. I'm coding a Dynamic Programming algorithm to solve a network flow problem. At some point in the algorithm I have to iterate through a set of nodes, while adding and/or removing elements, until the set is empty. I know a regular set() object does not work in a case like this, so I

Re: Iterating through set

2014-07-14 Thread Roy Smith
In article d70b2c77-d3d5-42f8-9c8e-d25ef78b3...@googlegroups.com, LJ luisjoseno...@gmail.com wrote: Hi All. I'm coding a Dynamic Programming algorithm to solve a network flow problem. At some point in the algorithm I have to iterate through a set of nodes, while adding and/or removing

Re: Python 3 is killing Python

2014-07-14 Thread Rick Johnson
On Monday, July 14, 2014 5:47:14 PM UTC-5, MRAB wrote: Why it should they withdraw it (whatever that means)? They are entitled to keep it public if they want to. I'm not suggesting they *must* withdraw Python, I'm only suggesting that IF they wish to *prevent* dissent or scrutiny, then the only

Re: Iterating through set

2014-07-14 Thread Chris Kaynor
On Mon, Jul 14, 2014 at 5:10 PM, LJ luisjoseno...@gmail.com wrote: Hi All. I'm coding a Dynamic Programming algorithm to solve a network flow problem. At some point in the algorithm I have to iterate through a set of nodes, while adding and/or removing elements, until the set is empty. I

Re: Python 3 is killing Python

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 11:00 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Monday, July 14, 2014 5:47:14 PM UTC-5, MRAB wrote: Why it should they withdraw it (whatever that means)? They are entitled to keep it public if they want to. I'm not suggesting they *must* withdraw Python,

Re: Python 3 is killing Python

2014-07-14 Thread Rick Johnson
On Monday, July 14, 2014 6:28:19 PM UTC-5, Chris Angelico wrote: And I know what would happen if the USA weren't here. People in other countries would have made similar improvements to the world. Yes, i wholeheartedly agree with that statement. Is the USA the *ONLY* country to have ever

Re: Python 3 is killing Python

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 11:54 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: But, if the USA *DID NOT* exist during the perilous times of the world wars, how many generations of people would have suffered before a powerful enough contender came along to unclench the grips of evil?

Re: [Python Brasil 10] Registrations are now open!

2014-07-14 Thread Renato Oliveira
Hi all, The call for papers are now open! http://2014.pythonbrasil.org.br/dashboard/proposals/ We're going to hava an English Track, so feel free to submit your proposals! See you at Python Brasil 10! Renato Oliveira @_renatooliveira http://twitter.com/_renatooliveira Labcodes -

Re: [Python Brasil 10] Registrations are now open!

2014-07-14 Thread Renato Oliveira
have* Renato Oliveira @_renatooliveira http://twitter.com/_renatooliveira Labcodes - www.labcodes.com.br On Mon, Jul 14, 2014 at 11:53 PM, Renato Oliveira renatooliveira@gmail.com wrote: Hi all, The call for papers are now open! http://2014.pythonbrasil.org.br/dashboard/proposals/

Re: [Python-Dev] Python Job Board

2014-07-14 Thread Ethan Furman
On 07/14/2014 06:01 PM, Wes Turner wrote: From http://www.reddit.com/r/Python/comments/17c69p/i_was_told_by_a_friend_that_learning_python_for/c84bswd : * http://www.python.org/community/jobs/ * https://jobs.github.com/positions?description=python *

Re:initializing parameters class in Python only once?

2014-07-14 Thread Dave Angel
Catherine M Moroney catherine.m.moro...@jpl.nasa.gov Wrote in message: Hello, Pardon me for not using the proper Python language terms, but I hope that people can still understand the question: The problem: I'm writing a large Python program and I have a bunch of parameters (whose

Re: Python 3 is killing Python

2014-07-14 Thread Michael Torrie
On 06/03/2014 12:12 AM, wxjmfa...@gmail.com wrote: I was myself really suprised to fall on such a case and after thinking no, such cases may logically happen. Putting in this comment not for JMF but for poor souls who find this thread on a search and are led astray by jmf's trolling. Either it

Re: Python 3 is killing Python

2014-07-14 Thread Michael Torrie
On 05/31/2014 09:48 AM, jmf wrote: falsehoods about python and unicode Absolutely FALSE. Python 3.3 and up can handle any and all unicode characters you want to throw at it, without surprises such as what you get in javascript. Python 3 uses UTF-4 encoding under the hood, with a compression

Re: Python 3 is killing Python

2014-07-14 Thread Rick Johnson
On Monday, July 14, 2014 9:11:47 PM UTC-5, Chris Angelico wrote: I dunno. It's not like Great Britain, Australia, or New Zealand did anything significant in either war, is it. Most of Europe occupied, London bombed into the stone age; things were looking grim Chris! Maybe you should read up on

Re: Python 3 is killing Python

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 1:47 PM, Michael Torrie torr...@gmail.com wrote: Python 3 uses UTF-4 encoding under the hood, with a compression optimization that removes leading zeros from binary representation of each character. Sorry to nitpick, but in the interests of terminological accuracy I

Re: Python 3 is killing Python

2014-07-14 Thread Chris Angelico
On Tue, Jul 15, 2014 at 2:18 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Monday, July 14, 2014 9:11:47 PM UTC-5, Chris Angelico wrote: I dunno. It's not like Great Britain, Australia, or New Zealand did anything significant in either war, is it. Most of Europe occupied, London

Re: Python 3 is killing Python

2014-07-14 Thread Martin S
Yes, we all know that Abu Ghraib, Guantanamo, school shootings and the lack of proper health care for all are the pinnacle of US culture. Or figments of the imagination of Baghdad Bob. Now, maybe return to Python? /martin On 15 Jul 2014, Rick Johnson rantingrickjohn...@gmail.com wrote: On

Re: NaN comparisons - Call For Anecdotes

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 18:44:15 +0200, Anders J. Munch wrote: alister wrote: I don't have time to start this discussion over again on another mailing list. Don't anyone on those lists read python-list also? they possibly do, but prefer to keep discussions to the proper forum The semantics

Re: initializing parameters class in Python only once?

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 15:24:26 -0700, Catherine M Moroney wrote: The problem: I'm writing a large Python program and I have a bunch of parameters (whose values are static) that I want to make available to the rest of the code with minimum overhead and duplicate processing. I think that the

Re: Python 3 is killing Python

2014-07-14 Thread Steven D'Aprano
On Mon, 14 Jul 2014 21:18:05 -0700, Rick Johnson wrote: London bombed into the stone age Sigh. How can one even begin to answer a statement of such ignorance? For what little it is worth, if any one country won World War Two, it was the USSR. I don't recall the exact numbers off the top of

[issue17506] Improve IDLE news handling

2014-07-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset aa059a8fb55a by Terry Jan Reedy in branch '2.7': Issue #17506: Synchronize Misc/NEWS and idlelib/NEWS.txt for 2.7. http://hg.python.org/cpython/rev/aa059a8fb55a -- nosy: +python-dev ___ Python tracker

[issue17506] Improve IDLE news handling

2014-07-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: The items in Misc/NEWS and idlelib/NEWS.text were mostly disjoint. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17506 ___

[issue21976] Fix test_ssl.py to handle LibreSSL versioning appropriately

2014-07-14 Thread William Orr
New submission from William Orr: Currently, test_ssl.py requires the version information to match the OpenSSL format exactly, and to be less than 2.0. LibreSSL, a drop-in replacement for OpenSSL, has started its version numbers at 2.0.0, and reports it slightly differently. This patch

[issue16786] argparse doesn't offer localization interface for version action

2014-07-14 Thread paul j3
paul j3 added the comment: In this patch I added the '_()' localization to the '_VersionAction' default 'help'. While this is a straight forward change, I haven't tested it. It does run test_argparse.py, but that doesn't have any tests for localization. According to the discussion here:

[issue20010] time.strftime('%z') didn't make +HHMM return in windows xp

2014-07-14 Thread Alexandr Nevskiy
Alexandr Nevskiy added the comment: The same odd behavior for Windows 7 C:\Python34\python.exe Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import time time.strftime('%z',

[issue21922] PyLong: use GMP

2014-07-14 Thread Case Van Horsen
Case Van Horsen added the comment: I've successfully tested the patch. The patch works fine but there are a couple of issues: 1) The patch relies on several new low-level functions that were introduced in the latest release of GMP 6.0.0. Most Linux distributions are still providing older

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread py.user
New submission from py.user: https://docs.python.org/3/library/re.html#writing-a-tokenizer There are redundant escapes in the regex: ('OP', r'[+*\/\-]'),# Arithmetic operators Sequence -+*/ is sufficient. It makes the loop to do all steps on every 4 spaces: ('SKIP',r'[ \t]'),

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Claudiu Popa
Claudiu Popa added the comment: Hi, thanks for the report. Here's a patch which implements __setstate__ and __getstate__ for Row objects. -- keywords: +patch nosy: +Claudiu.Popa, ghaering stage: - patch review versions: +Python 3.5 -Python 3.3 Added file:

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21977 ___

[issue21901] test_selectors.PollSelectorTestCase.test_above_fd_setsize reported killed by shell

2014-07-14 Thread STINNER Victor
STINNER Victor added the comment: Killed process python(28623:#112) vsz:340800kB, anon-rss:330764kB, file-rss:3864kB 340 MB to run test_selectors sounds high. What is the value of NUM_FDS? And what is the result of this command in your vserver? $ python -c 'import resource;

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: I will keep the \- because the - at the front of the character range is a non-obvious special case. The other changes look reasonable. -- priority: normal - low stage: - commit review type: enhancement - performance versions: +Python 2.7, Python

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset bb28542af060 by Raymond Hettinger in branch '3.4': Issue 21977: Minor improvements to the regexes in the tokenizer example. http://hg.python.org/cpython/rev/bb28542af060 -- nosy: +python-dev ___ Python

[issue21977] In the re's token example OP and SKIP regexes can be improved

2014-07-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21977 ___

[issue21514] update json module docs in light of RFC 7159 ECMA-404

2014-07-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - bob.ippolito nosy: +bob.ippolito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21514 ___

[issue16620] Avoid using private function glob.glob1() in msi module and tools

2014-07-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Martin, this patch touches some of your code. Do you care to take a look at it? -- assignee: - loewis nosy: +loewis, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16620

[issue21978] Support index access on OrderedDict views (e.g. o.keys()[7])

2014-07-14 Thread Ram Rachum
New submission from Ram Rachum: Implement `__getitem__` on `OrdredDict.keys`, `OrdredDict.values` and `OrdredDict.items`, so the following code snippet wouldn't error: from collections import OrderedDict o = OrderedDict(((1, 2), (3, 4), (5, 6))) o OrderedDict([(1, 2), (3,

[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2014-07-14 Thread wjssz
wjssz added the comment: I suggest don't change the content of file, just give a message such as: IDLE can't display non-BMP character (codepoint above 0x). A non-BMP character found in Line 23, position 8 of .py, please open this file with other editor. --

[issue21978] Support index access on OrderedDict views (e.g. o.keys()[7])

2014-07-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm not sure this would make sense given that the ordered dict itself isn't indexable, given that keys/values/items on regular dicts aren't indexable, and given that keys/items views are set-like rather than sequence-like. The one obvious way to get

[issue21084] IDLE can't deal with characters above the range (U+0000-U+FFFF)

2014-07-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21084 ___ ___

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Mika Eloranta
New submission from Mika Eloranta: The following are expected to raise SyntaxError, but they don't: 0xfor python is weird in ways 15 [0xaor 1, 0xbor 1, 0xcor 1, 0xdor 1, 0xeor 1, 0xfor 1] [10, 11, 12, 13, 14, 15] Verified on v2.7.1 and v3.3.2. Probably affects all versions. --

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Mark Dickinson
Mark Dickinson added the comment: Surprisingly, this is valid syntax. Your first line is parsed as: 0xf or (python is weird in ways) Because `or` is short-circuiting, its right-hand operand (which is also valid syntactically, being a chained comparison) is never evaluated, so we don't

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Mika Eloranta
Mika Eloranta added the comment: Mark, can you explain why the first example is valid syntax, but the second one is not: 0xaor 1 10 0xaand 1 File stdin, line 1 0xaand 1 ^ SyntaxError: invalid syntax I do understand how 0xaor 1 is currently parsed, but I'm not still

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Eric V. Smith
Eric V. Smith added the comment: 0xaand 1 is parsed as 0xaa nd 1 which is not valid syntax. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21979 ___

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Eric V. Smith
Changes by Eric V. Smith e...@trueblade.com: -- stage: - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21979 ___ ___ Python-bugs-list

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Mika Eloranta
Mika Eloranta added the comment: OK, I see... 0xfand 1 is ambiguous (0xfa)nd 1 vs. (0xf)and 1. So, while a bit weird, the behavior is consistent: 123not in [], 0xfnot in [], 0xfor 1, 0xafor 1, 0xfin [] (True, True, 15, 175, False) -- ___ Python

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Eric V. Smith
Eric V. Smith added the comment: To be more clear: the parser takes the longest token that could be valid. Since n can't be part of a hex number, parsing stops there, returning 0xaa as the first token. So: 0xaaif 1 else 0 170 hex(0xaaif 1 else 0) '0xaa' --

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The issue is not in pickling/unpickling, but in sqlite3.Row.__new__ which creates object in invalid state. Simple example: import sqlite3 r = sqlite3.Row.__new__(sqlite3.Row) len(r) Segmentation fault (core dumped) -- assignee: -

[issue21980] Implement `logging.LogRecord.__repr__`

2014-07-14 Thread Ram Rachum
Changes by Ram Rachum r...@rachum.com: -- components: Library (Lib) nosy: cool-RR priority: normal severity: normal status: open title: Implement `logging.LogRecord.__repr__` type: enhancement versions: Python 3.5 ___ Python tracker

[issue21981] Idle problem

2014-07-14 Thread Thomas Kember
New submission from Thomas Kember: Hello Terry, Thank you for your explanation of the bug in Idle. I know Idle has limitations, but it is quite adequate for the programming I want to do. I agree that when this error occurs there should only be a warning, so the user can decide what he wants

[issue21979] SyntaxError not raised on 0xaor 1

2014-07-14 Thread Mark Dickinson
Mark Dickinson added the comment: Mark, can you explain why the first example is valid syntax, but the second one is not: Looks like Eric beat me to it! As he explained, it's the maximal munch rule at work: the tokenizer matches as much as it can for each token. You see similar effects

[issue21981] Idle problem

2014-07-14 Thread SilentGhost
Changes by SilentGhost ghost@gmail.com: -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21981 ___ ___ Python-bugs-list

[issue21981] Idle problem

2014-07-14 Thread Eric V. Smith
Eric V. Smith added the comment: Please respond to the other bug. No need to open a new bug when responding to an existing issue. Thanks. -- nosy: +eric.smith resolution: - not a bug stage: - resolved status: open - closed ___ Python tracker

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Claudiu Popa
Claudiu Popa added the comment: Using your example, I can't make it to crash using the tip, nor with Python 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21975 ___

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Claudiu Popa
Claudiu Popa added the comment: Nevermind, I didn't see the len call. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21975 ___ ___

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which fixes crash. -- stage: - patch review Added file: http://bugs.python.org/file35953/sqlite3_row_new.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21975

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Claudiu Popa
Claudiu Popa added the comment: It doesn't crash anymore with your patch, but the pickle.load fails: Traceback (most recent call last): File a.py, line 19, in module load = pickle.loads(dump) TypeError: function takes exactly 2 arguments (0 given) -- stage: patch review -

[issue19806] smtpd crashes when a multi-byte UTF-8 sequence is split between consecutive data packets

2014-07-14 Thread R. David Murray
R. David Murray added the comment: As Milan said, the problem doesn't arise in 3.5 with decode_data=False, since there's no decoding. His patch doesn't actually fix the bug for the decode_data=True case, though, since the bug is a *valid* utf-8 sequence getting split across tcp buffers. To

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For pickling open other issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21975 ___ ___ Python-bugs-list

[issue8849] python.exe problem with cvxopt

2014-07-14 Thread R. David Murray
R. David Murray added the comment: True. Since there was no response from the OP to my question, let's close this. It can be reopened if he's still having a problem, which seems unlikely. -- resolution: - third party stage: - resolved status: open - closed type: - behavior

[issue21964] inconsistency in list-generator comprehension with yield(-from)

2014-07-14 Thread hakril
hakril added the comment: I found something else, I think it worth mentioning it. This side-effect allows to create generators that return other values that None. And the CPython's behavior is not the same for all versions: {(yield i) : i for i in range(2)} generator object dictcomp

[issue21981] Idle problem

2014-07-14 Thread Thomas Kember
Thomas Kember added the comment: Hello Eric V. Smith, I reported only one bug and it has been fixed. I can't find out how I am to reset the status of it to closed. Thomas Kember From: Eric V. Smith rep...@bugs.python.org To: t.kemb...@btinternet.com Sent:

[issue21975] Using pickled/unpickled sqlite3.Row results in segfault rather than exception

2014-07-14 Thread Claudiu Popa
Claudiu Popa added the comment: Ups, I accidentally removed the patch review stage, sorry for that. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21975 ___

[issue21947] `Dis` module doesn't know how to disassemble generators

2014-07-14 Thread Clement Rouault
Clement Rouault added the comment: Updated some docstrings in the new patch after the review comments. Thanks kushou for the code review. -- Added file: http://bugs.python.org/file35954/dis_generator3.patch ___ Python tracker rep...@bugs.python.org

[issue21982] Idle: Regression introduced in configDialog by rev 91509

2014-07-14 Thread Saimadhav Heblikar
New submission from Saimadhav Heblikar: The concerned part : http://hg.python.org/cpython/rev/b836a0cd68f7#l4.15 NameError: name 'keySet' is not defined. -- messages: 223031 nosy: sahutd, terry.reedy priority: normal severity: normal status: open title: Idle: Regression introduced in

[issue21982] Idle: Regression introduced in configDialog by rev 91509

2014-07-14 Thread Saimadhav Heblikar
Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com: -- type: - crash ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21982 ___ ___

[issue16561] bdist_wininst installers don't use UAC, then crash

2014-07-14 Thread Martin v . Löwis
Martin v. Löwis added the comment: I just noticed that I misread the original issue: it's not about the Python Windows installer, but about bdist_wininst packages. -- title: Windows installer doesn't use UAC, then crashes - bdist_wininst installers don't use UAC, then crash

[issue16561] bdist_wininst installers don't use UAC, then crash

2014-07-14 Thread Steve Dower
Changes by Steve Dower steve.do...@microsoft.com: -- nosy: +steve.dower ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16561 ___ ___

  1   2   >