Re: Python without a tty

2011-10-03 Thread Hegedüs , Ervin
hello, On Mon, Oct 03, 2011 at 04:37:43AM +, Steven D'Aprano wrote: I wanted to ensure that it would do the right thing when run without a tty, such as from a cron job. If you fork() your process, then it will also loose the tty... import os import sys try: pid = os.fork()

Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Wong Wah Meng-R32813
Hello guys, I am migrating my application from python 1.5.2 to 2.7.1. I encountered an error when I run some commands (I put in debug statement however, not able to trace down to which line of code that cause it to generate a lot of messages in one second until my hard disk space is full. The

Re: Python without a tty

2011-10-03 Thread Hans Mulder
On 3/10/11 08:10:57, Hegedüs, Ervin wrote: hello, On Mon, Oct 03, 2011 at 04:37:43AM +, Steven D'Aprano wrote: I wanted to ensure that it would do the right thing when run without a tty, such as from a cron job. If you fork() your process, then it will also loose the tty... Errhm, I

Re: executing arbitrary statements

2011-10-03 Thread Jonathan Hartley
Fair points Steven. Thanks for further refining my initial refinement. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Steven D'Aprano
On Mon, 03 Oct 2011 06:45:25 +, Wong Wah Meng-R32813 wrote: Does it mean in newer python I need to migrate all my Exception to non-string based exception type? That's should be a lot of changes. :p Yes. Python 1.5 is very old. It's over 11 years old. You might find it easier to first

Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Chris Rebert
On Sun, Oct 2, 2011 at 11:45 PM, Wong Wah Meng-R32813 r32...@freescale.com wrote: Hello guys, I am migrating my application from python 1.5.2 to 2.7.1. I encountered an error when I run some commands (I put in debug statement however, not able to trace down to which line of code that cause

Re: Python without a tty

2011-10-03 Thread Hegedüs , Ervin
hello, On Mon, Oct 03, 2011 at 09:28:27AM +0200, Hans Mulder wrote: On 3/10/11 08:10:57, Hegedüs, Ervin wrote: If you fork() your process, then it will also loose the tty... Errhm, I suggest you check again. This cannot be true. os.setsid() It is os.setsid() that makes you lose the

RE: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Wong Wah Meng-R32813
Noted. No choice then, I will convert all my raise statement to use the exception instance. Thanks! Regards, Wah Meng -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Monday, October 03, 2011 3:46 PM To: Wong Wah Meng-R32813 Cc:

RE: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Wong Wah Meng-R32813
I see. Thanks for the tips. If I run out of time I shall consider only using 2.5. Regards, Wah Meng -Original Message- From: python-list-bounces+wahmeng=freescale@python.org [mailto:python-list-bounces+wahmeng=freescale@python.org] On Behalf Of Steven D'Aprano Sent: Monday,

Re: Change import order with *.pth files

2011-10-03 Thread Gabriel Genellina
En Sun, 02 Oct 2011 18:29:24 -0300, Andrea Gavana andrea.gav...@gmail.com escribió: Let's say I am using a package called blah, and this package is already installed on site-packages (and I need it to be there) with a name blah-1.2-win. In the site-packages folder, there is a pth file called

Re: Need A script to open a excel file and extract the data using autofilter

2011-10-03 Thread Adam Przybyla
Prakash prakash...@gmail.com wrote: Need A script to open a excel file and extract the data using autofilter and write it in a new sheet or new file like I have to select all rows in which all the columns contain pass as status ... try this: http://www.python-excel.org/ Regards

Re: TK + MVC

2011-10-03 Thread Gregory Ewing
Alexander Kapps wrote: Sure, in that simple example the Controller is just there to show a complete MVC pattern with all three parts. There are often examples where the View is actually both, the View and the Controller. I think what I'm really trying to say is that this example is *poor* at

Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread Gregory Ewing
Wong Wah Meng-R32813 wrote: I am migrating my application from python 1.5.2 to 2.7.1. Does it mean in newer python I need to migrate all my Exception to non-string based exception type? That's should be a lot of changes. :p 'Fraid so. You are leaping quite a lot of versions at once, and

Re: Python without a tty

2011-10-03 Thread Gregory Ewing
Hegedüs wrote: If you fork() your process, then it will also loose the tty... Um, no, fork() doesn't do that, as far as I know. os.setsid() *This* is what's losing the tty. According to the Fine Man Page: DESCRIPTION The setsid function creates a new session. The calling process is

http://www.electronicswebworld.com/

2011-10-03 Thread deepika
http://www.electronicswebworld.com/ online jobs for u http://www.tamilwebworld.com/ -- http://mail.python.org/mailman/listinfo/python-list

packages, modules and double imports - oh my!

2011-10-03 Thread Chris Withers
Hi All, The attached package gives that smallest possible example of problems I'm hitting with some SQLAlchemy declarative classes. In short, I want to be able to do: python -m pack.module and have if the __name__=='__main__' block spit out the SQL to create the tables necessary for the

Re: packages, modules and double imports - oh my!

2011-10-03 Thread Chris Rebert
On Mon, Oct 3, 2011 at 3:11 AM, Chris Withers ch...@simplistix.co.uk wrote: Hi All, The attached package gives that smallest possible example of problems I'm hitting with some SQLAlchemy declarative classes. In short, I want to be able to do: python -m pack.module and have if the

Problem regarding command line completion

2011-10-03 Thread Rajashree Thorat
Hi All, Please can anyone help me in resolving following problem. import cmd class CmdLineApp(cmd.Cmd): def do_grep(self, line): print line option = [--ignore-case, --invert-match,--word-regexp,--line-regexp] def complete_grep(self, text, line, begidx,

Re: parse xml

2011-10-03 Thread Adam Tauno Williams
Quoting 守株待兔 1248283...@qq.com: please click the http://www.secinfo.com/d14qfp.q9j.htm then ,click the following: 44: XML IDEA: Condensed Consolidating Statements of Income XML 5.11M (Details)--R158 there is the citigroup's annual financial report --statements of income,xml file.

Re: lower-case names for builtin types

2011-10-03 Thread rantingrick
On Oct 1, 10:41 pm, Eric Snow ericsnowcurren...@gmail.com wrote: Anyone know the story behind the lower-case names for the non-exception built-in types (like list and type)?  I am guessing that they were originally factory functions that, at some point, graduated to full types; and the names

Re: timedelta is squicking me out

2011-10-03 Thread Roy Smith
In article mailman.1679.1317609688.27778.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: If something involves Python and nontrivial chronology, then mxDateTime is the go-to library. And indeed, it has a RelativeDateTime type:

Re: To start a simple server

2011-10-03 Thread Redcat
Are you running web.py on your computer, or is it running for example on a hosting company's computer? If it's not on your computer you have your port 8080 traffic blocked the hosting company's firewall. On Sun, 02 Oct 2011 20:59:40 -0700, sillyou su wrote: i am learning webpy and I am

BaseHTTPServer ThreadMixIn not working

2011-10-03 Thread amit
Hi everyone, I am really stuck in a very simple problem and wanted to know if you could take some time to check it out - My code is simple. Using BaseHTTPServer and ThreadInMix I want to run a python script (Script1.py) for every request made simultaneously. My code- from subprocess import

Re: Advise on using logging.getLogger needed.

2011-10-03 Thread Jean-Michel Pichavant
Steven W. Orr wrote: I hope I don't sound like I'm ranting :-( I have created a module (called xlogging) which sets up logging the way I want it. I found out that if I set up my logger without a name, then it gets applied to every logger that is referenced by every module that ever gets

Re: packages, modules and double imports - oh my!

2011-10-03 Thread Chris Withers
On 03/10/2011 11:22, Chris Rebert wrote: http://docs.python.org/library/runpy.html : The runpy module['s] main use is to implement the -m command line switch If the supplied module name refers to a package rather than a normal module, then that package is imported and the __main__ submodule

Who Is Gary Sokolich? 1405

2011-10-03 Thread Gary Sokolisch
1405 W Gary Sokolich 801 Kings Road Newport Beach, CA 92663-5715 (949) 650-5379 http://web.archive.org/web/20080821231423/http://www.tbpe.state.tx.us/da/da022808.htm TEXAS BOARD OF PROFESSIONAL ENGINEERS February 28, 2008 Board Meeting Disciplinary Actions W. Gary Sokolich , Newport Beach,

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread rantingrick
On Oct 2, 4:43 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: In all cases, we can be sure that the contradiction between the pair of statements are genuine contradictions and not mere apparent contradictions caused by narrow perspective or incomplete or erroneous knowledge.

Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Aivar Annamaa
Hi! I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` I found rejected PEP 299, but i thought that maybe there's something new already. Here's why I want such a thing: I'm teaching

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread Chris Angelico
On Tue, Oct 4, 2011 at 2:54 AM, rantingrick rantingr...@gmail.com wrote: Observer: Why is it that Clark Kent and Superman are never in the same place at the same time? ComicFanboy: Because Clark Kent IS Kal-El's secret identity duh! PuesdoWiseObserver: Wait a minute fanboy, they ARE in the

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Alec Taylor
Make something with http://metapython.org/ ? On Tue, Oct 4, 2011 at 3:21 AM, Aivar Annamaa aivar.anna...@gmail.com wrote: Hi! I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` I

Re: TK + MVC

2011-10-03 Thread Emeka
Alex, The question was not meant for you. I was responding to Greg's comment. Regards, Emeka On Mon, Oct 3, 2011 at 12:14 AM, Alexander Kapps alex.ka...@web.de wrote: On 03.10.2011 00:15, Emeka wrote: Greg, Do you have an example where the Controller is connected? What do you mean? In

Re: To start a simple server

2011-10-03 Thread sillyou su
I am running web.py on my computer -- http://mail.python.org/mailman/listinfo/python-list

Re: To start a simple server

2011-10-03 Thread Redcat
On Mon, 03 Oct 2011 10:05:15 -0700, sillyou su wrote: I am running web.py on my computer Does netstat -nat | grep 8080 show anything listening on port 8080? (I'm assuming here that you're running on a Linux box) -- http://mail.python.org/mailman/listinfo/python-list

Re: To start a simple server

2011-10-03 Thread Amelia T Cat
On Mon, 03 Oct 2011 10:09:59 -0700, sillyou su wrote: 啊!! I should use 127.0.0.1 instance of 0.0.0.0 Theoretically either one should be fine. If you use 127.0.0.1 it will only expose the service to your local machine. If you use 0.0.0.0 ut will expose the service to other computers on the

Re: Problem regarding command line completion

2011-10-03 Thread Peter Otten
Rajashree Thorat wrote: Please can anyone help me in resolving following problem. import cmd class CmdLineApp(cmd.Cmd): def do_grep(self, line): print line option = [--ignore-case, --invert-match,--word-regexp,--line-regexp] def

Re: To start a simple server

2011-10-03 Thread Iuri
Something is running in your port 8080. Change the port and try again. On Mon, Oct 3, 2011 at 3:15 PM, Amelia T Cat ame...@catfolks.net wrote: On Mon, 03 Oct 2011 10:09:59 -0700, sillyou su wrote: 啊!! I should use 127.0.0.1 instance of 0.0.0.0 Theoretically either one should be fine.

Re: Re: packages, modules and double imports - oh my!

2011-10-03 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Chris Withers wrote: On 03/10/2011 11:22, Chris Rebert wrote: http://docs.python.org/library/runpy.html : The runpy module['s] main use is to implement the -m command line switch If the supplied module name refers to a package rather than a normal module, then that

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Aivar Annamaa wrote: Hi! I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` I found rejected PEP 299, but i thought that maybe there's something new already.

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Ian Kelly
On Mon, Oct 3, 2011 at 1:14 PM, Dave Angel da...@ieee.org wrote: Is it explaining the if statement that's the problem?  If so, you could have them do an unconditional main(sys.argv) at the bottom of their file, and not bother putting an if statement in front of it.  Then when you get to

Question: How to Prevent Tkinter Menu from Taking Keyboard Focus

2011-10-03 Thread galyle
Hello, I'm trying to build a menu which provides suggestions to a user based on input to an entry. I have done something like this before using Tcl/Tk, so I expected that it would work without much difficulty with Tkinter. I was wrong. The problem I have is that, as soon as the menu is posted,

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread rantingrick
On Oct 3, 2:14 pm, Dave Angel da...@ieee.org wrote: Like it or not, there are plenty of globals already there, one of them being __name__ .  All the built-ins are effectively global, and so   is any function they define at top-level. I keep wondering if that was another PyWart? I believe (and

HTTP Persistent connection

2011-10-03 Thread pedr0
Hi at all, I have some problem with the httplib module, I would like have an HTTP persistent connection but when run this code : #first request http_connection = httplib.HTTPConnection(host) http_connection.request(method,url,headers=headers) response = http_connection.getresponse() #second

Re: HTTP Persistent connection

2011-10-03 Thread pedr0
I forget to insert second request. host = www.higuys.net #first request http_connection = httplib.HTTPConnection(host) http_connection.request(method,url_first,headers=headers) response = http_connection.getresponse() #second request http_connection = httplib.HTTPConnection(host)

Re: Question: How to Prevent Tkinter Menu from Taking Keyboard Focus

2011-10-03 Thread rantingrick
On Oct 3, 2:55 pm, galyle gal...@gmail.com wrote: Hello, I'm trying to build a menu which provides suggestions to a user based on input to an entry.  I have done something like this before using Tcl/Tk, so I expected that it would work without much difficulty with Tkinter.  I was wrong. Why

Re: HTTP Persistent connection

2011-10-03 Thread John Gordon
In 27527508.4070.1317674357487.JavaMail.geo-discussion-forums@yqnk41 pedr0 pulsarpie...@gmail.com writes: I forget to insert second request. host = www.higuys.net #first request http_connection = httplib.HTTPConnection(host) http_connection.request(method,url_first,headers=headers)

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread rantingrick
On Oct 3, 11:27 am, Chris Angelico ros...@gmail.com wrote: PhysicsExpert: Super-speed wouldn't work, the acceleration required to achieve it would burn up his surroundings! For some definition of super-speed i suppose. Since we're bouncing around the relatives here we need to consider this one

Re: HTTP Persistent connection

2011-10-03 Thread pedr0
Because I am a newbye!!! Thanks a lot for your answer! -- http://mail.python.org/mailman/listinfo/python-list

Re: Hello, and request for help with 'dynamic grids'

2011-10-03 Thread Ed Leafe
On Sep 5, 2011, at 8:33 AM, Simon Cropper wrote: Dabo is a great product. Spoke extensively with Ed Leafe and Paul McNett. Unfortunately the framework is not 'dynamic'. If you have an fixed database and tables it can quite quickly create a basic data entry setup and menu. Looks great when

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Gregory Ewing
Ian Kelly wrote: I would suggest giving them the whole if __name__ block as boilerplate and telling them they're not allowed to alter it. I would suggest not showing them if __name__ at all; instead encourage them to do this: def main(): ... ... main() You only need if __name__

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Dave Angel
On 01/-10/-28163 02:59 PM, rantingrick wrote: On Oct 3, 2:14 pm, Dave Angelda...@ieee.org wrote: Like it or not, there are plenty of globals already there, one of them being __name__ . All the built-ins are effectively global, and so is any function they define at top-level. I keep

Re: Is there any way to access attributes from an imported module?

2011-10-03 Thread Rhodri James
On Mon, 03 Oct 2011 03:21:41 +0100, Andrew Berg bahamutzero8...@gmail.com wrote: I found a way to do it, albeit a very hackish one. Since the class instance already catches exceptions from the modules it imports, I can make a custom exception (in a common area for both it and the submodules

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Ian Kelly
On Mon, Oct 3, 2011 at 2:10 PM, rantingrick rantingr...@gmail.com wrote: Also for scoping. py count = 0 py def foo(): ...     global.count += 1 py print count 1 Why? Well because many times i find myself wondering if this or that variable is local or global -- and when i say global i am

Re: overloading operators for a function object

2011-10-03 Thread Westley Martínez
On Fri, Sep 30, 2011 at 09:50:42PM -0700, Fletcher Johnson wrote: Is it possible to overload operators for a function? For instance I would like to do something roughly like... def func_maker(): def func(): pass def __eq__(other): if other == check: return True return

Re: Advise on using logging.getLogger needed.

2011-10-03 Thread Gelonida N
On 10/03/2011 12:12 AM, Steven W. Orr wrote: I hope I don't sound like I'm ranting :-( I have created a module (called xlogging) which sets up logging the way I want it. I found out that if I set up my logger without a name, then it gets applied to every logger that is referenced by every

Re: Question: How to Prevent Tkinter Menu from Taking Keyboard Focus

2011-10-03 Thread galyle
On Oct 3, 2:40 pm, rantingrick rantingr...@gmail.com wrote: On Oct 3, 2:55 pm, galyle gal...@gmail.com wrote: Hello, I'm trying to build a menu which provides suggestions to a user based on input to an entry.  I have done something like this before using Tcl/Tk, so I expected that it would

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Chris Angelico
On Tue, Oct 4, 2011 at 9:41 AM, Ian Kelly ian.g.ke...@gmail.com wrote: def add_from_input(num_lines):    total = global.sum(global.int(global.input()) for i in global.range(num_lines))    global.print(The total is, total) That's pretty unfair to the globals. def

Re: Python without a tty

2011-10-03 Thread Nobody
On Mon, 03 Oct 2011 22:04:26 +1300, Gregory Ewing wrote: os.setsid() *This* is what's losing the tty. According to the Fine Man Page: DESCRIPTION The setsid function creates a new session. The calling process is the session leader of the new session, is the process group

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread Roy Smith
In article mailman.1702.1317670708.27778.python-l...@python.org, Ian Kelly ian.g.ke...@gmail.com wrote: It's not a good idea to teach bad habits they'll just have to unlearn later on. Absolutely correct. People who teach teachers how to teach call this the Law of Primacy

Re: Python Migration Error: TypeError: exceptions must be old-style classes or derived from BaseException, not str

2011-10-03 Thread rusi
On Oct 3, 12:45 pm, Chris Rebert c...@rebertia.com wrote: On Sun, Oct 2, 2011 at 11:45 PM, Wong Wah Meng-R32813 r32...@freescale.com wrote: Hello guys, I am migrating my application from python 1.5.2 to 2.7.1. I encountered an error when I run some commands (I put in debug statement

Re: To start a simple server

2011-10-03 Thread sillyou su
On Oct 4, 2:15 am, Amelia T Cat ame...@catfolks.net wrote: On Mon, 03 Oct 2011 10:09:59 -0700, sillyou su wrote: 啊!! I should use 127.0.0.1 instance of  0.0.0.0 Theoretically either one should be fine. If you use 127.0.0.1 it will only expose the service to your local machine. If you use

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread alex23
rantingrick rantingr...@gmail.com wrote: Why? Well because many times i find myself wondering if this or that variable is local or global -- and when i say global i am speaking of module scope! The globalDOT cures the ill. Given your stated propensity for huge code blocks not chunked into

Re: Is it possible to create C-style main function in Python? (for teaching purposes)

2011-10-03 Thread alex23
Sorry for hijacking Alec's response but I didn't see the OP. Aivar Annamaa aivar.anna...@gmail.com wrote: I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` One direct way is to call

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread alex23
rantingrick rantingr...@gmail.com wrote: TrueWiseObserver: Wrong pseudo. Superman will ALWAYS be superman even if he wears a dress and stilettos. Clark Kent is just an assumed identity of Superman. Actually, he identifies with Clark Kent, Superman is the secret identity. You're thinking of

Re: Chaos Theory [was Re: Benefit and belief]

2011-10-03 Thread Zero Piraeus
: On 4 October 2011 00:43, alex23 wuwe...@gmail.com wrote: rantingrick rantingr...@gmail.com wrote: Clark Kent is just an assumed identity of Superman. Actually, he identifies with Clark Kent, Superman is the secret identity. You're thinking of Batman, for whom Bruce Wayne is the mask. A

[issue7833] Bdist_wininst installers fail to load extensions built with Issue4120 patch

2011-10-03 Thread Mark Hammond
Mark Hammond skippy.hamm...@gmail.com added the comment: This is biting people (including me :) so I'm going to try hard to get this fixed. One user on the python-win32 mailing list resorts to rebuilding every 3rd party module he uses with this patch to get things working again (although

[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Are you using the .msi installer from python.org? Or one from activestate or enthought? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13071

[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Are you using some unusual keyboard layout? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13071 ___

[issue13071] IDLE refuses to open on windows 7

2011-10-03 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This issue is very similar to issue5707: it is possible to define a custom key binding to Alt or Control: just click the Alt box and don't select a letter. There is no check, it's possible to save this buggy key binding, and IDLE won't

[issue12804] make test fails on systems without internet access

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: FWIW there's also support.open_urlresource that can be used to download test data. open_urlresouce calls requires('urlfetch') and skips the test when the resource is not enabled. For instance, test_normalization uses it: try:

[issue7425] Improve the robustness of pydoc -k in the face of broken modules

2011-10-03 Thread Ned Deily
Ned Deily n...@acm.org added the comment: It turns out that the proposed fix here for pydoc was independently added in the early days of Python 3 but was not backported. That fix for 2.7 plus a fix-in-progress for Issue7367 (for both 2.7 and 3.x) and additional test cases (also in progress)

[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: The automatic conversion of 'u' to 'I' or 'L' causes test_buffer (PEP-3118 repo) to fail: # Not implemented formats. Ugly, but inevitable. This is the same as # issue #2531: equality is also used for membership testing and must # return

[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13072 ___ ___

[issue12458] Tracebacks should contain the first line of continuation lines

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This is an interesting proposal. The line number comes from Python/traceback.c:120: tb-tb_lineno = PyFrame_GetLineNumber(frame); and this function is defined in Objects/frameobject.c:35: int PyFrame_GetLineNumber(PyFrameObject *f) {

[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: It would be better to use a format for a Py_UCS4 string, but struct doesn't support such type. PEP-3118 suggests for the extended struct syntax: 'c' - ucs-1 (latin-1) encoding 'u' - ucs-2 'w' - ucs-4 --

[issue6632] Include more fullwidth chars in the decimal codec

2011-10-03 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +tchrist ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6632 ___ ___ Python-bugs-list

[issue12911] Expose a private accumulator C API

2011-10-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: It's not a container type, just a small C struct that gets allocated on the stack. Think of it as a library, like stringlib. That's what I call a container type: a structure with a library :-) That's another possibility. But we'd have

[issue12911] Expose a private accumulator C API

2011-10-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: That's another possibility. But we'd have to expose a C API anyway, and this one is as good as any other. No, it's not: it's additional clutter. If new API needs to be added, adding it for existing structures is better. Notice that you

[issue670664] HTMLParser.py - more robust SCRIPT tag parsing

2011-10-03 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. f...@fdrake.net: -- nosy: -fdrake ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue670664 ___ ___ Python-bugs-list

[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The automatic conversion of 'u' to 'I' or 'L' causes test_buffer (PEP-3118 repo) to fail: # Not implemented formats. Ugly, but inevitable. This is the same as # issue #2531: equality is also used for membership testing and must

[issue13072] Getting a buffer from a Unicode array uses invalid format

2011-10-03 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: STINNER Victor rep...@bugs.python.org wrote: # Not implemented formats. Ugly, but inevitable. This is the same as # issue #2531: equality is also used for membership testing and must # return a result. a = array.array('u', 'xyz')

[issue13094] setattr misbehaves when used with lambdas inside for loop

2011-10-03 Thread Tomáš Dvořák
New submission from Tomáš Dvořák dvto...@gmail.com: I have this python script, and run it in python 2.7.2 (installed from EPD_free 7.1-2 (32-bit), but I guess this has nothing to do with EPD. 8---fail.py-- class X(object): pass x = X() items = [foo, bar, baz] for each in items:

[issue13094] setattr misbehaves when used with lambdas inside for loop

2011-10-03 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Sorry. It is intended behavior. The lambda 'each' is bound to the local 'each', and by the time the lambda's execute, the value of 'each' is 'baz'. I'm going to turn this into a doc bug, because while I'm pretty sure this is

[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- title: setattr misbehaves when used with lambdas inside for loop - Need Programming FAQ entry for the behavior of closures ___ Python tracker rep...@bugs.python.org

[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: To understand better what's going on, try to change the value of 'each' after the 3 prints and then call again the 3 methods: you will see that they now return the new value of each. This is because the lambdas refer to global 'each'

[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Tomáš Dvořák
Tomáš Dvořák dvto...@gmail.com added the comment: Thank you all very much for the super-quick responses. I'm used to smalltalk, so the python variable binding behaviour is unnatural to me, but I guess there must have been some reasons for making it behave this way. Ezio, the lambda

[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov
Changes by Artyom Gavrichenkov xima...@highloadlab.com: -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13045 ___ ___

[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Maybe with a different name is less confusing: lambda return_value=each: return_value This copies the value of 'each' in a variable called 'return_value' that is local to the lambda. Since the copy happens when the lambdas are defined,

[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-10-03 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11816 ___ ___ Python-bugs-list

[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov
Changes by Artyom Gavrichenkov xima...@highloadlab.com: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13045 ___ ___

[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov
Changes by Artyom Gavrichenkov xima...@highloadlab.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13045 ___ ___

[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: Hello, method:: socket.getsockopt(level, optname[, optarg]) The overloading of the third parameter is confusing: it can already be an integer value or a buffer size, I don't think that adding a third possibility is a good idea. It

[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: There are no official English titling rules and as you noted, publishers vary. If there aren't any rules, then how come all book and movie titles always look the same? :) Can we please leave the English language out of this issue?

[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-03 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: The patch is pretty much complete, it just needs a review (I left some comments on the review page). One thing that can be added is some compression for the names of the named sequences. I'm not sure I can reuse the same compression used

[issue13001] test_socket.testRecvmsgTrunc failure on FreeBSD 7.2 buildbot

2011-10-03 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 4378bae6b8dc by Charles-François Natali in branch 'default': Issue #13001: Fix test_socket.testRecvmsgTrunc failure on FreeBSD 8, which http://hg.python.org/cpython/rev/4378bae6b8dc -- nosy: +python-dev

[issue13045] socket.getsockopt may require custom buffer contents

2011-10-03 Thread Artyom Gavrichenkov
Artyom Gavrichenkov xima...@highloadlab.com added the comment: Hi Charles-François, I've attached an update for the previous patch. Now there's no more overloading for the third argument and socket.getsockopt accepts one more optional argument -- a buffer to use as an input to kernel. I can

[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Should the input of OSError be checked? It could, but pre-PEP it is not, so I assumed it's better to minimize compatibility-breaking changes. -- ___ Python tracker rep...@bugs.python.org

[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Added file: http://bugs.python.org/file23307/554524a74bbe.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12555 ___

[issue12555] PEP 3151 implementation

2011-10-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Patch update against latest default. There shouldn't be anything interesting to see. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12555

[issue13095] Support for splitting lists/tuples into chunks

2011-10-03 Thread Cal Leeming
New submission from Cal Leeming cal.leem...@simplicitymedialtd.co.uk: After a while of digging around, I noticed that the core libs don't provide an easy way of splitting a list/tuple into chunks - as per the following discussion:

[issue12753] \N{...} neglects formal aliases and named sequences from Unicode charnames namespace

2011-10-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The patch needs to take versioning into account. It seems that NamedSequences where added in 4.1, and NameAliases in 5.0. So for the moment, when using 3.2 (i.e. when self is not NULL), it is fine to lookup neither. Please put an assertion

  1   2   >