[ANN] cdecimal-2.2 released
Hi, I'm pleased to announce the release of cdecimal-2.2. cdecimal is a fast drop-in replacement for the decimal module in Python's standard library. Blurb = cdecimal is a complete implementation of IBM's General Decimal Arithmetic Specification. With the appropriate context parameters, cdecimal will also conform to the IEEE 754-2008 Standard for Floating-Point Arithmetic. Typical performance gains over decimal.py are between 30x for I/O heavy benchmarks and 80x for numerical programs. In a PostgreSQL database benchmark, the speedup is 12x. +-+-+--+-+ | | decimal | cdecimal | speedup | +=+=+==+=+ | pi|42.75s |0.58s | 74x | +-+-+--+-+ | telco | 172.19s |5.68s | 30x | +-+-+--+-+ | psycopg | 3.57s |0.29s | 12x | +-+-+--+-+ In the pi benchmark, cdecimal often performs better than Java's BigDecimal running on Java HotSpot(TM) 64-Bit Server VM. Both cdecimal and the underlying library - libmpdec - have very large test suites. libmpdec has 100% code coverage, cdecimal 85%. The test suites have been running continuously for over a year without any major issues. Install === Since cdecimal is now listed on PyPI, it can be installed using pip: pip install cdecimal Windows installers are available at: http://www.bytereef.org/mpdecimal/download.html Links = http://www.bytereef.org/mpdecimal/index.html http://www.bytereef.org/mpdecimal/changelog.html http://www.bytereef.org/mpdecimal/download.html Checksums of the released packages == sha256sum - 3d92429fab74ddb17d12feec9cd949cd8a0be4bc0ba9afc5ed9b3af884e5d406 mpdecimal-2.2.tar.gz e8f02731d4089d7c2b79513d01493c36ef41574423ea3e49b245b86640212bdc mpdecimal-2.2.zip 515625c5c5830b109c57af93d49ae2c57ec3f230d46a3e0583840ff73d7963be cdecimal-2.2.tar.gz sha1sum --- 24695b2c9254e1b870eb663e3d966eb4f0abd5ab cdecimal-2.2.win32-py2.6.msi e74cb7e722f30265b408b322d2c50d9a18f78587 cdecimal-2.2.win32-py2.7.msi 7c39243b2fc8b1923ad6a6066536982844a7617f cdecimal-2.2.win32-py3.1.msi 5711fd69a8e1e2e7be0ad0e6b93ecc10aa584c68 cdecimal-2.2.win-amd64-py2.6.msi b1cd7b6a373c212bf2f6aa288cd767171bfefd41 cdecimal-2.2.win-amd64-py2.7.msi f08a803a1a42a2d8507da1dc49f3bf7eed37c332 cdecimal-2.2.win-amd64-py3.1.msi cb29fa8f67befaf2d1a05f4675f840d7cd35cf6c cdecimal-2.2-no-thread.win32-py2.6.msi 012a44488f2ce2912f903ae9faf995efc7c9324b cdecimal-2.2-no-thread.win32-py2.7.msi 1c08c73643fc45d7b0feb62c33bebd76537f9d02 cdecimal-2.2-no-thread.win32-py3.1.msi b6dbd92e86ced38506ea1a6ab46f2e41f1444eae cdecimal-2.2-no-thread.win-amd64-py2.6.msi b239b41e6958d9e71e91b122183dc0eaefa00fef cdecimal-2.2-no-thread.win-amd64-py2.7.msi 413724ff20ede7b648f57dd9a78a12e72e064583 cdecimal-2.2-no-thread.win-amd64-py3.1.msi Stefan Krah -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: Resolve circular reference
so there is no chance without using weakrefs? any ideas, tips, workarounds how I might handle this? bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list
Re: Close stdout socket on CGI after fork with subprocess
On Mon, Jan 10, 2011 at 1:15 PM, Thibaud Roussillat thibaud.roussil...@gmail.com wrote: On Sat, Jan 8, 2011 at 3:19 AM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: On Fri, Jan 7, 2011 at 8:08 PM, Thibaud Roussillat thibaud.roussil...@gmail.com wrote: Hi, I work with Python 2.4 and CGI. I have a CGI which call a Python script in background process and return result before background task is finished. Actually, the browser displays response but it is waiting for end of background task because the socket is not closed. Internet told me that I must close the stdout file descriptor (sys.stdout.close()) to close the socket but it doesn't work. The background task is launched via subprocess.Popen and is attached to the root process on ps command. This means that the parent process finished before the child. Call wait() on the Popen object to wait for the child to terminate. Depending on how you create the Popen object, the child process may inherit your own stdout. In that case, the child process may be keeping the socket open after the parent dies. top-posting corrected In fact, the parent process finished before the child, it's why I want to run the child in a forked process, and close the socket of the parent task. The goal is not to wait for the child process but to leave it lead one's own life as a background task. The client don't have to wait for the end of the child process. Is there a way to not inherit from the parent stdout on the child process ? open os.devnull and pass that file object as stdin, stdout and stderr for the child process. Hopefully the program you are running has been designed not to expect to be able to use stdin/stdout/stderr. Please keep the discussion on the mailing list. Other people on the list are smarter than me. Also, the convention on this mailing list is to keep replies below the quoted content. -- regards, kushal -- http://mail.python.org/mailman/listinfo/python-list
Re: Absolute imports?
Roy Smith wrote: [snip] It's reasonably straight-forward to figure out that absolute path, starting from sys.argv[0] and using the tools in os.path. Now I need to import the file, given that I know its absolute pathname. It looks like imp.load_source() does what I want, I'm just wondering if there's a cleaner way. What about config = __import__(configPath.replace('.py', '')) JM -- http://mail.python.org/mailman/listinfo/python-list
PJL
Anyone got any experience of send PJL commands to a printer using Python on Unix? -- http://mail.python.org/mailman/listinfo/python-list
Re: Close stdout socket on CGI after fork with subprocess
On Mon, Jan 10, 2011 at 9:26 AM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com kushal.kumaran%2bpyt...@gmail.com wrote: On Mon, Jan 10, 2011 at 1:15 PM, Thibaud Roussillat thibaud.roussil...@gmail.com wrote: On Sat, Jan 8, 2011 at 3:19 AM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com kushal.kumaran%2bpyt...@gmail.com wrote: On Fri, Jan 7, 2011 at 8:08 PM, Thibaud Roussillat thibaud.roussil...@gmail.com wrote: Hi, I work with Python 2.4 and CGI. I have a CGI which call a Python script in background process and return result before background task is finished. Actually, the browser displays response but it is waiting for end of background task because the socket is not closed. Internet told me that I must close the stdout file descriptor (sys.stdout.close()) to close the socket but it doesn't work. The background task is launched via subprocess.Popen and is attached to the root process on ps command. This means that the parent process finished before the child. Call wait() on the Popen object to wait for the child to terminate. Depending on how you create the Popen object, the child process may inherit your own stdout. In that case, the child process may be keeping the socket open after the parent dies. top-posting corrected In fact, the parent process finished before the child, it's why I want to run the child in a forked process, and close the socket of the parent task. The goal is not to wait for the child process but to leave it lead one's own life as a background task. The client don't have to wait for the end of the child process. Is there a way to not inherit from the parent stdout on the child process ? open os.devnull and pass that file object as stdin, stdout and stderr for the child process. Hopefully the program you are running has been designed not to expect to be able to use stdin/stdout/stderr. Please keep the discussion on the mailing list. Other people on the list are smarter than me. Also, the convention on this mailing list is to keep replies below the quoted content. -- regards, kushal Thanks a lot, this works well with a file object opened on /dev/null (or os.devnull) and passed as stdin, stdout and stderr. Sorry for the reply, I just do reply on my webmail ;) Regards, Thib -- http://mail.python.org/mailman/listinfo/python-list
Re: PJL
On 1/10/2011 6:12 AM loial said... Anyone got any experience of send PJL commands to a printer using Python on Unix? Are you having trouble? PJL is sent like any other text... Emile -- http://mail.python.org/mailman/listinfo/python-list
Re: Create a class to position a window on the screen.
I'm not exactly sure what you are asking here, but one problem that is notable in your example is that the center function is indented inside the __init__ function. This would create a closure instead of a method on PositionWindow, which is probably not what you want. -Zac On Sun, Jan 9, 2011 at 10:23 AM, Rohit Coder passionate_program...@hotmail.com wrote: Hi, elementFontfont-familyfont-sizefont-stylefont-variantfont-weight letter-spacingline-heighttext-decorationtext-aligntext-indent text-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-color bg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-right border-bottomborder-leftmarginpaddingmax-heightmin-heightmax-width min-widthoutline-coloroutline-styleoutline-widthPositioningpositiontop bottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-type list-style-positionTablevertical-alignborder-collapseborder-spacing caption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadow border-radiusOtheroverflowcursorvisibility I am new to Python and this is my fist Python class. I am using PyQt4 framework on Windows 7. I don't know whether the code below is correctly written or not. I want to modify it further as: 1. In the arguments, I want to pass the name of another opened Window (.py) on the screen. 2. I want to pass the x-coord., y-coord. and the name of the window to position on the screen. How to modify the code to fulfill these requirements? ***Attempted Code*** class PositionWindow: def __init__(self, xCoord, yCoord, windowName, parent = None): self.x = xCoord self.y = yCoord self.wName = windowName; def center(self): screen = QtGui.QDesktopWidget().screenGeometry() size = self.geometry() self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2) ... Rohit. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: PJL
Thanks for responding.. First question...how do I send it to the printer? Printer would be on the network. -- http://mail.python.org/mailman/listinfo/python-list
Re: Resolve circular reference
On Jan 10, 12:21 am, moerchendiser2k3 googler. 1.webmas...@spamgourmet.com wrote: so there is no chance without using weakrefs? any ideas, tips, workarounds how I might handle this? No, sorry: as long as a reference to an object exists, the object is never deleted. There is no way to get around this. Python in general isn't designed to allow for exact control over the destruction of objects. Even in CPython, which uses reference counting, there are a bunch of situations where a reference might be stored to an object that keeps it alive. (Unexpected locations where a stray reference might exist: an unpickler object, the _ symbol in the interactive shell.) Other implementations, like Jython and IronPython, don't use reference counting and don't provide for any particular time at all for an object to be destroyed. The recommended way to ensure timely release of resources in Python is to provide a method (such as close or finalize) to explicity release the resource--the object then lives on in a zombie state. The with statement can be used in many cases to avoid the need to call this method explicitly. For example, if you were to run this code in Python: with open(filename) as f: g = f print g It would print closed file 'whatever' The object still exists because there is a reference to it, but the file has been closed. If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: PJL
On Montag 10 Januar 2011, loial wrote: First question...how do I send it to the printer? Printer would be on the network. echo PJL | lp -oraw -dnetworkprinter if it works, translate it to python -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: os.system and loggers
On Jan 7, 11:24 am, Tim jtim.arn...@gmail.com wrote: hi, I'm using a 3rd-party python program that uses the python logging facility and also makes calls to os.system. I'm trying to capture its output to a file. In my own code, I've taken control of the loggers that are setup in the other program by removing its StreamHandler and replacing with FileHander. But when it comes to the call to os.system I'm at a loss. I want to capture the stdout from that os.system call in my FileHandler. I thought this might work, before I call the other program's class/method: sys.stdout = getLogger('status').handlers[0].stream but no dice. Is there any clean way to get what I want? If not, I guess I'll override the other method with my own, but it will basically be a bunch of code copied with os.sytem replaced with subprocess, using getLogger('status').handlers[0].stream for stdout/ stderr. thanks, --Tim Arnold Replying to my own post I think I may have included too much fluff in my original question. The main thing I wonder is whether I can attach a log handler to stdout in such a way that os.system calls will write to that handler instead of the console. thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list
Re: PJL
On 1/10/2011 7:06 AM loial said... Thanks for responding.. First question...how do I send it to the printer? Printer would be on the network. Start here: http://mail.python.org/pipermail/python-announce-list/2000-November/000567.html The middle article covers accessing the printer. Emile -- http://mail.python.org/mailman/listinfo/python-list
Re: Print to an IPP printer (pkipplib?)
On 10/16/2010 10:49 AM, Adam Tauno Williams wrote: I've found the module pkipplib which seems to work well for things like interrogating an IPP (CUPS) server. But is there a way to send a print job to an IPP print queue? [and no, the local system knows nothing about the print architecture so popenlp is not an option]. I just want to send the data from a file handle to a remote IPP queue as a print job. I wonder if you could post the print job directly to the IPP url. It's really just HTTP under the hood. -- http://mail.python.org/mailman/listinfo/python-list
Re: Resolve circular reference
If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Thanks for your answer! In my case the types A and B (in my example above) are a dialog and a dialog widget. At a special time I have to close and destroy all dialogs but this does not happen because the widget keeps the dialog alive. I have the reference to the dialog but after I closed the dialogs I also would like to destroy them because they have to free some special ressources. Thanks a lot!! Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list
Re: os.system and loggers
On Jan 10, 8:29 am, Tim jtim.arn...@gmail.com wrote: On Jan 7, 11:24 am, Tim jtim.arn...@gmail.com wrote: hi, I'm using a 3rd-party python program that uses the python logging facility and also makes calls to os.system. I'm trying to capture its output to a file. In my own code, I've taken control of the loggers that are setup in the other program by removing its StreamHandler and replacing with FileHander. But when it comes to the call to os.system I'm at a loss. I want to capture the stdout from that os.system call in my FileHandler. I thought this might work, before I call the other program's class/method: sys.stdout = getLogger('status').handlers[0].stream but no dice. Is there any clean way to get what I want? If not, I guess I'll override the other method with my own, but it will basically be a bunch of code copied with os.sytem replaced with subprocess, using getLogger('status').handlers[0].stream for stdout/ stderr. thanks, --Tim Arnold Replying to my own post I think I may have included too much fluff in my original question. The main thing I wonder is whether I can attach a log handler to stdout in such a way that os.system calls will write to that handler instead of the console. No, but you could replace os.system with something that does work. (It would replace it globally for all uses, so you may need some logic to decide whether to leave the call alone, or to modify it, perhaps by inspecting the call stack.) The simplest thing to do is to append a shell redirection to the command (/your/log/file), so something like this: _real_os_system = os.system def my_os_system(cmd): if test_log_condition: return _real_os_system(cmd + 2 /my/log/file) return _real_os_system(cmd) os.system = my_os_system That could backfire for any number of reasons so you probably should only do this if you know that it works with all the commands it issues. The better way might be to call the subprocess module instead, where you can dispatch the command with redirection to any stream. I doubt there's a foolproof way to do that given an arbitrary os.system command, but the subprocess way is probably safer. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: os.system and loggers
On Jan 10, 8:29 am, Tim jtim.arn...@gmail.com wrote: I think I may have included too much fluff in my original question. The main thing I wonder is whether I can attach a log handler to stdout in such a way that os.system calls will write to that handler instead of the console. -- http://mail.python.org/mailman/listinfo/python-list
Re: Resolve circular reference
moerchendiser2k3, 10.01.2011 18:55: If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Thanks for your answer! In my case the types A and B (in my example above) are a dialog and a dialog widget. At a special time I have to close and destroy all dialogs but this does not happen because the widget keeps the dialog alive. I have the reference to the dialog but after I closed the dialogs I also would like to destroy them because they have to free some special ressources. Objects within a reference cycle will eventually get cleaned up, just not right away and not in a predictable order. If you need immediate cleanup, you should destroy the reference cycle yourself, e.g. by removing the widgets from the dialog when closing it. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: Print to an IPP printer (pkipplib?)
On Mon, 2011-01-10 at 10:37 -0700, Michael Torrie wrote: On 10/16/2010 10:49 AM, Adam Tauno Williams wrote: I've found the module pkipplib which seems to work well for things like interrogating an IPP (CUPS) server. But is there a way to send a print job to an IPP print queue? [and no, the local system knows nothing about the print architecture so popenlp is not an option]. I just want to send the data from a file handle to a remote IPP queue as a print job. I wonder if you could post the print job directly to the IPP url. It's really just HTTP under the hood. Correct; I've been meaning to try that but haven't gotten back to it on my to-do list. First I have to make a text stream into a PDF, so I have something to send. Surprisingly I've been able to find no code to steal which does that; which means it will take longer. :( [clumsily thunking out to commands like a2ps, etc... is strictly forbidden in this code-base; and that seems how a lot of people seem to hand it]. -- http://mail.python.org/mailman/listinfo/python-list
Re: Print to an IPP printer (pkipplib?)
On 1/10/2011 10:40 AM Adam Tauno Williams said... First I have to make a text stream into a PDF, so I have something to send. Surprisingly I've been able to find no code to steal which does that; which means it will take longer. :( reportlab? [clumsily thunking out to commands like a2ps, etc... is strictly forbidden in this code-base; and that seems how a lot of people seem to hand it]. -- http://mail.python.org/mailman/listinfo/python-list
Re: Print to an IPP printer (pkipplib?)
On Mon, 2011-01-10 at 10:49 -0800, Emile van Sebille wrote: On 1/10/2011 10:40 AM Adam Tauno Williams said... First I have to make a text stream into a PDF, so I have something to send. Surprisingly I've been able to find no code to steal which does that; which means it will take longer. :( reportlab? Possibly, there is that an pyPdf. I've found http://python.net/~gherman/py2pdf.html recently, but haven't had time to take it apart yet [and the license looks OK, other code snippets I've found were explicitly GPL so I couldn't look at those]. [clumsily thunking out to commands like a2ps, etc... is strictly forbidden in this code-base; and that seems how a lot of people seem to hand it]. -- http://mail.python.org/mailman/listinfo/python-list
[ANN] cdecimal-2.2 released
Hi, I'm pleased to announce the release of cdecimal-2.2. cdecimal is a fast drop-in replacement for the decimal module in Python's standard library. Blurb = cdecimal is a complete implementation of IBM's General Decimal Arithmetic Specification. With the appropriate context parameters, cdecimal will also conform to the IEEE 754-2008 Standard for Floating-Point Arithmetic. Typical performance gains over decimal.py are between 30x for I/O heavy benchmarks and 80x for numerical programs. In a PostgreSQL database benchmark, the speedup is 12x. +-+-+--+-+ | | decimal | cdecimal | speedup | +=+=+==+=+ | pi|42.75s |0.58s | 74x | +-+-+--+-+ | telco | 172.19s |5.68s | 30x | +-+-+--+-+ | psycopg | 3.57s |0.29s | 12x | +-+-+--+-+ In the pi benchmark, cdecimal often performs better than Java's BigDecimal running on Java HotSpot(TM) 64-Bit Server VM. Both cdecimal and the underlying library - libmpdec - have very large test suites. libmpdec has 100% code coverage, cdecimal 85%. The test suites have been running continuously for over a year without any major issues. Install === Since cdecimal is now listed on PyPI, it can be installed using pip: pip install cdecimal Windows installers are available at: http://www.bytereef.org/mpdecimal/download.html Links = http://www.bytereef.org/mpdecimal/index.html http://www.bytereef.org/mpdecimal/changelog.html http://www.bytereef.org/mpdecimal/download.html Checksums of the released packages == sha256sum - 3d92429fab74ddb17d12feec9cd949cd8a0be4bc0ba9afc5ed9b3af884e5d406 mpdecimal-2.2.tar.gz e8f02731d4089d7c2b79513d01493c36ef41574423ea3e49b245b86640212bdc mpdecimal-2.2.zip 515625c5c5830b109c57af93d49ae2c57ec3f230d46a3e0583840ff73d7963be cdecimal-2.2.tar.gz sha1sum --- 24695b2c9254e1b870eb663e3d966eb4f0abd5ab cdecimal-2.2.win32-py2.6.msi e74cb7e722f30265b408b322d2c50d9a18f78587 cdecimal-2.2.win32-py2.7.msi 7c39243b2fc8b1923ad6a6066536982844a7617f cdecimal-2.2.win32-py3.1.msi 5711fd69a8e1e2e7be0ad0e6b93ecc10aa584c68 cdecimal-2.2.win-amd64-py2.6.msi b1cd7b6a373c212bf2f6aa288cd767171bfefd41 cdecimal-2.2.win-amd64-py2.7.msi f08a803a1a42a2d8507da1dc49f3bf7eed37c332 cdecimal-2.2.win-amd64-py3.1.msi cb29fa8f67befaf2d1a05f4675f840d7cd35cf6c cdecimal-2.2-no-thread.win32-py2.6.msi 012a44488f2ce2912f903ae9faf995efc7c9324b cdecimal-2.2-no-thread.win32-py2.7.msi 1c08c73643fc45d7b0feb62c33bebd76537f9d02 cdecimal-2.2-no-thread.win32-py3.1.msi b6dbd92e86ced38506ea1a6ab46f2e41f1444eae cdecimal-2.2-no-thread.win-amd64-py2.6.msi b239b41e6958d9e71e91b122183dc0eaefa00fef cdecimal-2.2-no-thread.win-amd64-py2.7.msi 413724ff20ede7b648f57dd9a78a12e72e064583 cdecimal-2.2-no-thread.win-amd64-py3.1.msi Stefan Krah -- http://mail.python.org/mailman/listinfo/python-list
Python use growing fast
I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html The gist is: Python grew faster than any other programming language over the last year, according to this (slightly arbitrary, but better than no indicator) ranking. ...despite our wikipedia page whose first paragraph almost seems like it was written with the intention of scaring off new converts, with its unusual comment: http://en.wikipedia.org/wiki/Python_%28programming_language%29 (Like it or not, people do frequently confuse the descriptive for the normative) -- http://mail.python.org/mailman/listinfo/python-list
arbeitsamt jobs ausland , stellenangebot in ausland , Berufskraftfahrer Berufskraftfahrerin , Maler Malerin , stellenanzeigen jobboerse , arbeitsvermittlung , Meteorologe Meteorologin , jobs und prakt
arbeitsamt jobs ausland , stellenangebot in ausland , Berufskraftfahrer Berufskraftfahrerin , Maler Malerin , stellenanzeigen jobboerse , arbeitsvermittlung , Meteorologe Meteorologin , jobs und praktika im ausland 2007 , Innenarchitekt Innenarchitektin , + + + +++ TOPJOB AUSLAND +++ IM AUSLAND ARBEITEN +++ + + http://WWW.AUSLANDS-JOB.ORG http://WWW.AUSLANDS-JOB.ORG http://WWW.AUSLANDS-JOB.ORG http://WWW.AUSLANDS-JOB.ORG http://WWW.AUSLANDS-JOB.ORG http://WWW.AUSLANDS-JOB.ORG + + + + + + + + ehrenamtlich arbeiten im ausland Polizeivollzugsbeamte Polizeivollzugsbeamter Mediengestalter Bild und Ton www ausland jobs stellenangebote fuers ausland ausland jobs de jobboerse angebote stellenanzeigen ausland außendienstmitarbeiter jobs im ausland australien jobboersen ausland berufe ausland Maurer Maurerin arbeiten im ausland steuern Tieraerztin Tierarzt auswandern jobs im ausland praktikum im ausland Event-Manager Event-Managerin Industriemechaniker Industriemechanikerin jobsuche jobboerse Restaurantfachfrau Restaurantfachmann Journalist Journalistin will im ausland arbeiten jobangebote ausland jobboerse arbeitgeber Personalreferent Personalreferentin jobboerse bayern Kauffrau audiovisuelle Medien www arbeiten im ausland Hebamme -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html The gist is: Python grew faster than any other programming language over the last year, according to this (slightly arbitrary, but better than no indicator) ranking. ...despite our wikipedia page whose first paragraph almost seems like it was written with the intention of scaring off new converts, with its unusual comment: http://en.wikipedia.org/wiki/Python_%28programming_language%29 (Like it or not, people do frequently confuse the descriptive for the normative) It shows an example of Python code, which happens to have 2 syntax errors! -- http://mail.python.org/mailman/listinfo/python-list
Re: Resolve circular reference
On Jan 10, 7:18 pm, Stefan Behnel stefan...@behnel.de wrote: moerchendiser2k3, 10.01.2011 18:55: If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Thanks for your answer! In my case the types A and B (in my example above) are a dialog and a dialog widget. At a special time I have to close and destroy all dialogs but this does not happen because the widget keeps the dialog alive. I have the reference to the dialog but after I closed the dialogs I also would like to destroy them because they have to free some special ressources. Objects within a reference cycle will eventually get cleaned up, just not right away and not in a predictable order. If you need immediate cleanup, you should destroy the reference cycle yourself, e.g. by removing the widgets from the dialog when closing it. Stefan The PyWidget type does not own the widget, it just points to it. I have an idea, would this fix the problem? I destroy the internal dictionary of the dialog which points to other PyObjects? Then I would cut the dependency. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 2011-01-10 13:02:09 -0800, MRAB said: On 10/01/2011 20:29, Dan Stromberg wrote: ...despite our wikipedia page whose first paragraph almost seems like it was written with the intention of scaring off new converts, with its unusual comment... Indentation as a syntatitical structure is not actually unusual in any way as was recently discussed in another thread (having difficulty finding it). It shows an example of Python code, which happens to have 2 syntax errors! Wikipedia is a Wiki; everyone is free to contribute and correct mistakes. - Alice. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html The gist is: Python grew faster than any other programming language over the last year, according to this (slightly arbitrary, but better than no indicator) ranking. And look at the Hall of Fame. Python is the first language to win the popularity award twice. Although the statistical population isn't really extensive... -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 1/10/2011 1:02 PM, MRAB wrote: On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html That's somehow derived from web searches, not from any real data source. Look how far down JavaScript is. John Nagle -- http://mail.python.org/mailman/listinfo/python-list
Compiling and Executing a Python byte coded program
If interested with, have a look to http://vouters.dyndns.org/tima/All-OS-Python-Compiling_a_Python_Program_and_Executing_the_compiled_version.html Note you may boost your Python's startup time but not the execution speed of your program which depends on the generated byte code. -- http://mail.python.org/mailman/listinfo/python-list
Centering a window
I am using PyQt4 for GUI apps. I created a class that contains a function to center any window (Form) whose name is passed to this class. I have two questions: How to modify the below given code to center the window whose name we passed as an argument.How to pass window name to this class from another file that imports this class? = CODE BLOCK STARTS HERE ===from PyQt4 import QtGui class PositionWindow:def __init__(self, xCoord, yCoord, windowName, parent = None): self.x = xCoord self.y = yCoord self.wName = windowName;def center(self):screen = QtGui.QDesktopWidget().screenGeometry()size = self.geometry() self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2)= CODE BLOCK ENDS HERE === Rohit K.elementFontfont-familyfont-sizefont-stylefont-variantfont-weightletter-spacingline-heighttext-decorationtext-aligntext-indenttext-transformwhite-spaceword-spacingcolorBackgroundbg-attachmentbg-colorbg-imagebg-positionbg-repeatBoxwidthheightborder-topborder-rightborder-bottomborder-leftmarginpaddingmax-heightmin-heightmax-widthmin-widthoutline-coloroutline-styleoutline-widthPositioningpositiontopbottomrightleftfloatdisplayclearz-indexListlist-style-imagelist-style-typelist-style-positionTablevertical-alignborder-collapseborder-spacingcaption-sideempty-cellstable-layoutEffectstext-shadow-webkit-box-shadowborder-radiusOtheroverflowcursorvisibility -- http://mail.python.org/mailman/listinfo/python-list
String to char and decimal number conversion
Hello There, I am from non IT field also new to python programming.Could you please help me to solve the following problem? I have a list T1 with following format: T1 = [ *' *Field* **' , ' *12.5* **', ' *2.5* ']* * * How do get the list elements without double quote in my output (T2). T2 =[ *' *Field* **' , ' *12.5 *', ' *2.5* ']* Thanks Sankar -- http://mail.python.org/mailman/listinfo/python-list
Re: String to char and decimal number conversion
On Mon, Jan 10, 2011 at 2:44 PM, SANKAR . shankar...@gmail.com wrote: Hello There, I am from non IT field also new to python programming.Could you please help me to solve the following problem? I have a list T1 with following format: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] How do get the list elements without double quote in my output (T2). T2 =[ ' Field ' , ' 12.5 ', ' 2.5 '] How are you obtaining T1 in the first place? Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On Mon, Jan 10, 2011 at 2:29 PM, John Nagle na...@animats.com wrote: On 1/10/2011 1:02 PM, MRAB wrote: On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html That's somehow derived from web searches, not from any real data source. Look how far down JavaScript is. Also depends on how one defines popularity in the context of programming languages. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: Absolute imports?
Roy Smith r...@panix.com writes: Ben Finney ben+pyt...@benfinney.id.au wrote: What is the problem you're trying to solve? It is likely we can suggest a better solution. Well, the problem I'm trying to solve is that I have an absolute pathname to a python source file that I want to import as a module :-) And then have it available in the code under what name? It is important to realise that ‘import’ does many things. Among the many things it does (see the Python documentation for more) it executes the code within a namespace, and then binds that namespace to a name that is specified in the ‘import’ statement. The filesystem path (if any!) is derived from the name that the module will be bound to within the code. That'w why the indirection of ‘sys.path’ is necessary: it keeps the mapping between module names and filesystem paths. The best I can describe how to find the location of the config file is, Work your way up the directory tree from where you are now, (i.e. following '..' links) until you get to the top level of the project, then from there, it's ./code/configs/autogen/config.py. One way to keep the import mechanism working with that situation would be to: * compute the path: ‘config_dir_path = your_algorithm_above()’ * add the path to the search list: ‘sys.path.append(config_dir_path)’ * import the config module: ‘import config’ The module is then available under the name ‘config’. It's reasonably straight-forward to figure out that absolute path, starting from sys.argv[0] and using the tools in os.path. Now I need to import the file, given that I know its absolute pathname. It looks like imp.load_source() does what I want, I'm just wondering if there's a cleaner way. I think ‘imp.load_source’ is not as clean as the steps I describe above, given the rest of the ‘import’ job that needs to be done. Given that modules in Python form a namespace hierarchy, it's unusual and discouraged to import files from arbitrary parts of the filesystem. -- \ “I must say that I find television very educational. The minute | `\ somebody turns it on, I go to the library and read a book.” | _o__)—Groucho Marx | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: What INI config file module allows lists of duplicate same-named options?
Thomas L. Shinnick tshin...@io.com writes: Here, I need to list multiple file/dir path pairs. A list of multiple items to be acted upon in a common way. It is a list. Simple. Except I can't find a library/pypi module with the obvious extension. What you want is incompatible with calling the result “an INI file”, because that entails the restrictions you described. You would be better advised to use a configuration format that can do what you want, such as YAML or JSON. Both of those have good Python support; JSON in particular has support in the standard library. -- \ “Saying that Java is nice because it works on all OSes is like | `\ saying that anal sex is nice because it works on all genders” | _o__)—http://bash.org/ | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: What INI config file module allows lists of duplicate same-named options?
On Jan 10, 2011, at 6:05 PM, Ben Finney wrote: Thomas L. Shinnick tshin...@io.com writes: Here, I need to list multiple file/dir path pairs. A list of multiple items to be acted upon in a common way. It is a list. Simple. Except I can't find a library/pypi module with the obvious extension. What you want is incompatible with calling the result “an INI file”, because that entails the restrictions you described. I dunno about that. The INI file format isn't standardized so there aren't restrictions on what one can expect to find in an INI file other than people's expectations. I'll grant you that most INI files don't have (or expect) duplicate keys in a section, but I've seen some that do. You would be better advised to use a configuration format that can do what you want, such as YAML or JSON. Both of those have good Python support; JSON in particular has support in the standard library. I second that, and the point above (about there being no standard that governs INI files) is another reason to avoid them. Some INI file libraries expect a hash mark as a comment, some expect semicolon, some make no allowances for non-ASCII encodings, some expect UTF-8 or ISO-8859-1 or Win-1252, some only allow '=' as the key/value separator, some allow other characters. INI files are nice and simple but there's devils in those details. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list
Re: Absolute imports?
Ben Finney ben+pyt...@benfinney.id.au writes: The filesystem path (if any!) is derived from the name that the module will be bound to within the code. That'w why the indirection of ‘sys.path’ is necessary: it keeps the mapping between module names and filesystem paths. That phrasing gives the wrong impression; ‘sys.path’ doesn't store that mapping. I meant only that the indirection of ‘sys.path’ is necessary to allow Python to maintain that mapping at import time. -- \ “This world in arms is not spending money alone. It is spending | `\ the sweat of its laborers, the genius of its scientists, the | _o__) hopes of its children.” —Dwight Eisenhower, 1953-04-16 | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: String to char and decimal number conversion
Hi Chris , Thanks for your response. I am reading a Test.txt (see atatchment) file using following code to get the T2: F =open('C:\Test.txt','r') T1 = F.readlines() for i in range(len(T1)): T2 = T1[i].split(',') print(T2) Regards Sankar On Tue, Jan 11, 2011 at 10:02 AM, Chris Rebert c...@rebertia.com wrote: On Mon, Jan 10, 2011 at 2:44 PM, SANKAR . shankar...@gmail.com wrote: Hello There, I am from non IT field also new to python programming.Could you please help me to solve the following problem? I have a list T1 with following format: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] How do get the list elements without double quote in my output (T2). T2 =[ ' Field ' , ' 12.5 ', ' 2.5 '] How are you obtaining T1 in the first place? Cheers, Chris -- http://blog.rebertia.com {\rtf1\ansi\ansicpg1252\deff0\deflang3081{\fonttbl{\f0\fnil\fcharset0 Courier New;}{\f1\fswiss\fcharset0 Arial;}} {\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 FIELD_DEF,Site 01,,0,,28.89,179.00,,M1Synergy,Fixed,Xrays,6,,600,100.0,86.6,0.0,180.0,ASY,0.0,-8.0,7.9,ASY,0.0,-5.5,5.50.0,0.0,,57636\par CONTROL_PT_DEF,0,2,40,28,0,1,0.00,,6,600,86.6,2,0.0,,180.0,,ASY,0.0,-8.0,7.9,ASY,0.0,-5.5,5.5,0.0,0.0,,0.0,,0.0,,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-5.53,-6.52,-7.04,-7.50,-8.00,-8.00,-4.85,-4.66,-5.84,-5.97,-5.91,-6.43,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,0.98,5.55,6.36,6.78,6.75,6.86,7.08,7.81,7.65,7.73,6.97,7.49,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,30539\par CONTROL_PT_DEF,0,2,40,28,1,1,0.084884,2,ASY,0.0,-8.0,7.9,ASY,0.0,-5.5,5.5,0.0,0.0,,0.0,,0.0,,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-2.25,-5.53,-6.52,-7.04,-7.50,-8.00,-8.00,-4.85,-4.66,-5.84,-5.97,-5.91,-6.43,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,-1.75,0.98,5.55,6.36,6.78,6.75,6.86,7.08,7.81,7.65,7.73,6.97,7.49,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,61090\par \f1\par } -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On Mon, Jan 10, 2011 at 2:29 PM, John Nagle na...@animats.com wrote: On 1/10/2011 1:02 PM, MRAB wrote: On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html That's somehow derived from web searches, not from any real data source. Look how far down JavaScript is. Please define real data source, and give examples... ^_^ -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 1/10/2011 4:43 PM, Alice Bevan–McGregor wrote: It shows an example of Python code, which happens to have 2 syntax errors! Wikipedia is a Wiki; everyone is free to contribute and correct mistakes. The errors, if there, are in .png and .svg images of a random, unrunnable snippet that will disappear in a week (at least the .png) due to lack of copyright release. A complete example that runs, pulled from the tutorial, would be good. I have no idea how to produce those types of images from code. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: apscheduler error
Thank you for all the replies here! I will try your suggestions. On Jan 7, 11:03 pm, Alice Bevan–McGregor al...@gothcandy.com wrote: Howdy! On 2011-01-07 17:08:28 -0800, linna li said: I tried to use the apscheduler and used the sample code below from the tutorial, but got the error message: Exception in thread APScheduler (most likely raised during interpreter shutdown). What's going on here? I really appreciate any help! After talking a bit with Alex Grönholm it seems this is an issue raised fairly often (not always in the context of this package) and is not really a problem with APScheduler. It has far more to do with attempting to start a thread, then immediately exiting the main thread. That's not how threading is supposed to be used, so don't do it. ;) APScheduler 2.0 adds some improved examples, according to Alex, that don't suffer the problem demonstrated by the short code snippit you provided. A package of mine, TurboMail, suffers from the same threading issue if used improperly; you enqueue e-mail, it starts a thread, then you immediately exit. TM tries to work around the issue, but in most cases that workaround does not work properly. (You get strange uncatchable exceptions printed on stderr though AFIK the e-mail does get sent correctly, your application may hang waiting for the thread pool to drain if you have a minimum thread count option set.) I hope this clears things up a bit, - Alice. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
Also depends on how one defines popularity in the context of programming languages. Tiobe quite clearly states what they mean by the name popularity. Namely the number of Google search results of expressions like programming X for X in languages. If no one in the Web writes about programming JavaScript then obviously it's not popular... sort of. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On Mon, Jan 10, 2011 at 10:29 PM, John Nagle na...@animats.com wrote: On 1/10/2011 1:02 PM, MRAB wrote: On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html That's somehow derived from web searches, not from any real data source. Look how far down JavaScript is. Any measure is arbitrary and subject to biases, what methodology would you prefer ? Katie -- CoderStack http://www.coderstack.co.uk/python-jobs The Software Developer Job Board -- http://mail.python.org/mailman/listinfo/python-list
Re: apscheduler error
On Jan 7, 11:03 pm, Alice Bevan–McGregor al...@gothcandy.com wrote: Howdy! On 2011-01-07 17:08:28 -0800, linna li said: I tried to use the apscheduler and used the sample code below from the tutorial, but got the error message: Exception in thread APScheduler (most likely raised during interpreter shutdown). What's going on here? I really appreciate any help! After talking a bit with Alex Grönholm it seems this is an issue raised fairly often (not always in the context of this package) and is not really a problem with APScheduler. It has far more to do with attempting to start a thread, then immediately exiting the main thread. That's not how threading is supposed to be used, so don't do it. ;) APScheduler 2.0 adds some improved examples, according to Alex, that don't suffer the problem demonstrated by the short code snippit you provided. A package of mine, TurboMail, suffers from the same threading issue if used improperly; you enqueue e-mail, it starts a thread, then you immediately exit. TM tries to work around the issue, but in most cases that workaround does not work properly. (You get strange uncatchable exceptions printed on stderr though AFIK the e-mail does get sent correctly, your application may hang waiting for the thread pool to drain if you have a minimum thread count option set.) I hope this clears things up a bit, - Alice. I see the latest version is APScheduler 1.3.1. Where can I get APScheduler 2.0? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 01/10/2011 08:31 PM, Katie T wrote: On Mon, Jan 10, 2011 at 10:29 PM, John Nagle na...@animats.com wrote: On 1/10/2011 1:02 PM, MRAB wrote: On 10/01/2011 20:29, Dan Stromberg wrote: I invite folks to check out Tiobe's Language Popularity Rankings: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html That's somehow derived from web searches, not from any real data source. Look how far down JavaScript is. Any measure is arbitrary and subject to biases, what methodology would you prefer ? Katie Measuring the Buzz about a language is actually a pretty good way to gauge its popularity. . -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On Mon, Jan 10, 2011 at 5:22 PM, Krzysztof Bieniasz krzysztof.t.bieni...@gmail.com wrote: Also depends on how one defines popularity in the context of programming languages. Tiobe quite clearly states what they mean by the name popularity. Namely the number of Google search results of expressions like programming X for X in languages. If no one in the Web writes about programming JavaScript then obviously it's not popular... sort of. -- http://mail.python.org/mailman/listinfo/python-list About JavaScript's popularity: 1) I've been getting the impression that JavaScript is popular in a manner similar to how x86 machine language is popular: That is, it's used all over, but few people hand code it (though admittedly, there are probably more people hand coding JavaScript than people hand coding x86 assembler today) 2) JavaScript seems widely considered a bit of a mess, and yet, many tools make use of it because it's in almost all web browsers 3) It seems that when JavaScript does get used directly, it tends to be done in small snippets, like inline assembler in C or C++ 4) It appears that there is quite a few different tools (one of them, our own Pyjamas, and to a lesser extent, Django - and of course GWT though that's only tenuously related to Python through Pyjamas) that attempt to take the pain out of writing JavaScript IOW, I'm not convinced that Tiobe's ranking of JavaScript is inaccurate, or even weakly correlated with reality. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
On 01/10/2011 10:24 PM, Dan Stromberg wrote: On Mon, Jan 10, 2011 at 5:22 PM, Krzysztof Bieniasz krzysztof.t.bieni...@gmail.com wrote: Also depends on how one defines popularity in the context of programming languages. Tiobe quite clearly states what they mean by the name popularity. Namely the number of Google search results of expressions like programming X for X in languages. If no one in the Web writes about programming JavaScript then obviously it's not popular... sort of. -- http://mail.python.org/mailman/listinfo/python-list About JavaScript's popularity: 1) I've been getting the impression that JavaScript is popular in a manner similar to how x86 machine language is popular: That is, it's used all over, but few people hand code it (though admittedly, there are probably more people hand coding JavaScript than people hand coding x86 assembler today) 2) JavaScript seems widely considered a bit of a mess, and yet, many tools make use of it because it's in almost all web browsers 3) It seems that when JavaScript does get used directly, it tends to be done in small snippets, like inline assembler in C or C++ 4) It appears that there is quite a few different tools (one of them, our own Pyjamas, and to a lesser extent, Django - and of course GWT though that's only tenuously related to Python through Pyjamas) that attempt to take the pain out of writing JavaScript IOW, I'm not convinced that Tiobe's ranking of JavaScript is inaccurate, or even weakly correlated with reality. The biggest use of JavaScript I've seen is browser-based games using them for some display magic, windows popping up etc. Their back-end is still VB.NET (or x framework), and none of the lifting is done by JavaScript. -- http://mail.python.org/mailman/listinfo/python-list
Re: apscheduler error
On 2011-01-10 17:23:34 -0800, linna li said: I see the latest version is APScheduler 1.3.1. Where can I get APScheduler 2.0? https://bitbucket.org/agronholm/apscheduler/ I don't think 2.0 has been released yet, but that is the version number in apscheduler/__init__.py on HG tip. The examples, BTW, just add time.sleep() calls. ;) - Alice. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python use growing fast
In article mailman.710.1294716287.6505.python-l...@python.org, Dan Stromberg drsali...@gmail.com wrote: About JavaScript's popularity: 1) I've been getting the impression that JavaScript is popular in a manner similar to how x86 machine language is popular: That is, it's used all over, but few people hand code it (though admittedly, there are probably more people hand coding JavaScript than people hand coding x86 assembler today) One of the surprising (to me, anyway) uses of JavaScript is as the scripting language for MongoDB (http://www.mongodb.org/). -- http://mail.python.org/mailman/listinfo/python-list
Re: String to char and decimal number conversion
On 1/10/2011 6:02 PM, Chris Rebert wrote: On Mon, Jan 10, 2011 at 2:44 PM, SANKAR .shankar...@gmail.com wrote: Hello There, I am from non IT field also new to python programming.Could you please help me to solve the following problem? I have a list T1 with following format: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] How do get the list elements without double quote in my output (T2). T2 =[ ' Field ' , ' 12.5 ', ' 2.5 '] This will do it: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] T2 = [] for t in T1: T2.append(t.replace('', '')) The replace function acts on each element in T1, replacing every double quote with nothing. We then append that to the new list T2. Alan -- http://mail.python.org/mailman/listinfo/python-list
importing modules dynamicly
I am trying to import modules dynamicly from a directory (modules/) in which i have __init__.py with the __all__ variable set. Everything imports correctly and I have verified this however I am stuck on actually using my classes in the dynamicly imported modules. this bit is in my main.py (or base script) to import the modules in the modules/ directory: loaded_modules = [] for item in modules: if item == '__init__.py': pass else: if item.endswith('.py'): __import__('modules.' + item[0:len(item) - 3]) loaded_modules.append(item[0:len(item) - 3]) else: pass After loading all the modules, i try to do something like: instance = modules.modulename.class() And I get an AttributeError. What am I doing wrong here? Help please!! -- http://mail.python.org/mailman/listinfo/python-list
You can get careers in Management work.
Great careers in Management work. Management careers bases. http://topcareer.webs.com/executivemanager.htm http://rojgars1.webs.com/gov.htm -- http://mail.python.org/mailman/listinfo/python-list
Re: String to char and decimal number conversion
Thanks Alan! -Sankar On Tue, Jan 11, 2011 at 2:50 PM, Alan Meyer amey...@yahoo.com wrote: On 1/10/2011 6:02 PM, Chris Rebert wrote: On Mon, Jan 10, 2011 at 2:44 PM, SANKAR .shankar...@gmail.com wrote: Hello There, I am from non IT field also new to python programming.Could you please help me to solve the following problem? I have a list T1 with following format: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] How do get the list elements without double quote in my output (T2). T2 =[ ' Field ' , ' 12.5 ', ' 2.5 '] This will do it: T1 = [ ' Field ' , ' 12.5 ', ' 2.5 '] T2 = [] for t in T1: T2.append(t.replace('', '')) The replace function acts on each element in T1, replacing every double quote with nothing. We then append that to the new list T2. Alan -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: importing modules dynamicly
On Mon, 10 Jan 2011 20:42:17 -0800, dubux wrote: After loading all the modules, i try to do something like: instance = modules.modulename.class() No you don't. class is a reserved word in Python, you would get a SyntaxError if you did that. Please post the error you get, including the complete traceback, showing the line of code that fails. Copy and paste the *actual* message in full, don't retype it from memory, paraphrase it, simplify it, translate it into Swahili, or otherwise change it in anyway. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Ideas for a module to process command line arguments
On 2011-01-10 21:18:41 -0800, Sohail said: Hey, every body has their own favorite method/ways to process command line arguments. I've worked on a little CPython extension to handle command line arguments may be you'll find it interesting and useful Even I've implemented my own way to handle command-line scripts, marrow.script: https://github.com/pulp/marrow.script The idea with mine that you write a Python function... and that's it. The latest version has experimental support for class-based subcommand dispatch, but it needs work, needs to be updated to support sub-sub commands, and the help text generator needs to be overhauled to support classes properly. The argument list, typecasting, etc. is built from the argspec. Help text is pulled from the docstring. Decorators are provided to override short names, define explicit callbacks or typecasting functions, etc. I got tired of using PasteScript and OptParse. Mostly OptParse, actually. :/ - Alice. -- http://mail.python.org/mailman/listinfo/python-list
Re: Resolve circular reference
moerchendiser2k3, 10.01.2011 22:19: On Jan 10, 7:18 pm, Stefan Behnel wrote: moerchendiser2k3, 10.01.2011 18:55: If you can tell us why it's so important that the object be destroyed at that given time, even while a reference to it exists, maybe we can give you better suggestions. Thanks for your answer! In my case the types A and B (in my example above) are a dialog and a dialog widget. At a special time I have to close and destroy all dialogs but this does not happen because the widget keeps the dialog alive. I have the reference to the dialog but after I closed the dialogs I also would like to destroy them because they have to free some special ressources. Objects within a reference cycle will eventually get cleaned up, just not right away and not in a predictable order. If you need immediate cleanup, you should destroy the reference cycle yourself, e.g. by removing the widgets from the dialog when closing it. Stefan The PyWidget type does not own the widget, it just points to it. I have an idea, would this fix the problem? I destroy the internal dictionary of the dialog which points to other PyObjects? Then I would cut the dependency. Sure, that should work. Stefan -- http://mail.python.org/mailman/listinfo/python-list
[issue10879] cgi memory usage
New submission from Glenn Linderman v+pyt...@g.nevcal.com: In attempting to review issue 4953, I discovered a conundrum in handling of multipart/formdata. cgi.py has claimed for some time (at least since 2.4) that it handles file storage for uploading large files. I looked at the code in 2.6 that handles such, and it uses the rfc822.Message method, which parses headers from any object supporting readline(). In particular, it doesn't attempt to read message bodies, and there is code in cgi.py to perform that. There is still code in 3.2 cgi.py to read message bodies, but... rfc822 has gone away, and been replaced with the email package. Theoretically this is good, but the cgi FieldStorage read_multi method now parses the whole CGI input and then iteration parcels out items to FieldStorage instances. There is a significant difference here: email reads everything into memory (if I understand it correctly). That will never work to upload large or many files when combined with a Web server that launches CGI programs with memory limits. I see several possible actions that could be taken: 1) Documentation. While it is doubtful that any is using 3.x CGI, and this makes it more doubtful, the present code does not match the documentation, because while the documenteation claims to handle file uploads as files, rather than in-memory blobs, the current code does not do that. 2) If there is a method in the email package that corresponds to rfc822.Message, parsing only headers, I couldn't find it. Perhaps it is possible to feed just headers to BytesFeedParser, and stop, and get the same sort of effect. However, this is not the way the cgi.py presently is coded. And if there is a better API, for parsing only headers, that is or could be exposed by email, that might be handy. 3) The 2.6 cgi.py does not claim to support nested multipart/ stuff, only one level. I'm not sure if any present or planned web browsers use nested multipart/ stuff... I guess it would require a nested form tag? which is illegal HTML last I checked. So perhaps the general logic flow of 2.6 cgi.py could be reinstated, with a technique to feed only headers to BytesFeedParser, together with reinstating the MIME body parsing in cgi.py,b and this could make a solution that works. I discovered this, beacuase I couldn't figure out where a bunch of the methods in cgi.py were called from, particularly read_lines_to_outerboundary, and make_file. They seemed to be called much too late in the process. It wasn't until I looked back at 2.6 code that I could see that there was a transition from using rfc822 only for headers to using email for parsing the whole data stream, and that that was the cause of the documentation not seeming to match the code logic. I have no idea if this problem is in 2.7, as I don't have it installed here for easy reference, and I'm personally much more interested in 3.2. -- components: Library (Lib) messages: 125884 nosy: r.david.murray, v+python priority: normal severity: normal status: open title: cgi memory usage versions: Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10879 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0
Glenn Linderman v+pyt...@g.nevcal.com added the comment: This looks much simpler than the previous patch. However, I think it can be further simplified. This is my first reading of this code, however, so I might be totally missing something(s). Pierre said: Besides FieldStorage, I modified the parse() function at module level, but not parse_multipart (should it be kept at all ?) I say: Since none of this stuff works correctly in 3.x, and since there are comments in the code about folding the parse* functions into FieldStorage, then I think they could be deprecated, and not fixed. If people are still using them, by writing code to work around their deficiencies, that code would continue to work for 3.2, but then not in 3.3 when that code is removed? That seems reasonable to me. In this scenario, the few parse* functions that are used by FieldStorage should be copied into FieldStorage as methods (possibly private methods), and fixed there, instead of being fixed in place. That was all the parse* functions could be deprecated, and the use of them would be unchanged for 3.2. Since RFC 2616 says that the HTTP protocol uses ISO-8859-1 (latin-1), I think that should be required here, instead of deferring to fp.encoding, which would eliminate 3 lines. Also, the use of FeedParser could be replaced by BytesFeedParser, thus eliminating the need to decode header lines in that loop. And, since this patch will be applied only to Python 3.2+, the mscvrt code can be removed (you might want a personal copy with it for earlier version of Python 3.x, of course). I wonder if the 'ascii' reference should also be 'latin-1'? In truly reading and trying to understand this code to do a review, I notice a deficiency in _parseparam and parse_header: should I file new issues for them? (perhaps these are unimportant in practice; I haven't seen \ escapes used in HTTP headers). RFC 2616 allows for which are handled in _parseparam. And for \c inside , which is handled in parse_header. But: _parseparam counts without concern for \, and parse_header allows for \\ and \ but not \f or \j or \ followed by other characters, even though they are permitted (but probably not needed for much). In make_file, shouldn't the encoding and newline parameters be preserved when opening text files? On the other hand, it seems like perhaps we should leverage the power of IO to do our encoding/decoding... open the file with the TextIOBase layer set to the encoding for the MIME part, but then just read binary without decoding it, write it to the .buffer of the TextIOBase, and when the end is reached, flush it, and seek(0). Then the data can be read back from the TextIOBase layer, and it will be appropriate decoded. Decoding errors might be deferred, but will still occur. This technique would save two data operations: the explicit decode in the cgi code, and the implicit encode in the IO layers, so resources would be saved. Additionally, if there is a CONTENT-LENGTH specified for non-binary data, the read_binary method should be used for it also, because it is much more efficient than readlines... less scanning of the data, and fewer outer iterations. This goes well with the technique of leaving that data in binary until read from the file. It seems that in addition to fixing this bug, you are also trying to limit the bytes read by FieldStorage to some maximum (CONTENT_LENGTH). This is good, I guess. But skip_lines() has a readline potentially as long as 32KB, that isn't limited by the maximum. Similar in read_lines_to_outer_boundary, and read_lines_to_eof (although that may not get called in the cases that need to be limited). If a limit is to be checked for, I think it should be a true, exact limit, not an approximate limit. See also issue 10879. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Also, the required behavior of make_file changes, to need the right encoding, or binary, so that needs to be documented as a change for people porting from 2.x. It would be possible, even for files, which will be uploaded as binary, for a user to know the appropriate encoding and, if the file is to be processed rather than saved, supply that encoding for the temporary file. So the temporary file may not want to be assumed to be binary, even though we want to write binary to it. So similarly to the input stream, if it is TextIOBase, we want to write to the .buffer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10784] os.getpriority() and os.setpriority()
Giampaolo Rodola' g.rod...@gmail.com added the comment: Question: should Py_BEGIN/END_ALLOW_THREADS be used around getpriority() and setpriority() calls? It's still not clear to me when to use them exactly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10784 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10879] cgi memory usage
Glenn Linderman v+pyt...@g.nevcal.com added the comment: Trying to code some of this, it would be handy if BytesFeedParser.feed would return a status, indicating if it has seen the end of the headers yet. But that would only work if it is parsing as it goes, rather than just buffering, with all the real parsing work being done at .close time. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10879 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print utf8 (Py30a2)
David-Sarah Hopwood david-sa...@jacaranda.org added the comment: I'll have a look at the Py3k I/O internals and see what I can do. (Reopening a bug appears to need Coordinator permissions.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print utf8 (Py30a2)
Tim Golden m...@timgolden.me.uk added the comment: Reopening as there seems to be some possibility of progress -- nosy: -BreamoreBoy resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print utf8 (Py30a2)
Changes by Tim Golden m...@timgolden.me.uk: -- versions: +Python 3.3 -Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10875] Update Regular Expression HOWTO
SilentGhost ghost@gmail.com added the comment: While the changes all look innocuous to me with respect to building the docs, I am curious if you have tried to rebuild the HOWTO (if you have the tool chain, which I do not). I did rebuild the docs with 'make html'. Build was clean every time. If you meant something else please let me know. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10875 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0
Glenn Linderman v+pyt...@g.nevcal.com added the comment: I wrote: Additionally, if there is a CONTENT-LENGTH specified for non-binary data, the read_binary method should be used for it also, because it is much more efficient than readlines... less scanning of the data, and fewer outer iterations. This goes well with the technique of leaving that data in binary until read from the file. I further elucidate: Sadly, while the browser (Firefox) seems to calculate an overall CONTENT-LENGTH for the HTTP headers, it does not seem to calculate CONTENT-LENGTH for individual parts, not even file parts where it would be extremely helpful. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0
Glenn Linderman v+pyt...@g.nevcal.com added the comment: It seems the choice of whether to make_file or StringIO is based on the existence of self.length... per my previous comment, content-length doesn't seem to appear in any of the multipart/ item headers, so it is unlikely that real files will be created by this code. Sadly that seems to be the case for 2.x also, so I wonder now if CGI has ever properly saved files, instead of buffering in memory... I'm basing this off the use of Firefox Live HTTP headers tool. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10878] asyncore does not react properly on close()
Teodor Georgiev lv_tok...@yahoo.com added the comment: Sorry, I forgot to mention - I have already tried to return False, but there was no difference. def readable(self): if time.time() = self.timeout: self.close() return False else: return True -- resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10878] asyncore does not react properly on close()
Giampaolo Rodola' g.rod...@gmail.com added the comment: What if you return False also in writable method? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10876] Zipfile crashes when zip password is set to 610/844/numerous other numbers
Antoine Pitrou pit...@free.fr added the comment: Well, the password-checking scheme uses a one-byte check against the zip header for consistency. So there is a (near) 1/256 chance of false positives, that is of bad passwords mistakenly detected as good; then the ZipFile class proceeds with unarchiving and that's where things fail (because the decrypted stream is really junk). Therefore, I'd call it not a bug. If you want to crack a password, you need to trap this exception and interpret it as bad password. -- nosy: +pitrou resolution: - invalid status: open - closed type: crash - behavior versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10876 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10878] asyncore does not react properly on close()
Teodor Georgiev lv_tok...@yahoo.com added the comment: Precisely, I traced down the problem by putting a simple breakpoint in asyncore.py: def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): is_r = obj.readable() print Readable??? -- , is_r is_w = obj.writable() if is_r: r.append(fd) if is_w: w.append(fd) if is_r or is_w: e.append(fd) if [] == r == w == e: time.sleep(timeout) return print r,w,e try: r, w, e = select.select(r, w, e, timeout) except select.error, err: if err.args[0] != EINTR: raise else: return And here it comes: [5] [5] [5] Readable??? -- True [5] [5] [5] Readable??? -- True [5] [5] [5] Readable??? -- False [] [5] [5] Traceback (most recent call last): File ./dlms_client.py, line 136, in module asyncore.loop(timeout=0.8) File /usr/lib/python2.6/asyncore.py, line 213, in loop poll_fun(timeout) File /usr/lib/python2.6/asyncore.py, line 146, in poll raise File /usr/lib/python2.6/asyncore.py, line 143, in poll r, w, e = select.select(r, w, e, timeout) select.error: (9, 'Bad file descriptor') So, in order this to work, on first sight all r,w,e must not point to a socket that has been already closed. Now I am going to think for a workaround at least. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10878 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print utf8 (Py30a2)
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The script unicode2.py uses the console STD_OUTPUT_HANDLE iff sys.stdout.fileno()==1. But is it always the case? What about pythonw.exe? Also some applications may redirect fd=1: I'm sure that py.test does this http://pytest.org/capture.html#setting-capturing-methods-or-disabling-capturing and IIRC Apache also redirects file descriptors. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1602] windows console doesn't print utf8 (Py30a2)
STINNER Victor victor.stin...@haypocalc.com added the comment: amaury The script unicode2.py uses the console STD_OUTPUT_HANDLE iff amaury sys.stdout.fileno()==1 Interesting article about the Windows console: http://blogs.msdn.com/b/michkap/archive/2008/03/18/8306597.aspx There is an example which has many tests to check that stdout is the windows console (and not a pipe or something else). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1602 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-datain 3.0
STINNER Victor victor.stin...@haypocalc.com added the comment: Some comments on cgi_diff_20110109.txt, especially on FieldStorage constructor. Le dimanche 09 janvier 2011 13:26:24, vous avez écrit : Here is the diff file for the revised version of cgi.py +import msvcrt +msvcrt.setmode (0, os.O_BINARY) # stdin = 0 +msvcrt.setmode (1, os.O_BINARY) # stdout = 1 +msvcrt.setmode (2, os.O_BINARY) # stderr = 2 Why do you change stdout and stderr mode? Is it needed? Instead of 0, you should use sys.stdin.fileno() with a try/except on .fileno() because stdin can be a StringIO object: o=io.StringIO() o.fileno() io.UnsupportedOperation: fileno I suppose that it's better to do nothing if sys.stdin has no .fileno() method. More generally, I don't think that the cgi module should touch sys.stdin mode: it impacts the whole process, not only the cgi module. Eg. change sys.stdin mode in Python 3.1 will break the interperter because the Python parser in Pytohn 3.1 doesn't know how to handle \r\n end of line. If you need binary stdin, I should backport my patch for #10841 (for std*, FileIO and the parser). def __init__(self, fp=None, headers=None, outerboundary=, environ=os.environ, keep_blank_values=0, strict_parsing=0, limit=None): ... if 'QUERY_STRING' in environ: qs = environ['QUERY_STRING'] elif sys.argv[1:]: qs = sys.argv[1] else: qs = fp = BytesIO(qs.encode('ascii')) # bytes With Python 3.2, you should use environ=environ.os.environb by default to avoid unnecessary conversion (os.environb --decode-- os.environ --encode-- qs). To decode sys.argv, ASCII is not the right encoding: you should use qs.encode(locale.getpreferredencoding(), 'surrogateescape') because Python decodes the environment and the command line arguments from locale.getpreferredencoding()+'surrogateescape', so it is the exact reverse operation and you get the original raw bytes. For Python 3.1, use also qs.encode(locale.getpreferredencoding(), 'surrogateescape') to encode the environment variable. So for Python 3.2, it becomes something like: def __init__(self, fp=None, headers=None, outerboundary=, environ=os.environb, keep_blank_values=0, strict_parsing=0, limit=None): ... if 'QUERY_STRING' in environ: qs = environ[b'QUERY_STRING'] elif sys.argv[1:]: qs = sys.argv[1] else: qs = b if isinstance(qs, str): encoding = locale.getpreferredencoding() qs = qs.encode(encoding, 'surrogateescape')) fp = BytesIO(qs) If you would like to support byte *and* Unicode environment (eg. environ=os.environ and environ=os.environb), you should do something a little bit more complex: see os.get_exec_path(). I can work on a patch if you would like to. A generic function should maybe be added to the os module, function with an optional environ argument (as os.get_exec_path()). --- if fp is None: fp = sys.stdin if fp is sys.stdin: ... --- you should use sys.stdin.buffer if fp is None, and accept sys.stdin.buffer in the second test. Something like: --- stdin = sys.stdin if isinstance(fp,TextIOBase): stdin_buffer = stdin.buffer else: stdin_buffer = stdin if fp is None: fp = stdin_buffer if fp is stdin or fp is stdin_buffer: ... --- Don't you think that a warning would be appropriate if sys.stdin is passed here? --- # self.fp.read() must return bytes if isinstance(fp,TextIOBase): self.fp = fp.buffer else: self.fp = fp --- Maybe a DeprecationWarning if we would like to drop support of TextIOWrapper later :-) For the else case: you should maybe add a strict test on the type, eg. check for RawIOBase or BufferedIOBase subclass, isinstance(fp, (io.RawIOBase, io.BufferedIOBase)). It would avoid to check that fp.read() returns a bytes object (or get an ugly error later). Set sys.stdin.buffer.encoding attribute is not a good idea. Why do you modify fp, instead of using a separated attribute on FieldStorage (eg. self.fp_encoding)? --- # field keys and values (except for files) are returned as strings # an encoding is required to decode the bytes read from self.fp if hasattr(fp,'encoding'): self.fp.encoding = fp.encoding else: self.fp.encoding = 'latin-1' # ? --- I only read the constructor code. -- title: cgi module cannot handle POST with multipart/form-data in3.0 - cgi module cannot handle POST with multipart/form-datain 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0
Etienne Robillard e...@gthcfoundation.org added the comment: On 10/01/11 05:23 AM, Glenn Linderman wrote: I'm basing this off the use of Firefox Live HTTP headers tool. is sendfile() available on Windows ? i thought the Apache server could use that to upload files without having to buffer files in memory.. HTH, -- Etienne Robillard Company: Green Tea Hackers Club Occupation: Software Developer E-mail: e...@gthcfoundation.org Work phone: +1 514-962-7703 Website (Company): https://www.gthc.org/ Website (Blog): https://www.gthc.org/blog/ PGP public key fingerprint:F2A9 32EA 8E7C 460F 1728 A1A7 649C 7F17 A086 DDEC During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell -- title: cgi module cannot handle POST with multipart/form-datain 3.0 - cgi module cannot handle POST with multipart/form-data in3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4953 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10879] cgi memory usage
R. David Murray rdmur...@bitdance.com added the comment: The email package does have a 'parser headers only' mode, but it doesn't do what you want, since it reads the remainder of the file and sets it as the payload of the single, un-nested Message object it returns. Adding a flag to tell it to stop parsing instead of doing that will probably be fairly simple, but is a feature request. However, I'm not clear on how that helps. Doesn't FieldStorage also load everything into memory? There's an open feature request for providing a way to use alternate backing stores for the bodies of message parts in the email package, which *would* address this issue. -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10879 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10879] cgi memory usage
Changes by R. David Murray rdmur...@bitdance.com: -- versions: -Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10879 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10880] do_mkvalue and 'boolean'
New submission from Yuriy iro...@mail.ru: If a value created by Py_VaBuildValue and parameter b is transfered - a PyLong_Type value is returned despite of the fact that it would be reasonable if PyBool_Type were returned. Are there any reasons for this? modsupport.c Ln 214 -- messages: 125903 nosy: IROV priority: normal severity: normal status: open title: do_mkvalue and 'boolean' type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10880 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10866] Add sethostname()
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +pitrou stage: - patch review type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10866 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10880] do_mkvalue and 'boolean'
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: What makes you think it should be a boolean? in http://docs.python.org/py3k/c-api/arg.html#Py_BuildValue b means byte and is processed as a tiny integer. Now, that's true that Py_BuildValue could have a format for boolean values. Maybe with a ? parameter? -- nosy: +amaury.forgeotdarc type: behavior - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10880 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Daniel Urban urban.dani...@gmail.com added the comment: There is another return statement earlier in the ABCMeta.register method. The patch probably should also modify that. -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10225] Fix doctest runable examples in python manual
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: On Sun, Jan 9, 2011 at 3:52 PM, Terry J. Reedy rep...@bugs.python.org wrote: .. It would be nice to get the fixes into 3.2. Yes, it would be nice, but I don't have a 3.2 patch (yet). As you can see from my last comment, I ran into a bug in the alpha version of sphinx that I used to validate py3k docs. What sort of feedback do you want? Proofreading of text? Recheck of doctest? All of the above. Some of the fixes may be at the expense of readability. I would appreciate feedback in the instances when human and computer reader's interests are in conflict. Some examples are fixed by excluding them from being checked. Better ideas are welcome. Does sphinx suppress doctest comments like #doctest: +IGNORE_EXCEPTION_DETAIL ? Yes. doctest.testfile(C:/programs/PyDev/py32/Doc/howto/sorting.rst, module_relative = False) fails 23 of 37 attempts, so improvement is needed ;-). You cannot run documentation examples with a plain doctest. You have to use sphinx-build. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10225 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Edoardo Spadolini keri...@gmail.com added the comment: Whoops, corrected that - should I add some more tests for that too? -- nosy: -benjamin.peterson, durban, eric.araujo, gvanrossum, pitrou, rhettinger Added file: http://bugs.python.org/file20335/abcmeta_register_v4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Changes by Edoardo Spadolini keri...@gmail.com: -- nosy: +benjamin.peterson, durban, eric.araujo, gvanrossum, pitrou, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10784] os.getpriority() and os.setpriority()
Martin v. Löwis mar...@v.loewis.de added the comment: You should use begin/end allow threads when the system call might block. To get an indication, trace through the kernel code of some system; my guess is that these are typically non-blocking (i.e. return immediately) - but I might be wrong. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10784 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Éric Araujo mer...@netwok.org added the comment: You should, otherwise how would you prove it’s fixed? :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2320] Race condition in subprocess using stdin
Antoine Pitrou pit...@free.fr added the comment: I confirm that it works reliably under 3.2, while it hangs as reliably under 2.7 and 3.1. Since fixing involves a C extension that is too heavy to backport to bugfix branches, I suggest closing. By the way: triagers, please don't set stage to unit test needed. We don't need an unit test before a proper decision about the issue has been done, and actually we don't require reporters to write an unit test either (it's done as part of the patch, usually). -- nosy: +pitrou resolution: - out of date stage: unit test needed - status: open - pending versions: +Python 3.1 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2320 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10880] do_mkvalue and 'boolean'
Yuriy iro...@mail.ru added the comment: Thank you, how is it possible to ask the developers to add such a flag? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10880 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Edoardo Spadolini keri...@gmail.com added the comment: Fair enough :) -- Added file: http://bugs.python.org/file20336/abcmeta_register_v4_plus_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2568] Seconds range in time unit
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: The C89 draft as available through a Wikipedia link, http://flash-gordon.me.uk/ansi.c.txt, specifies tm_sec range as [0, 60]. Although it looks like the range has been extended in the published version. A discussion on comp.std.c describes the situation as follows: The double leap second is complete nonsense. It never existed outside the ANSI C standard and never will. It was introduced by the ANSI C 89 committee to document its problems understanding UTC issues. Someone heard that there are two prefered dates for leap seconds per year and this got munched up to the false rumour that UTC days can be up to 86402 seconds long. The definition of UTC, which requires that |UTC-UT1| 0.9 s all the time, obviously makes double leap seconds mathematically impossible. The latest publicly available standard that I was able to find that specifies [0, 61] range was The Single UNIX ® Specification, Version 2 from 1997: http://pubs.opengroup.org/onlinepubs/007908799/xsh/time.h.html Note that this range has been recognized as a mistake by Open Group: Problem: The valid range of seconds is no longer 0-61, a range chosen to accomodate the mythical double leap second. The correct range is 0-60 seconds. This has been fixed elsewhere in 1003.1-200x already. See for instance time.h. Action: Change range to 00-60 seconds. Search for any other places where the range is wrongly given as 0-61 and fix them too. [Ed recommendation: Accept as marked make the change , and add a note to the CH that The description of %S is updated so the valid range is 00-60 rather than 00-61. A search was done of the draft for other occurrences of 61 and none found. ] http://www.opengroup.org/austin/docs/austin_77r1.txt Compliance with the mistakes in old versions of various standards, does not seem like a valid goal for Python, but until a system is reported that misbehaves when tm_sec = 61 is passed to strftime, I don't see a compelling reason to change Python behavior. On the other hand, the documentation should not refer to bogus standards, so I suggest to change The range really is 0 to 61; according to the Posix standard this accounts for leap seconds and the (very rare) double leap seconds. The time module may produce and does accept leap seconds since it is based on the Posix standard ... to The range really is 0 to 61; tm_sec = 60 may be necessary to represent an occasional leap second and tm_sec = 61 is supported for historical reasons. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2568 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10880] do_mkvalue and 'boolean'
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This is the right place to ask... but it will be faster if someone provides a patch. -- keywords: +easy stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10880 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Changes by Edoardo Spadolini keri...@gmail.com: Removed file: http://bugs.python.org/file20336/abcmeta_register_v4_plus_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Changes by Edoardo Spadolini keri...@gmail.com: Added file: http://bugs.python.org/file20337/abcmeta_register_v4_plus_tests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10868] ABCMeta.register() should work as a decorator
Éric Araujo mer...@netwok.org added the comment: -return # Already a subclass +return subclass # Already a subclass PEP 8 advises to put two spaces before inline comments, for readability. (There is no need to upload a new patch, I’ll change that before commit.) +self.assertIsInstahce(c, (A,)) This is fixed in the newest version of your patch. Running tests before uploading diffs catches such errors :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10868 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10820] 3.2 Makefile changes for versioned scripts break OS X framework installs
Stephen Hansen me+pyt...@ixokai.io added the comment: FYI, The patch applied cleanly to branches/py3k; I then built a framework build (universal), installed it and ran the test-suite. I had two failures, but I don't know if either is related. The first was the tk tests didn't pass, but I'm not sure if there was something special I need to do to get tk compiled universal in a framework build-- I'll look into it. But this one perplexes me: Wimp:build pythonbuildbot$ ./python.exe -m test.regrtest test_site [1/1] test_site test test_site failed -- Traceback (most recent call last): File /Users/pythonbuildbot/32test/build/Lib/test/test_site.py, line 225, in test_getsitepackages self.assertEqual(len(dirs), 2) AssertionError: 3 != 2 1 test failed: test_site Wimp:build pythonbuildbot$ ./python.exe Python 3.2b2+ (py3k:87899M, Jan 10 2011, 11:08:48) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type help, copyright, credits or license for more information. import site site.getsitepackages() ['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages', '/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python', '/Library/Python/3.2/site-packages'] This machine fwiw never had any Python 3.x installed anywhere: in fact it was an almost pure stock 10.5 with buildbots put on it. -- nosy: +ixokai ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10820 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10820] 3.2 Makefile changes for versioned scripts break OS X framework installs
Antoine Pitrou pit...@free.fr added the comment: Looks like an issue in test_site rather than site.py itself (which has dedicated code to add a third site directory under framework builds). The test_site failure is not enough to hold the release, IMO. Given Ronald's absence, I think Ned could start exercising his commit rights on this one. Ned, you'll need to write a Misc/NEWS entry in the build section (reverse chronological order). And an appropriate commit message. I think you'll figure out the (loose) typographical conventions :-) -- assignee: ronaldoussoren - ned.deily nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10820 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10820] 3.2 Makefile changes for versioned scripts break OS X framework installs
Ned Deily n...@acm.org added the comment: Thanks for trying a build. There are various tk test failures possible depending on what version of Tcl/Tk is or isn't installed, so I wouldn't be concerned about them. The test_site failure is also not new. It is documented in re-opened Issue8084. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10820 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10881] test_site and macframework builds fails
New submission from Stephen Hansen me+pyt...@ixokai.io: With the latest from branches/py3k, in a framework build, I get: Wimp:build pythonbuildbot$ ./python.exe -m test.regrtest test_site [1/1] test_site test test_site failed -- Traceback (most recent call last): File /Users/pythonbuildbot/32test/build/Lib/test/test_site.py, line 225, in test_getsitepackages self.assertEqual(len(dirs), 2) AssertionError: 3 != 2 1 test failed: test_site Wimp:build pythonbuildbot$ ./python.exe Python 3.2b2+ (py3k:87899M, Jan 10 2011, 11:08:48) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type help, copyright, credits or license for more information. import site site.getsitepackages() ['/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages', '/Library/Frameworks/Python.framework/Versions/3.2/lib/site-python', '/Library/Python/3.2/site-packages'] Those three dirs look correct for me, but the test is written to find exactly two from site.getsitepackages() -- the code, however, adds an extra in the event of framework builds. -- assignee: ronaldoussoren components: Macintosh, Tests messages: 125919 nosy: ixokai, ronaldoussoren priority: normal severity: normal status: open title: test_site and macframework builds fails versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10881 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10881] test_site and macframework builds fails
Stephen Hansen me+pyt...@ixokai.io added the comment: ... oops! Apparently dupe. Forgot to search first. Ignore. -- resolution: - duplicate status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10881 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com