ANN: carray released
= Announcing carray 0.3 = What's new == A lot of stuff. The most outstanding feature in this version is the introduction of a `ctable` object. A `ctable` is similar to a structured array in NumPy, but instead of storing the data row-wise, it uses a column-wise arrangement. This allows for much better performance for very wide tables, which is one of the scenarios where a `ctable` makes more sense. Of course, as `ctable` is based on `carray` objects, it inherits all its niceties (like on-the-flight compression and fast iterators). Also, the `carray` object itself has received many improvements, like new constructors (arange(), fromiter(), zeros(), ones(), fill()), iterators (where(), wheretrue()) or resize mehtods (resize(), trim()). Most of these also work with the new `ctable`. Besides, Numexpr is supported now (but it is optional) in order to carry out stunningly fast queries on `ctable` objects. For example, doing a query on a table with one million rows and one thousand columns can be up to 2x faster than using a plain structured array, and up to 20x faster than using SQLite (using the :memory: backend and indexing). See 'bench/ctable-query.py' for details. Finally, binaries for Windows (both 32-bit and 64-bit) are provided. For more detailed info, see the release notes in: https://github.com/FrancescAlted/carray/wiki/Release-0.3 What it is == carray is a container for numerical data that can be compressed in-memory. The compression process is carried out internally by Blosc, a high-performance compressor that is optimized for binary data. Having data compressed in-memory can reduce the stress of the memory subsystem. The net result is that carray operations may be faster than using a traditional ndarray object from NumPy. carray also supports fully 64-bit addressing (both in UNIX and Windows). Below, a carray with 1 trillion of rows has been created (7.3 TB total), filled with zeros, modified some positions, and finally, summed-up:: %time b = ca.zeros(1e12) CPU times: user 54.76 s, sys: 0.03 s, total: 54.79 s Wall time: 55.23 s %time b[[1, 1e9, 1e10, 1e11, 1e12-1]] = (1,2,3,4,5) CPU times: user 2.08 s, sys: 0.00 s, total: 2.08 s Wall time: 2.09 s b carray((1,), float64) nbytes: 7450.58 GB; cbytes: 2.27 GB; ratio: 3275.35 cparams := cparams(clevel=5, shuffle=True) [0.0, 1.0, 0.0, ..., 0.0, 0.0, 5.0] %time b.sum() CPU times: user 10.08 s, sys: 0.00 s, total: 10.08 s Wall time: 10.15 s 15.0 ['%time' is a magic function provided by the IPyhton shell] Please note that the example above is provided for demonstration purposes only. Do not try to run this at home unless you have more than 3 GB of RAM available, or you will get into trouble. Resources = Visit the main carray site repository at: http://github.com/FrancescAlted/carray You can download a source package from: http://carray.pytables.org/download Manual: http://carray.pytables.org/manual Home of Blosc compressor: http://blosc.pytables.org User's mail list: car...@googlegroups.com http://groups.google.com/group/carray Share your experience = Let us know of any bugs, suggestions, gripes, kudos, etc. you may have. Enjoy! -- Francesc Alted -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
ANNOUNCE: omniORB 4.1.5 and omniORBpy 3.5
omniORB 4.1.5 and omniORBpy 3.5 are now available. omniORB is a high performance, robust CORBA implementation for C++; omniORBpy is a version for Python. For more details, see http://omniorb.sourceforge.net/ These are primarily bug fix releases, with a number of minor new features, including: - Incoming SSL connections can time out waiting for SSL_accept to complete. - Ability to disable longdouble support during compilation. - Support for building with the newest versions of Cygwin. - Python interceptors can receive peer address and identity. - Python exceptions can be pickled. Files are available for download from SourceForge: https://sourceforge.net/projects/omniorb/files/omniORB/omniORB-4.1.5/ https://sourceforge.net/projects/omniorb/files/omniORBpy/omniORBpy-3.5/ Source packages are available now. Windows binaries for various VC++ and Python versions will be available shortly. Enjoy! Duncan. -- -- Duncan Grisby -- -- dun...@grisby.org -- -- http://www.grisby.org -- -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Unable to decode file written by C++ wostringstream
Currently, I have the following text file (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirects=0d=1) written by C++ wostringstream. What I want to do it, I want to write a python script which accept user browser request, and then send over the entire file for user to download. The downloaded file, should be exactly same as the original text file inside server itself. The code is written as follow : import cgi print Content-Type: text/plain print Content-Disposition: attachment; filename=TEST.txt print filename = C:\\TEST.TXT f = open(filename, 'r') for line in f: print line However, when I open up the downloaded file, the file is all having weird characters. I try to use rb flag, it doesn't either. Is there anything I had missed out? What I wish is, the file (TEST.TXT) downloaded by the client by making query to the above script, will be exactly same as the one in server. I also try to specific the encoding explicitly. import cgi print Content-Type: text/plain; charset=UTF-16 print Content-Disposition: attachment; filename=TEST.txt print filename = C:\\TEST.TXT f = open(filename, 'r') for line in f: print line.encode('utf-16') It doesn't work either. Here is the screen shoot for original text file (http://i.imgur.com/S6SjX.png) and file after downloaded from a web browser. (http://i.imgur.com/l39Lc.png) Is there anything I had missed out? Thanks and Regards Yan Cheng CHEOK -- http://mail.python.org/mailman/listinfo/python-list
Re: using python ftp
Can this lib also work with ftps? Thanks. Octavian - Original Message - From: Anurag Chourasia anurag.choura...@gmail.com To: Matt Funk maf...@nmsu.edu Cc: python-list@python.org Sent: Thursday, December 23, 2010 4:12 AM Subject: Re: using python ftp Hi Matt, I have a snippet to upload files (that match a particular search pattern) to a remote server. Variable names are self explanatory. You could tweak this a little to download files instead. from ftplib import FTP ftp = FTP(hostname) ftp.login(user_id,passwd) ftp.cwd(remote_directory) files_list=glob.glob(file_search_pattern) for file in files_list: try: ftp.storlines('STOR ' + file, open(file)) except Exception, e: print ('Failed to FTP file: %s' %(file)) ftp.close() Regards, Anurag On Thu, Dec 23, 2010 at 5:33 AM, Matt Funk maf...@nmsu.edu wrote: Hi, i was wondering whether someone can point me whether the following already exists. I want to connect to a server , download various files (for whose name i want to be able to use a wildcard), and store those files in a given location on the hard drive. If the file already exists i do not want to download it. This seems fairly trivial and i would assume that there should be some sort of implementation that does this easily but i didn't find anything googling it. Otherwise i was going to do it by hand using ftplib: 1) connect to server, 2) change to directory on server 3) get listing 4) match the file pattern i want to the listing 5) check if file already exists 6) download file if matched and doesn't exist Can anyone offer any advice whether this already done somewhere? thanks matt -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
On 22/12/2010 18:47, Stefan Sonnenberg-Carstens wrote: Am 22.12.2010 09:33, schrieb Benedict Verheyen: snip Did you try apt-get install build-essential apt-get build-dep python2.7 before trying to compile ? Anyway, the config.log file is always of special interest. Btw, which Debian release are you running ? If the system is set up correctly it should not be necessary to change env vars to get it built. I use Debian stable so apt-get build-dep python2.7 doesn't work. I removed all installed Python 2.7.1 files and so on and tried to build/install from scratch. Now i can't get Python to find the readline library. What is the normal procedure to make sure the readline library is found? I downloaded readline 6.1, build it and installed it to $HOME/local $HOME/local/lib contains libreadline.so. I did the following to try to enable detection of the libreadline: - export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH - vi Modules/Setup and uncomment the line that specifies the readline module. Added -L$HOME/local/lib - Tried ./configure with env CPPFLAGS=-I$HOME/local/include LDFLAGS=-L$HOME/local/lib - Edit setup.py, to add_dirs to $HOME/local/include and $HOME/local/lib - Tried to export CPPFLAGS and LDFLAGS Nothing seems to work. What am i doing wrong? Cheers, Benedict -- http://mail.python.org/mailman/listinfo/python-list
Re: Unable to decode file written by C++ wostringstream
On 23 Dez., 09:33, Yan Cheng CHEOK ycch...@yahoo.com wrote: Currently, I have the following text file (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirect...) written by C++ wostringstream. The coding of the file is utf-16le. You should take care of this coding when you *read* the file, and not when you display its content. import io with io.open('test.txt', 'r', encoding='utf-16le') as f: ... r = f.readlines() ... len(r) 94 r[:5] [u'\n', u' 0.000 1.500 3.000 0.526 0.527 0.527 0.00036 0.00109 1381.88 485.07\n', u'0.000 1.500 3.000 1.084 1.085 1.086 0.00037 0.00111 1351.86 978.02\n', u'0.000 1.500 3.000 1.166 1.167 1.168 0.00043 0.00130 1152.71 897.16\n', u' -3.000 0.000 3.000 -0.031 -0.029 -0.025 0.00158 0.00475 632.17 626.13\n'] # from there, do what you wish with this list... jmf -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
Am 23.12.2010 10:04, schrieb Benedict Verheyen: On 22/12/2010 18:47, Stefan Sonnenberg-Carstens wrote: Am 22.12.2010 09:33, schrieb Benedict Verheyen: snip Did you try apt-get install build-essential apt-get build-dep python2.7 before trying to compile ? Anyway, the config.log file is always of special interest. Btw, which Debian release are you running ? If the system is set up correctly it should not be necessary to change env vars to get it built. I use Debian stable so apt-get build-dep python2.7 doesn't work. I removed all installed Python 2.7.1 files and so on and tried to build/install from scratch. Now i can't get Python to find the readline library. What is the normal procedure to make sure the readline library is found? I downloaded readline 6.1, build it and installed it to $HOME/local $HOME/local/lib contains libreadline.so. I did the following to try to enable detection of the libreadline: - export LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH - vi Modules/Setup and uncomment the line that specifies the readline module. Added -L$HOME/local/lib - Tried ./configure with env CPPFLAGS=-I$HOME/local/include LDFLAGS=-L$HOME/local/lib - Edit setup.py, to add_dirs to $HOME/local/include and $HOME/local/lib - Tried to export CPPFLAGS and LDFLAGS Nothing seems to work. What am i doing wrong? Cheers, Benedict apt-get build-dep python 2.6 should do, the dependencies haven't changed (IMHO). Then wipe away $HOME/usr/local (if you can, btw), reset all env vars to default (perhaps reboot). Then untar python from scratch, cd into that dir, and type ./configure --prefix=$HOME/usr/local make make install that should be all. Otherwise your box is somewhat messed up. Anyway, your config.log is of special interest (did I say that already ?) -- http://mail.python.org/mailman/listinfo/python-list
Re: How to pop the interpreter's stack?
On Dec 22, 7:22 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: There should be a mechanism for Python functions to distinguish between unexpected exceptions (commonly known as bugs), which should be reported as coming from wherever they come from, and documented, expected exceptions, which should be reported as coming from the function regardless of how deep the function call stack really is. No, -100. The traceback isn't the place for this. I've never disagreed with you more, and I've disagreed with you and awful lot. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: Unable to decode file written by C++ wostringstream
Yan Cheng CHEOK wrote: Currently, I have the following text file (https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirects=0d=1) written by C++ wostringstream. Stringstream? I guess you meant wofstream, or? Anyway, the output encoding of C++ iostreams is implementation-defined, so you can't assume that such code is generally portable. If you want a certain encoding, you need to tell the ofstream using the codecvt facet of the locale, a websearch should turn up more info on that. If you have the data in memory and it is encoded as UTF-16 there (which is what MS Windows uses for its wchar_t) then you could also use a plain ofstream, open it with the binary flag and then simply write the memory to a file. In any case, you need to know the encoding in order to get the content into a Python string or unicode object, otherwise you will only get garbage. Good luck! Uli -- Domino Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -- http://mail.python.org/mailman/listinfo/python-list
Hosting a Python based TCP server
Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantly, what is usually involved in order to make this happen? Please pardon my ignorance and I will really appreciate your reply. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: Hosting a Python based TCP server
On Dec 23, 7:01 am, Oltmans rolf.oltm...@gmail.com wrote: Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantly, what is usually involved in order to make this happen? Please pardon my ignorance and I will really appreciate your reply. Thanks in advance. If you are familiar with Linux a Linode (http://www.linode.com) might be a perfect option for you. They even offer month by month rentals. bob -- http://mail.python.org/mailman/listinfo/python-list
Re: Hosting a Python based TCP server
Rolf, I'm writing a very small TCP server (written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? I'm a big fan of webfaction.com. I think they will support this type of project. Malcolm -- http://mail.python.org/mailman/listinfo/python-list
Re: Hosting a Python based TCP server
On Thu, 2010-12-23 at 04:40 -0800, bobicanprogram wrote: On Dec 23, 7:01 am, Oltmans rolf.oltm...@gmail.com wrote: Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantly, what is usually involved in order to make this happen? Please pardon my ignorance and I will really appreciate your reply. Thanks in advance. If you are familiar with Linux a Linode (http://www.linode.com) might be a perfect option for you. They even offer month by month rentals. +1 Linode; performance is good, support is excellent. -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
On 23/12/2010 11:00, Stefan Sonnenberg-Carstens wrote: snip apt-get build-dep python 2.6 should do, the dependencies haven't changed (IMHO). Then wipe away $HOME/usr/local (if you can, btw), reset all env vars to default (perhaps reboot). Then untar python from scratch, cd into that dir, and type ./configure --prefix=$HOME/usr/local make make install that should be all. Otherwise your box is somewhat messed up. Anyway, your config.log is of special interest (did I say that already ?) I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python 2.6 doesn't work, but apt-get build-dep python 2.5 does so i did that. At configure time, the libreadline library is now found but i have no clue why it didn't find the readline version i built. At the end of the Python build, it still ends with this message: Failed to build these modules: readline The other modules that where automatically installed via the build-dep command are built successfully. I have pasted the config.log here: http://paste.pocoo.org/show/308859/ Thanks, Benedict -- http://mail.python.org/mailman/listinfo/python-list
hot
http://srbc2010.blogspot.com http://srbcmusic.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Web App
Anybody know where I can find a Python Development Environment in the form of a web app for use with Chrome OS. I have been looking for a few days and all i have been able to find is some old discussions with python developers talking about they will want one for the OS to be a success with them. Personally, I think a web app based IDE would be ghastly; but, you might have a look at Mozilla Skywriter (formerly Bespin): Why grashtly? I don't personally think the web makes a good framework for highly interactive applications as they must work within the constraints of the browser and IDEs are highly interactive applications by their very nature. Perhaps HTML5/CSS3 will change things; but, standard DOM manipulation, as I am accustomed to seeing it, cannot generate the kind of rendering that is available from native applications. Attempts to do so end up being kludgy. It also cannot handle the kinds of desktop integrations that are common for native applications without opening up serious security trust issues. (Can everybody say ActiveX fiasco?) So, in essence, you are predicting that google's chrome OS will be a failure, right? Finally, there are difficulties in handling keystrokes without conflicting with the browser's native key bindings. I seldom ever touch a mouse and I am a huge fan of vi, mutt, slrn, screen, ratpoison, etc. where the primary interface is totally accessable through the keyboard without having to tab through many options. Well, implementing vi or other text based tools in the browser is trivial. I mean it will function in exactly the same way as a native vi. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: Hosting a Python based TCP server
On Thu, 23 Dec 2010 04:01:03 -0800, Oltmans wrote: Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantly, what is usually involved in order to make this happen? Please pardon my ignorance and I will really appreciate your reply. Thanks in advance. Amazon Web Services is offering micro-instances (essentially a small virtual server) free for one year. Since you would have root access to the instance, you can run anything you want that doesn't violate Amazon's terms of service. Send me an e-mail directly (catdude at gmail dot com) if you have questions about it. Dan -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
On 23/12/2010 14:09, Benedict Verheyen wrote: snip I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python 2.6 doesn't work, but apt-get build-dep python 2.5 does so i did that. At configure time, the libreadline library is now found but i have no clue why it didn't find the readline version i built. At the end of the Python build, it still ends with this message: Failed to build these modules: readline The other modules that where automatically installed via the build-dep command are built successfully. I have pasted the config.log here: http://paste.pocoo.org/show/308859/ Thanks, Benedict I did a new test, again completely from scratch. I built ncurses and readline, installed them system wide (normal make install without a --prefix). Then i editing Modules/Setup.dist to include readline and adding the correct paths to the include and libs files. configure now finds the readline library. However, ncurses and readline still fail to be built. I had a look at the output of make. This is the error for ncurses: building '_curses' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a(lib_addch.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a: could not read symbols: Bad value collect2: ld returned 1 exit status building '_curses_panel' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_curses_panel.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lpanel -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses_panel.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a(p_above.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a: could not read symbols: Bad value collect2: ld returned 1 exit status The error for readline: gcc -pthread -Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.7 -lpthread -ldl -lutil -lreadline -L/usr/local/lib -lm /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status make: *** [python] Fout 1 Thanks, Benedict -- http://mail.python.org/mailman/listinfo/python-list
Re: Hosting a Python based TCP server
On Dec 23, 12:01 pm, Oltmans rolf.oltm...@gmail.com wrote: Hi all, I'm writing a very small TCP server(written in Python) and now I want to host it on some ISP so that it can be accessed anywhere from the Internet. I've never done that before so I thought I should ask for some advice. Do you guys know any good ISP that can let me do that? Most importantly, what is usually involved in order to make this happen? Please pardon my ignorance and I will really appreciate your reply. Thanks in advance. Check out http://wiki.python.org/moin/PythonHosting There's quite a few and they vary in features/pricing/OS used etc... but a lot of the info and links are there for you to find one right for you. hth Jon. -- http://mail.python.org/mailman/listinfo/python-list
Re: simple games w/o pygame
Thanks everyone. These references will help greatly. I was about to take some javascript examples and rewrite them in Python. -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: snip I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python 2.6 doesn't work, but apt-get build-dep python 2.5 does so i did that. At configure time, the libreadline library is now found but i have no clue why it didn't find the readline version i built. At the end of the Python build, it still ends with this message: Failed to build these modules: readline The other modules that where automatically installed via the build-dep command are built successfully. I have pasted the config.log here: http://paste.pocoo.org/show/308859/ Thanks, Benedict I did a new test, again completely from scratch. I built ncurses and readline, installed them system wide (normal make install without a --prefix). Then i editing Modules/Setup.dist to include readline and adding the correct paths to the include and libs files. configure now finds the readline library. However, ncurses and readline still fail to be built. I had a look at the output of make. This is the error for ncurses: building '_curses' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a(lib_addch.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a: could not read symbols: Bad value collect2: ld returned 1 exit status building '_curses_panel' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_curses_panel.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lpanel -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses_panel.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a(p_above.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a: could not read symbols: Bad value collect2: ld returned 1 exit status The error for readline: gcc -pthread -Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.7 -lpthread -ldl -lutil -lreadline -L/usr/local/lib -lm /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status make: *** [python] Fout 1 Thanks, Benedict It seems some libs are compiled without PIC (position indepentent code), but python should be. That will not work. I'm currently setting up a VM, to try to follow the steps. Why do you want to build a readline etc when it is in the system ? -- http://mail.python.org/mailman/listinfo/python-list
Partition Recursive
Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] The reserved char are: specialMeaning = [//,;,/, ?, :, @, = , ,#] Regards Mario -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Web App
From: Daniel Fetchinson fetchin...@googlemail.com Anybody know where I can find a Python Development Environment in the form of a web app for use with Chrome OS. I have been looking for a few days and all i have been able to find is some old discussions with python developers talking about they will want one for the OS to be a success with them. Personally, I think a web app based IDE would be ghastly; but, you might have a look at Mozilla Skywriter (formerly Bespin): Why grashtly? I don't personally think the web makes a good framework for highly interactive applications as they must work within the constraints of the browser and IDEs are highly interactive applications by their very nature. Perhaps HTML5/CSS3 will change things; but, standard DOM manipulation, as I am accustomed to seeing it, cannot generate the kind of rendering that is available from native applications. Attempts to do so end up being kludgy. It also cannot handle the kinds of desktop integrations that are common for native applications without opening up serious security trust issues. (Can everybody say ActiveX fiasco?) So, in essence, you are predicting that google's chrome OS will be a failure, right? It will surely be. But it won't, because Google's monopoly in an important field will help it to promote that OS, not because that OS will be so great. Finally, there are difficulties in handling keystrokes without conflicting with the browser's native key bindings. I seldom ever touch a mouse and I am a huge fan of vi, mutt, slrn, screen, ratpoison, etc. where the primary interface is totally accessable through the keyboard without having to tab through many options. Well, implementing vi or other text based tools in the browser is trivial. I mean it will function in exactly the same way as a native vi. Not exactly. Because not all the computer users can see, and the browsers don't offer the same accessibility features for screen readers as the standard GUIS. (And Google's software is very poor in this field anyway.) Octavian -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
On 23/12/2010 17:26, macm wrote: Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] The reserved char are: specialMeaning = [//,;,/, ?, :, @, = , ,#] I would use re.findall. -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
On Dec 23, 5:26 pm, macm moura.ma...@gmail.com wrote: Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] The reserved char are: specialMeaning = [//,;,/, ?, :, @, = , ,#] Regards Mario I would use urlparse.urlsplit, then split further, if required. urlsplit(url) SplitResult(scheme='http', netloc='docs.python.org', path='/dev/ library/stdtypes.html', query='highlight=partition', fragment='str.partition') Jon. -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
Hi urlparse isnt a option. My reasult must be: myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/', 'stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] re module is slow. Even I make a loop in urlparse.urlsplit I can lost specialMeaning order. Seen easy but best aproach will be recursive. Regards Mario On Dec 23, 3:57 pm, Jon Clements jon...@googlemail.com wrote: On Dec 23, 5:26 pm, macm moura.ma...@gmail.com wrote: Hi Folks I have this: url = 'http://docs.python.org/dev/library/stdtypes.html? highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/', 'stdtypes','.','html','?','highlight','=','partition','#','str','.','partit ion'] The reserved char are: specialMeaning = [//,;,/, ?, :, @, = , ,#] Regards Mario I would use urlparse.urlsplit, then split further, if required. urlsplit(url) SplitResult(scheme='http', netloc='docs.python.org', path='/dev/ library/stdtypes.html', query='highlight=partition', fragment='str.partition') Jon. -- http://mail.python.org/mailman/listinfo/python-list
installing scikits.timeseries
I tried to install scikits.timeseries via easy_install and received following Error Message: Found executable C:\MinGW32\bin\gcc.exe Found executable C:\MinGW32\bin\g++.exe zip_safe flag not set; analyzing archive contents... scikits.timeseries.version: module references __file__ Adding scikits.timeseries 0.91.3 to easy-install.pth file Installed c:\python26\lib\site-packages\scikits.timeseries-0.91.3-py2.6-win32.eg g Processing dependencies for scikits.timeseries Finished processing dependencies for scikits.timeseries C:\Python26\lib\site-packages\numpy\distutils\misc_util.py:251: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import from numpy.distutils import log Does anybody have an idea how I can install scikits.timeseries without getting this error message? I really appreciate every little hint. Thank You!! -- View this message in context: http://old.nabble.com/installing-scikits.timeseries-tp30524255p30524255.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list
round in 2.6 and 2.7
I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.9493 %.16g % 9.95 '9.949' round(9.95, 1) 10.0 So it seems that Python is going out of its way to intuitively round 9.95, while the repr retains the unnecessary digits. However, with 2.7 it's exactly the opposite: Python 2.7.0+ (r27:82500, Sep 15 2010, 18:04:55) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.95 %.16g % 9.95 '9.949' round(9.95, 1) 9.9 Is the change to round() expected? -- http://mail.python.org/mailman/listinfo/python-list
Re: Python Web App
On 2010-12-23, Daniel Fetchinson fetchin...@googlemail.com wrote: I don't personally think the web makes a good framework for highly interactive applications as they must work within the constraints of the browser and IDEs are highly interactive applications by their very nature. Perhaps HTML5/CSS3 will change things; but, standard DOM manipulation, as I am accustomed to seeing it, cannot generate the kind of rendering that is available from native applications. Attempts to do so end up being kludgy. It also cannot handle the kinds of desktop integrations that are common for native applications without opening up serious security trust issues. (Can everybody say ActiveX fiasco?) So, in essence, you are predicting that google's chrome OS will be a failure, right? No, most people are happy using web based email interfaces and never even know that native email clients exist. More is the pity. Finally, there are difficulties in handling keystrokes without conflicting with the browser's native key bindings. I seldom ever touch a mouse and I am a huge fan of vi, mutt, slrn, screen, ratpoison, etc. where the primary interface is totally accessable through the keyboard without having to tab through many options. Well, implementing vi or other text based tools in the browser is trivial. I mean it will function in exactly the same way as a native vi. Not exactly. I occassionally use web based terminals (Ajaxterm, Anyterm, Shellinabox, etc) to access my systems. This works only partially since many of the keystrokes I use conflict with keystrokes that the browser uses or which cause signals that the browser either does not catch or does not pass on to be accessed by client side scripting. The terminals must therefore place buttons or synthetic keyboards on the screen to allow you to simulate the keystrokes. That kind of negates the advantages of keystrokes in the first place. It doesn't make fore a pleasant experience. -- http://mail.python.org/mailman/listinfo/python-list
Re: round in 2.6 and 2.7
On Dec 23, 4:57 pm, Hrvoje Niksic hnik...@xemacs.org wrote: I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.9493 %.16g % 9.95 '9.949' round(9.95, 1) 10.0 So it seems that Python is going out of its way to intuitively round 9.95, while the repr retains the unnecessary digits. However, with 2.7 it's exactly the opposite: Python 2.7.0+ (r27:82500, Sep 15 2010, 18:04:55) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.95 %.16g % 9.95 '9.949' round(9.95, 1) 9.9 Is the change to round() expected? My guess is use decimal module. Regards mario -- http://mail.python.org/mailman/listinfo/python-list
Re: general problem when subclassing a built-in class
In ieu88s$hm...@reader1.panix.com kj no.em...@please.post writes: Where in the Python documentation can one find the information required to determine the minimal[1] set of methods that one would need to override to achieve this goal? I don't know the answer to that question, but imho it's the wrong question to ask. Instead you should be asking what design will let me implement the subclass making the fewest possible assumptions about the superclass. (hint: the design you're thinking about leads to a world of pain.) 2. other than the added capability described in (1), an instance of TSDict should behave *exactly* like a built-in dictionary. (minor point: what about repr? it shouldn't look like a dict, imho) #--- from time import time class TSDict(dict): def __setitem__(self, key, value): # save the value and timestamp for key as a tuple; # see footnote [2] dict.__setitem__(self, key, (value, time())) def __getitem__(self, key): # extract the value from the value-timestamp pair and return it return dict.__getitem__(self, key)[0] def get_timestamp(self, key): # extract the timestamp from the value-timestamp pair and return it return dict.__getitem__(self, key)[1] #--- man, you're asking for trouble! even if you knew all you want to know, unless you had some guarantee that it wouldn't change in a later release, you'd still have to override pretty much all the methods. the problem here is not lack of information, but a horrible design (sorry to be blunt). Just keep the timestamps in a parallel dict and get on with life: from time import time from collections import MutableMapping class TSDict2(dict, MutableMapping): def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) self.__ts = dict.fromkeys(self.keys(), time()) def __setitem__(self, key, value): self.__ts[key] = time() dict.__setitem__(self, key, value) setdefault = MutableMapping.setdefault update = MutableMapping.update def get_timestamp(self, key): if self.has_key(key): return self.__ts[key] raise KeyError(key) that just took the time needed to type it and worked the first time: d = TSDict2((('uno', 1), ('dos', 2)), tres=3, cuatro=4); d['cinco'] = 5; d.setdefault('six', 6); 6 d.update((('tres', 'amigos'), ('seven', 7),), eight=8); d {'seven': 7, 'six': 6, 'cuatro': 4, 'cinco': 5, 'eight': 8, 'dos': 2, 'tres': 'amigos', 'uno': 1} for p in sorted([(k, d.get_timestamp(k)) for k in d.keys()], key=lambda p: p[1]): print %s\t%f % p ... cuatro 1293131496.917215 dos 1293131496.917215 uno 1293131496.917215 cinco 1293131496.917233 six 1293131496.917279 tres1293131501.676962 seven 1293131501.676974 eight 1293131501.676981 If you insist on bashing your skull against your original problem, take a look at collections.OrderedDict or collections.Counter to see how they use ABCs to tame dict. (still, even if you used all the remaining available MutableMapping methods in your class, i don't know how you'd get the dict constructor to return the right value, ie no timestamps, when you pass it an instance of your subclass as argument. i don't think there's a TSDict.__method__ you can write for that... anyway my TSDict2 doesn't have this problem either.) take home message: respect the privacy of your superclasses and they'll be nice to you. --bill -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
Am 23.12.2010 15:37, schrieb Benedict Verheyen: On 23/12/2010 14:09, Benedict Verheyen wrote: snip I started from scratch. I tried to build readline 6 and 5, and installing the packages system wide as opposed to $HOME/local, but everytime Python fails to find it. On stable, apt-get build-dep python 2.6 doesn't work, but apt-get build-dep python 2.5 does so i did that. At configure time, the libreadline library is now found but i have no clue why it didn't find the readline version i built. At the end of the Python build, it still ends with this message: Failed to build these modules: readline The other modules that where automatically installed via the build-dep command are built successfully. I have pasted the config.log here: http://paste.pocoo.org/show/308859/ Thanks, Benedict I did a new test, again completely from scratch. I built ncurses and readline, installed them system wide (normal make install without a --prefix). Then i editing Modules/Setup.dist to include readline and adding the correct paths to the include and libs files. configure now finds the readline library. However, ncurses and readline still fail to be built. I had a look at the output of make. This is the error for ncurses: building '_curses' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_cursesmodule.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_cursesmodule.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a(lib_addch.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libncurses.a: could not read symbols: Bad value collect2: ld returned 1 exit status building '_curses_panel' extension gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/benedict/local/include -I. -IInclude -I./Include -I/usr/local/include -I/home/benedict/src/Python-2.7.1/Include -I/home/benedict/src/Python-2.7.1 -c /home/benedict/src/Python-2.7.1/Modules/_curses_panel.c -o build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o gcc -pthread -shared build/temp.linux-x86_64-2.7/home/benedict/src/Python-2.7.1/Modules/_curses_panel.o -L/home/benedict/local/lib -L/usr/local/lib -L. -lpanel -lncurses -lpython2.7 -o build/lib.linux-x86_64-2.7/_curses_panel.so /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a(p_above.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libpanel.a: could not read symbols: Bad value collect2: ld returned 1 exit status The error for readline: gcc -pthread -Xlinker -export-dynamic -o python \ Modules/python.o \ -L. -lpython2.7 -lpthread -ldl -lutil -lreadline -L/usr/local/lib -lm /usr/local/lib/libreadline.so: undefined reference to `PC' /usr/local/lib/libreadline.so: undefined reference to `tgetflag' /usr/local/lib/libreadline.so: undefined reference to `tgetent' /usr/local/lib/libreadline.so: undefined reference to `UP' /usr/local/lib/libreadline.so: undefined reference to `tputs' /usr/local/lib/libreadline.so: undefined reference to `tgoto' /usr/local/lib/libreadline.so: undefined reference to `tgetnum' /usr/local/lib/libreadline.so: undefined reference to `BC' /usr/local/lib/libreadline.so: undefined reference to `tgetstr' collect2: ld returned 1 exit status make: *** [python] Fout 1 Thanks, Benedict OK, I compiled it successfully under Debian 5.07 i386. ncurses and libreadline are compiled from hand, both --prefix=$HOME/usr/local. For python the only extra needed was export LD_LIBRARY_PATH=$HOME/usr/local/lib:$LD_LIBRARY_PATH -- http://mail.python.org/mailman/listinfo/python-list
Re: round in 2.6 and 2.7
Type help, copyright, credits or license for more information. 9.95 9.9493 %.16g % 9.95 '9.949' round(9.95, 1) 10.0 So it seems that Python is going out of its way to intuitively round 9.95, while the repr retains the unnecessary digits. The 2.6 result is simply incorrect. 9.95 cannot be represented as a floating point number; the number that is closest to it is actually smaller than 9.95. Rounding that number should give 9.9 (or something close to it - 9.9 cannot be represented, either), not 10.0. round(9.95, 1) 9.9 Is the change to round() expected? Yes. It's a bug fix described in What's new in Python 2.7 thus: Float-to-string and string-to-float conversions are correctly rounded. The round() function is also now correctly rounded. Not sure that this is correct English; I think it means that the round() function is now correct. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list
daml 0.1.4 released, a python markup language for the web
Notes on the latest updates can be read here: http://dasacc22.wordpress.com/2010/12/22/daml-0-1-4-release/ The source is on github: https://github.com/dasacc22/daml An sdist is available on pypi: http://pypi.python.org/pypi/DAML/0.1.4 daml is for outlining html with dynamic content. Features inline python and a sandbox you can update with custom functions (so they are in memory, versus writing the function in the template). As part of a bigger project, daml is playing a part in completely removing the view from controller code and will feature an extension for requesting data via IPC from your controllers (or anywhere else for that matter if you want to wait), so no more tacking on related or semi-related views to a particular controller. daml currently depends on cython. There are a few utility functions that are written in cython and it also depends on lxml (written in cython) and makes use of that during the final document build which is done in cython as well. Down the road, after I get all of the specifics worked out for the syntax, cython and lxml will be optional (and necessary if you want it to be as fast as possible), but theres absolutely no reason for there to not be a pure python module. It's really not that complex. daml may also be recognized as a haml implementation. The only things adapted is the use of #id and .class tag hashes and being indention based (if that counts), and particularly the source of inspiration for filters. Beyond that, they are two pretty different things. Also, daml isn't much of a name for anything. Under consideration currently is damsel, da Markup 4 Savvy Eloquent Ladies (and gentlemen). Just think repunzel in a tower with OSI climbing her hair to save the View[1] from the MVC-implementation-of-hell Tower. [1] She must be a looker -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to parse a HUGE(1gb) xml file
On Wed, 22 Dec 2010 23:54:34 +0100, Stefan Sonnenberg-Carstens wrote: Normally (what is normal, anyway?) such files are auto-generated, and are something that has a apparent similarity with a database query result, encapsuled in xml. Most of the time the structure is same for every row thats in there. So, a very unpythonic but fast, way would be to let awk resemble the records and write them in csv format to stdout. awk works well if the input is formatted such that each line is a record; it's not so good otherwise. XML isn't a line-oriented format; in particular, there are many places where both newlines and spaces are just whitespace. A number of XML generators will word wrap the resulting XML to make it more human readable, so line-oriented tools aren't a good idea. -- http://mail.python.org/mailman/listinfo/python-list
Re: Generator question
On Wed, 22 Dec 2010 15:49:31 -0800, Dan Stromberg wrote: def generator(): i = 0 while True: yield i i += 1 Shorter version: from itertools import count as generator -- http://mail.python.org/mailman/listinfo/python-list
Re: round in 2.6 and 2.7
Am 23.12.2010 19:57, schrieb Hrvoje Niksic: I stumbled upon this. Python 2.6: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.9493 %.16g % 9.95 '9.949' round(9.95, 1) 10.0 So it seems that Python is going out of its way to intuitively round 9.95, while the repr retains the unnecessary digits. However, with 2.7 it's exactly the opposite: Python 2.7.0+ (r27:82500, Sep 15 2010, 18:04:55) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. 9.95 9.95 %.16g % 9.95 '9.949' round(9.95, 1) 9.9 Is the change to round() expected? Indeed: http://svn.python.org/view?view=revrevision=76373 -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to parse a HUGE(1gb) xml file
Am 23.12.2010 21:27, schrieb Nobody: On Wed, 22 Dec 2010 23:54:34 +0100, Stefan Sonnenberg-Carstens wrote: Normally (what is normal, anyway?) such files are auto-generated, and are something that has a apparent similarity with a database query result, encapsuled in xml. Most of the time the structure is same for every row thats in there. So, a very unpythonic but fast, way would be to let awk resemble the records and write them in csv format to stdout. awk works well if the input is formatted such that each line is a record; You shouldn't tell it to awk. it's not so good otherwise. XML isn't a line-oriented format; in particular, there are many places where both newlines and spaces are just whitespace. A number of XML generators will word wrap the resulting XML to make it more human readable, so line-oriented tools aren't a good idea. I never had the opportunity seeing awk fail on this task :-) For large datasets I always have huge question marks if one says xml. But I don't want to start a flame war. -- http://mail.python.org/mailman/listinfo/python-list
Re: using python ftp
Hi, thanks for the response. I kind of was thinking along those lines. The thing is though is that 'grop' appears to work on the local directory only (and not on the remote one which i need) Anyway, i think i'll just do via iterating through a the remote directory listing and then match it via regular pattern. Not sure if this is the best/most elegant way. But it should work. thanks matt On 12/23/2010 1:46 AM, Octavian Rasnita wrote: Can this lib also work with ftps? Thanks. Octavian - Original Message - From: Anurag Chourasia anurag.choura...@gmail.com To: Matt Funk maf...@nmsu.edu Cc: python-list@python.org Sent: Thursday, December 23, 2010 4:12 AM Subject: Re: using python ftp Hi Matt, I have a snippet to upload files (that match a particular search pattern) to a remote server. Variable names are self explanatory. You could tweak this a little to download files instead. from ftplib import FTP ftp = FTP(hostname) ftp.login(user_id,passwd) ftp.cwd(remote_directory) files_list=glob.glob(file_search_pattern) for file in files_list: try: ftp.storlines('STOR ' + file, open(file)) except Exception, e: print ('Failed to FTP file: %s' %(file)) ftp.close() Regards, Anurag On Thu, Dec 23, 2010 at 5:33 AM, Matt Funk maf...@nmsu.edu wrote: Hi, i was wondering whether someone can point me whether the following already exists. I want to connect to a server , download various files (for whose name i want to be able to use a wildcard), and store those files in a given location on the hard drive. If the file already exists i do not want to download it. This seems fairly trivial and i would assume that there should be some sort of implementation that does this easily but i didn't find anything googling it. Otherwise i was going to do it by hand using ftplib: 1) connect to server, 2) change to directory on server 3) get listing 4) match the file pattern i want to the listing 5) check if file already exists 6) download file if matched and doesn't exist Can anyone offer any advice whether this already done somewhere? thanks matt -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
What is the the best style and theory of writing a complier in your language
What is the the best style and theory of writing a complier in your language Maybe a book will suffice. http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura-proves-911-cover-up-will-americas-government-fall/ I want to parse the contents of the above link into hebrew audio. CHEERIOS -- http://mail.python.org/mailman/listinfo/python-list
Re: Regular expression for key = value pairs
I extracted an isolated problem from a slightly more complex situation, that's why I'm using REs. Thank you all for your help, my problem is now solved. -- http://mail.python.org/mailman/listinfo/python-list
Re: Catching user switching and getting current active user from root on linux
Ok, thank you. I will go look at the resources mentioned. -- http://mail.python.org/mailman/listinfo/python-list
Re: class inheritance
That's nice, Ethan, especially in that it saves having to explicitly find and list all the methods being covered. It's perhaps not quite so critical for a Fraction-based class, since the set of methods to be covered is fairly well contained, but that's not always going to be the case. The approach I mentioned earlier (rebinding __class__) is a little faster, since it avoids a call to __new__, but the difference is no doubt negligible in this example, since rational arithmetic isn't exactly lightning fast. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
Please don't top-post, it makes everything harder to read. (Re-ordering to make sense...) On Thu, 23 Dec 2010 18:05:39 -, macm moura.ma...@gmail.com wrote: On Dec 23, 3:57 pm, Jon Clements jon...@googlemail.com wrote: I would use urlparse.urlsplit, then split further, if required. urlsplit(url) SplitResult(scheme='http', netloc='docs.python.org', path='/dev/ library/stdtypes.html', query='highlight=partition', fragment='str.partition') urlparse isnt a option. Why not? My reasult must be: myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/', 'stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] Deriving this from the output of urlparse isn't that hard. I'm slightly baffled as to why this is more useful, but that's your problem. re module is slow. Is it slow enough to be an issue? Even I make a loop in urlparse.urlsplit I can lost specialMeaning order. If you mean what I think you mean, and you're relying on getting queries from browsers in a defined order, you are in for a world of pain. Seen easy but best aproach will be recursive. If speed is as important to you as you imply, I doubt it. -- Rhodri James *-* Wildebeest Herder to the Masses -- http://mail.python.org/mailman/listinfo/python-list
David Epstein Incest Charges: Columbia Professor Charged With Sleeping With Daughter
On Dec 23, 2:01 pm, small Pox smallpox...@gmail.com wrote: What is the the best style and theory of writing a complier in your language Maybe a book will suffice. http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura... I want to parse the contents of the above link into hebrew audio. CHEERIOS I expect this from the zionists of both stripes Shalom Israel David Epstein Incest Charges: Columbia Professor Charged With Sleeping With Daughter A Columbia political science professor has been charged with having a sexual relationship with his 24-year-old daughter, the Columbia Daily Spectator reports. David Epstein, 46, was charged Thursday with one count of third-degree incest. Police told the Spectator that the relationship appeared consensual. Epstein is currently on administrative leave. According to the New York Daily News, Epstein and the woman had a three-year sexual relationship and often exchanged twisted text messages. The Spectator reports that Epstein is married to another Columbia political science professor, Sharyn O'Halloran, though a recent update to his Facebook page says he is single. The couple was featured in a 2008 Spectator article about professors who bring love to work. Our complementary skills lead to a great partnership, O'Halloran told the Spectator. One student described Epstein, who was teaching a class on game theory this semester, as a very nice guy. Outside of his professorial duties, Epstein also blogged for this website, on topics ranging from torture to Sarah Palin. -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
On 23/12/2010 20:55, Stefan Sonnenberg-Carstens wrote: snip OK, I compiled it successfully under Debian 5.07 i386. ncurses and libreadline are compiled from hand, both --prefix=$HOME/usr/local. For python the only extra needed was export LD_LIBRARY_PATH=$HOME/usr/local/lib:$LD_LIBRARY_PATH Hi Stefan, thanks for your continued help, I appreciate it very much! The reason why i want my own readline library is that i want to have full control over what version gets used without messing with the system wide libraries. A difference between your system and mine is that i'm using amd64 instead of i386. Anyway, i retried at home, completely clean system. Built ncurses and readline with: ./configure --enable-shared --prefix=$HOME/usr/local make make install Then for Python ./configure --enable-shared --prefix=$HOME/usr/local And now i doesn't find the readline library. I'm really lost now why it sometimes finds it and sometimes it doesn't. Only difference with earlier is that I now used --prefix=$HOME/usr/local So it's not installed system-wide. Could that be the reason why it's not found? Since you've managed to successfully build Python with readline support, could you post the exact steps from building readline to building Python? I even edited /etc/ldconfig.conf.d/libc.conf to include $HOME/usr/local/lib. Then issued sudo ldconfig -v but no go. Editing the Python Modules/Setup to uncomment the readline line doesn't help either so that obviously doesn't work. Should it? As said earlier, I added -L$HOME/usr/local/lib -I$HOME/usr/local/include to the end of the line. Thanks a lot, Benedict -- http://mail.python.org/mailman/listinfo/python-list
GUI Tools for Python 3.1
Lots of stuff for 2.6 and 2.7 -- what GUI tools are there for 3.1? Randy -- http://mail.python.org/mailman/listinfo/python-list
Re: compiling Python 2.7.1 with readline module fails on Debian (Virtualbox)
On 24/12/2010 2:16, Benedict Verheyen wrote: On 23/12/2010 20:55, Stefan Sonnenberg-Carstens wrote: snip I finally succeeded. I built ncurses and installed it to $HOME/usr/local ./configure --with-shared --enable-termcap --prefix=$HOME/usr/local make make install Then i built readline ./configure --enable-shared --prefix=$HOME/usr/local make make install I edited /etc/ld.so.conf.d/libc.conf and added $HOME/usr/local Next: ldconfig -v Next Python, configure doesn't find readline even if LD_LIBRARY_PATH is set. I tried export LDFLAGS=-L$HOME/usr/local Then Python builds both readline and ncurses and works ok. Finally :) I'm not sure if the ldconfig is necessary. Regards, Benedict -- http://mail.python.org/mailman/listinfo/python-list
How to order base classes?
Suppose that I want to write a subclass C of base classes A and B. What considerations should go into choosing the ordering of A and B in C's base class list? Since any order one chooses can be overridden on a per-method basis, by assigning the desired parent's method to the appropriate class attribute, like this: class C(B, A) # override methods spam, ham, and eggs from B spam = A.spam; ham = A.ham; eggs = A.eggs; ... ...it is difficult for me to see a strong compelling reason for picking an ordering over another. But may be just ignorance on my part. How should one go about deciding the ordering of base classes? TIA! ~kj -- http://mail.python.org/mailman/listinfo/python-list
Re: How to order base classes?
On Fri, 24 Dec 2010 03:36:28 +, kj wrote: How should one go about deciding the ordering of base classes? There is no general way for doing so. You need to consider the actual functionality of the methods involved. Consider a method spam() of class C that inherits from both A and B. To be completely general, you might have any of the following situations: C.spam() overloads A.spam() followed by B.spam() C.spam() overloads B.spam() followed by A.spam() C.spam() overloads A.spam() and overrides B.spam() C.spam() overloads B.spam() and overrides A.spam() C.spam() overrides both A.spam() and B.spam() (where I use overload to mean modify the behaviour of, and override to mean change the behaviour completely -- basically, overloading will call the superclass' method, while overriding will not.) And (again, we're being completely general) whatever choice you make for C.spam() may not be valid for C.ham(), which could behave completely differently. The question you ask can only be answered in reference to a specific class with specific methods. There is no general principle, it depends entirely on the problem being solved. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: How to order base classes?
In 4d14209d$0$3$c3e8da3$54964...@news.astraweb.com Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: The question you ask can only be answered in reference to a specific class with specific methods. There is no general principle, it depends entirely on the problem being solved. Thanks! ~kj -- http://mail.python.org/mailman/listinfo/python-list
Re: How to pop the interpreter's stack?
On Thu, 23 Dec 2010 02:54:52 -0800, Carl Banks wrote: On Dec 22, 7:22 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: There should be a mechanism for Python functions to distinguish between unexpected exceptions (commonly known as bugs), which should be reported as coming from wherever they come from, and documented, expected exceptions, which should be reported as coming from the function regardless of how deep the function call stack really is. No, -100. The traceback isn't the place for this. I've never disagreed with you more, and I've disagreed with you and awful lot. Okay, it's your right to disagree, but I am trying to understand your reasons for disagreeing, and I simply don't get it. I'm quite frustrated that you don't give any reasons for why you think it's not just unnecessary but actually *horrible* to hide implementation details such as where data validation is performed. I hope you'll try to explain *why* you think it's a bad idea, rather than just continue throwing out dismissive statements about self-important programmers (your earlier post to KJ) and never disagreed more (to me). Do you accept that, as a general principle, unhandled errors should be reported as close as possible to where the error occurs? If your answer to that is No, then where do you think unhandled errors should be reported? Now, given the scenario I proposed earlier: f('bad input')=== error occurs here Traceback (most recent call last): File stdin, line 1, in module File stdin, line 2, in f File stdin, line 2, in g File stdin, line 2, in h File stdin, line 2, in i File stdin, line 2, in j File stdin, line 2, in k=== far from the source of error ValueError do you concede that the actual error occurs at the time 'bad input' is passed to f, and not further down the stack where k happens to raise an exception? If not, where do you think the error occurs, and why? -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
In be6f45b2-5a5a-4461-b5de-000487a46...@w2g2000yqb.googlegroups.com macm moura.ma...@gmail.com writes: url = 'http://docs.python.org/dev/library/stdtypes.html?highlight=partition#str.partition' So I want convert to myList = ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partition'] The reserved char are: specialMeaning = [//,;,/, ?, :, @, = , ,#] You forgot '.'. import re # sorry sp = re.compile('(//?|[;?:@=#.])') filter(len, sp.split(url)) ['http', ':', '//', 'docs', '.', 'python', '.', 'org', '/', 'dev', '/', 'library', '/', 'stdtypes', '.', 'html', '\ ?', 'highlight', '=', 'partition', '#', 'str', '.', 'partition'] ~kj -- http://mail.python.org/mailman/listinfo/python-list
Re: Partition Recursive
On 12/23/2010 10:03 PM, kj wrote: import re # sorry sp = re.compile('(//?|[;?:@=#.])') filter(len, sp.split(url)) Perhaps I'm being overly pedantic, but I would likely have written that as filter(None, sp.split(url)) for the same reason that if string: is generally preferred to if len(string):. Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list
Re: How to pop the interpreter's stack?
On Dec 23, 8:55 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Thu, 23 Dec 2010 02:54:52 -0800, Carl Banks wrote: On Dec 22, 7:22 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: There should be a mechanism for Python functions to distinguish between unexpected exceptions (commonly known as bugs), which should be reported as coming from wherever they come from, and documented, expected exceptions, which should be reported as coming from the function regardless of how deep the function call stack really is. No, -100. The traceback isn't the place for this. I've never disagreed with you more, and I've disagreed with you and awful lot. Okay, it's your right to disagree, but I am trying to understand your reasons for disagreeing, and I simply don't get it. I'm quite frustrated that you don't give any reasons for why you think it's not just unnecessary but actually *horrible* to hide implementation details such as where data validation is performed. I hope you'll try to explain *why* you think it's a bad idea, rather than just continue throwing out dismissive statements about self-important programmers (your earlier post to KJ) and never disagreed more (to me). Do you accept that, as a general principle, unhandled errors should be reported as close as possible to where the error occurs? If your answer to that is No, then where do you think unhandled errors should be reported? No, and where the error is detected. That is, what Python does now. Trying to figure out where the error occurred is fool's errand. The former isn't even well-defined, let alone something a compiler or user can be expected to reliably report. Sometimes the error doesn't even occur in the same call stack. There's a similar fine line between a bug exception and bad input exception, and it's foolish to distinguish them in a reliable way: in particular bugs can easily be mistaken for bad input. OTOH, going the extra mile to hide useful information from a user is asinine. As a user, I will decide for myself how I want to use implementation-defined information, and I don't want the implementor to decide this for me. It's bad enough if an implementor fails to provide information out of laziness, but when they deliberately do extra work to hide information, that's self-importance and arrogance. The traceback IS NOT THE PLACE for these kinds of games. Now, given the scenario I proposed earlier: f('bad input') === error occurs here Traceback (most recent call last): File stdin, line 1, in module File stdin, line 2, in f File stdin, line 2, in g File stdin, line 2, in h File stdin, line 2, in i File stdin, line 2, in j File stdin, line 2, in k === far from the source of error ValueError do you concede that the actual error occurs at the time 'bad input' is passed to f, and not further down the stack where k happens to raise an exception? If not, where do you think the error occurs, and why? This question is irrelevant. It doesn't matter where the mistake is made. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
Re: What is the the best style and theory of writing a complier in your language
In comp.lang.c++ small Pox smallpox...@gmail.com wrote: http://www.veteranstoday.com/2010/12/18/gordon-duff-gov-jesse-ventura-proves-911-cover-up-will-americas-government-fall/ You should take your religion somewhere else. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to order base classes?
kj no.em...@please.post wrote: Suppose that I want to write a subclass C of base classes A and B. What considerations should go into choosing the ordering of A and B in C's base class list? ... ...it is difficult for me to see a strong compelling reason for picking an ordering over another. But may be just ignorance on my part. How should one go about deciding the ordering of base classes? In general, it is uncommon to have a class that derives from multiple classes that all provide major functionality. That quickly gets confusing, which is one reason Java doesn't allow multiple inheritance. Now, it is very common for a class to derive from one class primarily, with other classes providing a few additional features. That's the mix-in concept. In that case, you'd list the major ancestor first, with the mix-ins after, so the mix-ins can modify the behavior. class BlueSpanishListBox( ListBox, ColorBlueMixIn, SpanishMixIn ): ... Reading it, a BlueSpanishListBox is-a ListBox that happens to have a few additional features. -- Tim Roberts, t...@probo.com Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Grygoriy Fuchedzhy grygoriy.fuched...@gmail.com added the comment: Shouldn't .svgz be also added as 'image/x-svg+xml'? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Terry J. Reedy tjre...@udel.edu added the comment: No, the other combined suffixes are not either. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
Stephen J. Turnbull step...@xemacs.org added the comment: Re: msg124528 Yes, XEmacs installs a signal handler on what are normally fatal errors. (I don't know about GNU Emacs but they probably do too.) The handler has two functions: to display a Lisp backtrace and to output a message explaining how to report bugs (even including a brief introduction to the bt command in gdb. ;-) I personally have never found the Lisp backtrace useful, except that it can be used as a bug signature of sorts (oh, I think I've seen this one before...). However, I suspect this is mostly because in Emacs Lisp very often you don't have the name of the function in the backtrace, only a compiled code object. So in many cases it's almost no help in localizing the fault. Victor's patch does a lot better on this than XEmacs can, I suspect. The bug reporting message, OTOH, has been useful to us for the reasons people give for wanting the handler installed by default. We get more and better bug reports, often including C backtraces, from people who have never participated directly in XEmacs development before. (It also once served the function of inhibiting people from sending us core files. Fortunately, I don't think that happens much any more. :-) Occasionally a user will be all proud of themselves because I never used gdb before, so I'm pretty sure that message is effective. Quite frequently we see the handler itself crash if there was memory corruption, but certainly it gives useful output well over half the time. So I want to back up Victor on those aspects. Finally, although our experience has be very positive, qnote that XEmacs is not an embeddable library, nor is there provision in the mainline versions for embedding other interpreters in XEmacs. So we've never had to worry about the issues that come with that. For more technical details, you could ask Ben Wing b...@xemacs.org who put a lot of effort into the signal handling implementation, or Hrvoje Niksic (sorry, no address offhand) who posts on python-dev occasionally. (I don't know if Hrvoje ever worked on the signal handlers, and he hasn't worked on XEmacs for years, but he was more familiar with internals than me then, and might very well still remember more than I ever knew. :-) I don't think either will disagree with my general statements above, though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10762] strftime('%f') segfault
New submission from David Leonard d+pyt...@adaptive-enterprises.com: Installed http://www.python.org/ftp/python/2.7.1/python-2.7.1.amd64.msi on Windows 7, x64 into C:\Python27 C:\\Python27\python.exe Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 Type help, copyright, credits or license for more information. import time time.strftime('%f') Dialog raises: Python.exe has stopped working -- components: Library (Lib) messages: 124542 nosy: dleonard0 priority: normal severity: normal status: open title: strftime('%f') segfault type: crash versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7511] msvc9compiler.py: ValueError: [u'path']
Stefan Krah stefan-use...@bytereef.org added the comment: Before anyone does any further testing: Tarek, can this go into distutils 2.7/3.2 (after 3.2 has been released)? Due to the popularity of this issue I think it might be worthwhile to make an exception and ignore the distutils freeze. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: [issue10296] ctypes catches BreakPoint error on windows 32
ctypes has _always_ catched exceptions raised in function calls. On Windows ;-). ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
Stefan Krah stefan-use...@bytereef.org added the comment: [Alexander] if sys.getenv('PYTHONSEGVHANDLER'): import segvhandler segvhandler.enable() +1 If this doesn't find support, I'd name sys.setsegfaultenabled() sys.setsegvhandlerenabled() or sys.enable_segvhandler(). -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
STINNER Victor victor.stin...@haypocalc.com added the comment: Note: To avoid the signal-safe requirement, another solution is to use sigsetjmp()+siglongjmp(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Tarek Ziadé ziade.ta...@gmail.com added the comment: I have investigated the problem and it turns out virtualenv patches distutils.sysconfig behavior by adding to the sys module a real_prefix attribute that points to the global Python install and is used instead of sys.prefix that points to the virtualenv local install, when some distutils.sysconfig APIs are used. The fix is to change virtualenv so it patches sysconfig the same way it does for distutils.sysconfig. To simulate this patch, just change how _EXEC_PREFIX and _PREFIX are set in sysconfig, by setting them to sys.real_prefix instead of sys.prefix/sys.exec_prefix when using virtualenv. I suggest to Georg that this bug gets resolved to invalid and that we move it to the virtualenv bitbucket tracker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10763] subprocess.communicate() doesn't close pipes on Windows
New submission from STINNER Victor victor.stin...@haypocalc.com: If more than one file (stdin, stdout and stderr) are pipes, Popen.communicate() uses threads calling _readerthread() on each pipe. But this method doesn't close the pipes, whereas all other communicate implementations (select, poll and the optimization if there is only one pipe) do close all pipes. Attached patch fixes this issue. Thanks Antoine for your nice ResourceWarning patch! -- components: Library (Lib), Windows files: subprocess_close_pipes.patch keywords: patch messages: 124547 nosy: haypo priority: normal severity: normal status: open title: subprocess.communicate() doesn't close pipes on Windows versions: Python 3.2 Added file: http://bugs.python.org/file20146/subprocess_close_pipes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10763] subprocess.communicate() doesn't close pipes on Windows
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +amaury.forgeotdarc, pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10763 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
STINNER Victor victor.stin...@haypocalc.com added the comment: I tested the patch version 11 on Windows: all tests pass. But #include unistd.h should be skipped on Windows (Python/fault.c): I will add #ifdef MS_WINDOWS. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
STINNER Victor victor.stin...@haypocalc.com added the comment: I tested the patch version 11 on Windows: all tests pass. Oh, and I forgot to say that the Windows fault handler does catch the fault too (Windows opens a popup with a question like Should the error be reported to Microsoft?). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
STINNER Victor victor.stin...@haypocalc.com added the comment: Tested on FreeBSD 8: all tests pass (all of the 4 signals are supported) and FreeBSD dumps a core file. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
Stefan Krah stefan-use...@bytereef.org added the comment: STINNER Victor rep...@bugs.python.org wrote: Note: To avoid the signal-safe requirement, another solution is to use sigsetjmp()+siglongjmp(). FWIW, there is a caveat in the OpenBSD man page concerning the use of siglongjmp(): http://www.openbsd.org/cgi-bin/man.cgi?query=sigsetjmpapropos=0sektion=0manpath=OpenBSD+Currentarch=i386format=htm Use of longjmp() or siglongjmp() from inside a signal handler is not as easy as it might seem. Generally speaking, all possible code paths between the setjmp() and longjmp() must be signal race safe, as discussed in signal(3). Furthermore, the code paths must not do resource management (such as open(2) or close(2)) without blocking the signal in question, or resources might be mismanaged. Obviously this makes longjmp() much less useful than previously thought. -- title: Display Python backtrace on SIGSEGV, SIGFPE and fatal error - Display Python backtrace on SIGSEGV, SIGFPE and fatal error ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8863] Display Python backtrace on SIGSEGV, SIGFPE and fatal error
STINNER Victor victor.stin...@haypocalc.com added the comment: Tested on Ubuntu 10.04: all tests pass and apport intercepts the fault. Apport ignores the faults because I am testing a Python executable compiled from SVN (py3k). Apport logs (/var/log/apport.log): --- apport (pid 18148) Thu Dec 23 13:29:25 2010: called for pid 18147, signal 8 apport (pid 18148) Thu Dec 23 13:29:25 2010: executable: /home/haypo/prog/SVN/py3k/python (command line ./python -c import\ _testcapi;\ _testcapi.sigfpe()) apport (pid 18148) Thu Dec 23 13:29:25 2010: executable does not belong to a package, ignoring --- -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7511] msvc9compiler.py: ValueError: [u'path']
Martin v. Löwis mar...@v.loewis.de added the comment: IIUC, the issue is that people installing a 64-bit Python, and VS Express, and then wonder why they can't build extension modules. I'm not so sure that there is a bug in Python here - this setup is not supported (and that's really Microsoft's fault). Now, automatically finding the SDK would be a new feature, IMO: if you want to use SDK tools, you are supposed to set DISTUTILS_USE_SDK, after opening the respective build environment. IIUC, installing VS express would not have been necessary in this setup at all - just install the SDK. Alternatively, people can install Visual Studio proper, or use a 32-bit Python. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10762] strftime('%f') segfault
R. David Murray rdmur...@bitdance.com added the comment: Note that this is a regression relative to 2.6, where the same call returns '' (which is different from what it returns on linux, where the result would be '%f', or OSX, where the result would be 'f'). (Tests done on windows XP using pythons installed from the python.org installers.) My guess is that the difference between python 2.6 and python 2.7+ is issue 4804. I'm therefore adding the nosy list from that issue to this one. For the OP's benefit: my guess is that this is a bug in the Microsoft C runtime, but we probably need to provide a workaround for it in Python. -- nosy: +amaury.forgeotdarc, krisvale, loewis, mhammond, ocean-city, r.david.murray versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10762 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10759] HTMLParser.unescape() fails on HTML entities with incorrect syntax (e.g. #hearts; )
Senthil Kumaran orsent...@gmail.com added the comment: Yes, I too agree that HTMLParser.unescape() should split-out malformed char-ref just as other browsers do. But, as unescape function has undocumented/unexposed for releases, I am not sure making it exposed is a good idea. HTMLParser is more for event based parsing of tags, and unescape is a just a helper function in that context. Given that reasoning if you see the malformatted test, you see that event based parsing does return the malformatted data properly For e.g - (data, #bad;). Only calling unescape explicitly does not exhibit this behavior. Martin: I am not sure if changing something in line 168 would solve the issue. In that particular block of code, the else condition is responsible for throwing the malformed charref on an event. If would like to elaborate a bit more on your suggestion, it would be helpful. However, I do agree that unescape can be changed as per your patch and I have added a simple test to exercise that change. I think, this can go in. -- assignee: - orsenthil stage: unit test needed - patch review versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6 Added file: http://bugs.python.org/file20147/Issue10759.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10759 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7511] msvc9compiler.py: ValueError: [u'path']
Thorsten Behrens sbehr...@gmx.li added the comment: You are right, this is not a bug in Python. The diff provides a workaround for a limitation in VC++ 2008 Express. This diff is a piece of user service. An equally as workable workaround is for the user to copy VC\bin\vcvars64.bat into VC\bin\amd64\vcvarsamd64.bat. Once that is done, distutils works without the workaround provided in this diff. Whether to provide a workaround within Python for an issue in VC++ 2008 Express can certainly be debated. I for one suggest to err on the side of being friendly, rather than insisting on purity. Consider that users of Python do include hobbyists and students. For them, VC++ Pro may be out of reach. And there are plenty of reasons for building 64-bit binaries, among them learning exercises. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Éric Araujo mer...@netwok.org added the comment: I believe the patch should add the used but non-standard image/svg+xml type to the common_type dictionary, not invent a new x- type. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault
STINNER Victor victor.stin...@haypocalc.com added the comment: p3k_i9313.diff is just a workaround, not the correct fix. The problem is that PyTokenizer_FindEncoding() doesn't get the filename. I wrote tokenizer_encoding_filename.patch which add PyTokenizer_FindEncodingFilename() and patch import.c and traceback.c to pass the filename. Hum, I'm not sure that my patch works if the locale encoding is not UTF-8: import.c manipulates path in the filesystem encoding, whereas PyTokenizer_FindEncodingFilename() expects UTF-8 filename. See this patch as a draft, I will try to fix the encoding issue. -- Added file: http://bugs.python.org/file20148/tokenizer_encoding_filename.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault
STINNER Victor victor.stin...@haypocalc.com added the comment: See also #9738 (Document the encoding of functions bytes arguments of the C API) to check which encoding is expected :-p -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9319 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10764] sysconfig and alternative implementations
New submission from Michael Foord mich...@voidspace.org.uk: sysconfig assumes there will be a makefile if the platform is posix, which isn't always true. For example IronPython on Mac OS X with mono. This leads to a traceback on startup with IronPython 2.7: $ ipy27 Traceback (most recent call last): File /Second/michael/Downloads/IronPython-2.7/Lib/site.py, line 548, in module File /Second/michael/Downloads/IronPython-2.7/Lib/site.py, line 530, in main File /Second/michael/Downloads/IronPython-2.7/Lib/site.py, line 264, in addusersitepackages File /Second/michael/Downloads/IronPython-2.7/Lib/site.py, line 239, in getusersitepackages File /Second/michael/Downloads/IronPython-2.7/Lib/site.py, line 229, in getuserbase File /Second/michael/Downloads/IronPython-2.7/Lib/sysconfig.py, line 518, in get_config_var File /Second/michael/Downloads/IronPython-2.7/Lib/sysconfig.py, line 421, in get_config_vars File /Second/michael/Downloads/IronPython-2.7/Lib/sysconfig.py, line 275, in _init_posix IOError: invalid Python installation: unable to open /Volumes/Second Drive/michael/Downloads/IronPython-2.7/lib/python2.7/config/Makefile (Could not find a part of the path /Volumes/Second Drive/michael/Downloads/IronPython-2.7/lib/python2.7/config/Makefile.)IronPython 2.7 Beta 1 (2.7.0.10) on .NET 4.0.30319.1 Type help, copyright, credits or license for more information. -- messages: 124560 nosy: eric.araujo, michael.foord, tarek priority: normal severity: normal status: open title: sysconfig and alternative implementations versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10764 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
R. David Murray rdmur...@bitdance.com added the comment: Yes, adding the x- version would probably be pointless as most likely nobody uses it. Has anyone found any definitive info on where exactly in the approval process image/svg+xml is? I think we should probably just go ahead and put it in, but it would be nice to link to some mailing list discussion somewhere that indicates that it is solidly standards track. I found a mailing list posting from 2000 about browser support. I found this: http://www.w3.org/TR/SVG/intro.html from June 2010 saying the registration was in progress at the w3c. How w3c registration relates to IANA registration is not entirely clear, but most likely IANA wouldn't register it without w3c approving it first. RFC 3023 mentions it and says it hasn't been approved yet so it shouldn't be used. That was in 2001. Why the incredibly long delay? As best as I can guess, the mime-type registration is conditioned on the acceptance of the underlying SVG standard it references, and that standard (SVG 1.1) has not yet been ratified by the W3C, which is, if I'm underanding the RFCs correctly, required for IANA approval of the media type request. SVG 1.1 has, according to wikipedia, been put out for Last Call. All of which seems pretty irrelevant to the value and likely stability of the image/svg+xml name itself. Since all the major browsers are supporting it, as far as I can tell, I think Python should too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10743] 3.2's sysconfig doesn't work with virtualenv
Sridhar Ratnakumar sridh...@activestate.com added the comment: Sounds good, but this doesn't belong to the virtualenv bug tracker (virtualenv does even support Python 3). Instead, it belongs to the virtualenv5 tracker: http://code.google.com/p/virtualenv5/issues/detail?id=6 -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10743 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7511] msvc9compiler.py: ValueError: [u'path']
ipatrol ipatrol6...@yahoo.com added the comment: Purity shmurity. The point of distutils is largely to present a unified and simple interface. 'python setup.py install' should be all a user has to do on any platform. Unless you can come up with a better idea, MSVC is really the only big compiler on Windows. -- versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7511 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Terry J. Reedy tjre...@udel.edu added the comment: I obviously misunderstood the instruction about 'x-' and will remove that. Should I leave the entry where it is or move as Éric suggested? -- Added file: http://bugs.python.org/file20149/mimetypes.svg2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Éric Araujo mer...@netwok.org added the comment: I’m not sure; the common_types is actually for invalid but used types, like image/jpg (the correct one is image/jpeg and is listed in types_map). The status of IANA registration is unclear (thanks David for looking at that); since common tools understand that media type, let’s pretend it’s registered. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
R. David Murray rdmur...@bitdance.com added the comment: No, I don't think it qualifies as a common_type. But since this is technically a feature request we need Georg's approval for the commit. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4496] misleading comment in urllib2
R. David Murray rdmur...@bitdance.com added the comment: It is used in the tests, but I agree that it doesn't appear to be used in the code. I've removed the misleading comment and marked the self.handlers attribute as backward-compat-only in r87448, r87449, and r87450. The sorting is based on a 'handler_order' attribute, by the way, and presumably does control the order in which they are applied. -- nosy: +jhylton, r.david.murray resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4496 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1155362] Bugs in parsedate_tz
R. David Murray rdmur...@bitdance.com added the comment: Committed a slightly different patch in r87451, with tests. Although I do consider this a bug fix, it hasn't apparently caused any problems in real life and does represent a slight behavior change, so I'm not backporting it. -- resolution: - fixed stage: unit test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1155362 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
R. David Murray rdmur...@bitdance.com added the comment: Got approval from Georg on IRC, so go ahead and commit it, Terry. Or assign it to me if you'd rather I do it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10576] Add a progress callback to gcmodule
Lukas Lueg lukas.l...@gmail.com added the comment: Why not make the start-callback be able to return a boolean value to the gcmodule that indicates if garbage collection should take place or not. For example, any value returned from the callback that evaluates to False (like null) will cause the module to evaluate any other callback and possibly collect garbage objects. Any value that evaluates to True (like True) returned from any callback causes all further callbacks to not be called and garbage collection not to take place now. -- nosy: +ebfe ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10576 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6011] python doesn't build if prefix contains non-ascii characters
Éric Araujo mer...@netwok.org added the comment: I can’t reproduce the crash when building in the source dir (and tests pass except for ctypes because its configure script refuses my directory path), and I can’t build in a subdir*, so this bug looks fixed. * Error messages: gcc: Parser/tokenizer_pgen.o: No such file or directory gcc: Parser/printgrammar.o: No such file or directory gcc: Parser/pgenmain.o: No such file or directory -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6011 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1693546] email.Message set_param rfc2231 encoding incorrect
R. David Murray rdmur...@bitdance.com added the comment: Reading the RFC again, I think you are right. The quoted vs unquoted sounds like it refers to the *n vs the [*n]* forms, and the latter doesn't use quoted strings but % encoding. I'm attaching a patch that adds some tests and fixes this. It's a visible behavior change so it won't be backported. Clearly mailers accept the quoted form, but we prefer to be strictly RFC compliant on output. The behavior change is that whereas previously unquoted values on parse got quotes added on serialization, now quoted values on parse will lose their quotes on serialization. -- keywords: +patch stage: unit test needed - patch review versions: -Python 2.7, Python 3.1 Added file: http://bugs.python.org/file20150/rfc2231_quoting.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1693546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10730] add .svgz to mimetypes.suffix_map and .svg to types_map
Terry J. Reedy tjre...@udel.edu added the comment: r87460 -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10730 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1693546] email.Message set_param rfc2231 encoding incorrect
R. David Murray rdmur...@bitdance.com added the comment: I take it back. Previously quotes didn't get added if they weren't already there. So my simpleminded fix may not be the best choice. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1693546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10765] Build regression from automation changes on windows
New submission from Martin gzl...@googlemail.com: The build changes in r87093 broke me, as my py3k branch is under a dir with a space in the name, and the OutDir path needs escaping in the makefiles. Various extra quoting seems to be sufficient, though inelegant. -- components: Build, Windows files: py3k_build.patch keywords: patch messages: 124575 nosy: gz, loewis priority: normal severity: normal status: open title: Build regression from automation changes on windows type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20151/py3k_build.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10765 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4391] use proper gettext plurals forms in argparse and optparse
Éric Araujo mer...@netwok.org added the comment: Updated patch for optparse. Georg: Is this okay for 3.2? Based on Steven’s decision for another patch that changed strings, these fixes won’t be backported. -- versions: -Python 2.7, Python 3.1 Added file: http://bugs.python.org/file20152/fix-optparse-ngettext.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4391 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10765] Build regression from automation changes on windows
Martin gzl...@googlemail.com added the comment: Oh, and after building with this, I get: $ svn st ? PC/python3dll.obj So either that wants moving or svn:ignore needs updating. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10765 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10766] optparse uses %s in gettext calls
New submission from Éric Araujo mer...@netwok.org: When you run xgettext other optparse.py, you get this warning: “'msgid' format string with unnamed arguments cannot be properly localized: The translator cannot reorder the arguments. Please consider using a format string with named arguments, and a mapping instead of a tuple for the arguments.” Attached patch fixes the incorrect calls (my patch for #4391 already fixes two of them). See similar bug and fix for argparse in #10528. Georg, please tell if this can go into 3.2. -- assignee: eric.araujo components: Library (Lib) files: fix-gettext-positionals.diff keywords: patch messages: 124578 nosy: eric.araujo, georg.brandl, gward priority: normal severity: normal stage: commit review status: open title: optparse uses %s in gettext calls type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file20153/fix-gettext-positionals.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10766 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10766] optparse uses %s in gettext calls
Changes by Éric Araujo mer...@netwok.org: -- dependencies: +use proper gettext plurals forms in argparse and optparse ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10766 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com