ANN: dh-virtualenv 0.5 released
Hi, We (Spotify) have released the first public release of dh-virtualenv, a packaging tool that makes it possible to package virtualenvs inside Debian packaging. dh-virtualenv works by registering itself as a part of debhelper sequence, so pretty much any pre-existing Debian build system you have should be compatible with it. dh-virtualenv is released under GPL version 2 or later. Source code for it can be found here: https://github.com/spotify/dh-virtualenv Documentation: http://dh-virtualenv.readthedocs.org/en/latest/ ..and the accompanying release blog post: http://labs.spotify.com/2013/10/10/packaging-in-your-packaging-dh-virtualenv/ Cheers, Jyrki Pulliainen Software engineer @ Spotify -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
ANN: matplotlib 1.3.1
I'm pleased to announce the release of matplotlib version 1.3.1. This is a bugfix release. It may be downloaded from here, or installed through the package manager of your choice (when available): http://matplotlib.org/downloads The changelog is copied below: New in 1.3.1 1.3.1 is a bugfix release, primarily dealing with improved setup and handling of dependencies, and correcting and enhancing the documentation. The following changes were made in 1.3.1 since 1.3.0. Enhancements - Added a context manager for creating multi-page pdfs (see `matplotlib.backends.backend_pdf.PdfPages`). - The WebAgg backend should no have lower latency over heterogeneous Internet connections. Bug fixes ` - Histogram plots now contain the endline. - Fixes to the Molleweide projection. - Handling recent fonts from Microsoft and Macintosh-style fonts with non-ascii metadata is improved. - Hatching of fill between plots now works correctly in the PDF backend. - Tight bounding box support now works in the PGF backend. - Transparent figures now display correctly in the Qt4Agg backend. - Drawing lines from one subplot to another now works. - Unit handling on masked arrays has been improved. Setup and dependencies `` - Now works with any version of pyparsing 1.5.6 or later, without displaying hundreds of warnings. - Now works with 64-bit versions of Ghostscript on MS-Windows. - When installing from source into an environment without Numpy, Numpy will first be downloaded and built and then used to build matplotlib. - Externally installed backends are now always imported using a fully-qualified path to the module. - Works with newer version of wxPython. - Can now build with a PyCXX installed globally on the system from source. - Better detection of Gtk3 dependencies. Testing ``` - Tests should now work in non-English locales. - PEP8 conformance tests now report on locations of issues. Mike -- _ |\/|o _|_ _. _ | | \.__ __|__|_|_ _ _ ._ _ | ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | | http://www.droettboom.com -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: Unicode Objects in Tuples
On Fri, Oct 11, 2013 at 7:31 AM, Stephen Tucker stephen_tuc...@sil.org wrote: On the original question, well, I accept Ned's answer (at 10.22). I also like the idea of a helper function given by Peter Otten at 09.51. It still seems like a crutch to help poor old Python 2.X to do what any programmer (or, at least the programmers like me :-) ) think it ought to be able to by itself. The distinction between the geekiness of a tuple compared with the non-geekiness of a string is, itself, far too geeky for my liking. The distinction seems to be an utterly spurious - even artificial or arbitrary one to me. (Sorry about the rant.) I agree, and that's not how I would explain the distinction. The str of an object is meant to be human-readable, while the repr of an object is meant to be something that could be pasted into the interpreter to reconstruct the object. In the case of tuples, the repr of the tuple uses the reprs of the components because the resulting string will more likely be acceptable to the interpreter, and the str of the tuple is the same as the repr because there is no convincing reason why it should be different. -- https://mail.python.org/mailman/listinfo/python-list
Re: ANN: CUI text editor Kaa 0.0.4
Hi, Thank you for your question. What's a console user interface? That's what Windows calls a DOS box. But otherwise you seem to imply it runs on Linux. I meant to say something like DOS box or Linux terminals. Unfortunately, Kaa does not work on Windows DOS box since Kaa requires curses library to run. So, what OS's does it support? Which terminal programs? Currently, Kaa is tested on Mac OS X 10.8.5 and Ubuntu 13.04 box. I usually use iTerm2 on Mac and Gnome Terminal on Ubuntu. Does it only work locally, or can it work from an ssh terminal? Works for both locally and ssh terminal. Can it run within screen? Yes, but as Emacs or bash, default escape character of screen(^A) conflicts with Kaa,. So I recommend to assign another character for screen. Regards, -- https://mail.python.org/mailman/listinfo/python-list
What version of glibc is Python using?
I'm trying to find out which version of glibc Python is using. I need a fix that went into glibc 2.10 back in 2009. (http://udrepper.livejournal.com/20948.html) So I try the recommended way to do this, on a CentOS server: /usr/local/bin/python2.7 Python 2.7.2 (default, Jan 18 2012, 10:47:23) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type help, copyright, credits or license for more information. import platform platform.libc_ver() ('glibc', '2.3') This is telling me that the Python distribution built in 2012, with a version of GCC released April 16, 2011, is using glibc 2.3, released in October 2002. That can't be right. I tried this on a different Linux machine, a desktop running Ubuntu 12.04 LTS: Python 2.7.3 (defualt, April 10 2013, 06:20:15) [GCC 4.6.3] on linux2 ('glibc', '2.7') That version of glibc is from October 2007. Where are these ancient versions coming from? They're way out of sync with the GCC version. John Nagle -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
Am 12.10.13 08:34, schrieb John Nagle: I'm trying to find out which version of glibc Python is using. I need a fix that went into glibc 2.10 back in 2009. (http://udrepper.livejournal.com/20948.html) So I try the recommended way to do this, on a CentOS server: /usr/local/bin/python2.7 Python 2.7.2 (default, Jan 18 2012, 10:47:23) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type help, copyright, credits or license for more information. import platform platform.libc_ver() ('glibc', '2.3') Try ldd /usr/local/bin/python2.7 Then execute the reported libc.so, which gives you some information. Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On 10/11/2013 11:50 PM, Christian Gollwitzer wrote: Am 12.10.13 08:34, schrieb John Nagle: I'm trying to find out which version of glibc Python is using. I need a fix that went into glibc 2.10 back in 2009. (http://udrepper.livejournal.com/20948.html) So I try the recommended way to do this, on a CentOS server: /usr/local/bin/python2.7 Python 2.7.2 (default, Jan 18 2012, 10:47:23) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type help, copyright, credits or license for more information. import platform platform.libc_ver() ('glibc', '2.3') Try ldd /usr/local/bin/python2.7 Then execute the reported libc.so, which gives you some information. Christian Thanks for the quick reply. That returned: /lib64/libc.so.6 GNU C Library stable release version 2.12, by Roland McGrath et al. Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiled by GNU CC version 4.4.6 20110731 (Red Hat 4.4.6-3). Compiled on a Linux 2.6.32 system on 2011-12-06. Available extensions: The C stubs add-on version 2.1.2. crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5B RT using linux kernel aio libc ABIs: UNIQUE IFUNC For bug reporting instructions, please see: http://www.gnu.org/software/libc/bugs.html. Much more helpful. I have a good version of libc, and can now work on my DNS resolver problem. Why is the info from plaform.libc_ver() so bogus? John Nagle -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
In article l3as90$5bk$1...@dont-email.me, John Nagle na...@animats.com wrote: [...] Why is the info from plaform.libc_ver() so bogus? The code is here: http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141 Perhaps you could open an issue on the Python bug tracker. -- Ned Deily, n...@acm.org -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
Am 12.10.13 09:20, schrieb Ned Deily: In article l3as90$5bk$1...@dont-email.me, John Nagle na...@animats.com wrote: [...] Why is the info from plaform.libc_ver() so bogus? The code is here: http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141 Perhaps you could open an issue on the Python bug tracker. That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
Am 12.10.13 09:53, schrieb Christian Gollwitzer: Am 12.10.13 09:20, schrieb Ned Deily: In article l3as90$5bk$1...@dont-email.me, John Nagle na...@animats.com wrote: [...] Why is the info from plaform.libc_ver() so bogus? The code is here: http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141 Perhaps you could open an issue on the Python bug tracker. That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. And it also explains why this fails: egrep -o -a GLIBC_[0-9.]* /usr/bin/python reports multiple matches, with the first being the lowest compatibility version. Christian -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: Am 12.10.13 09:20, schrieb Ned Deily: In article l3as90$5bk$1...@dont-email.me, John Nagle na...@animats.com wrote: [...] Why is the info from plaform.libc_ver() so bogus? The code is here: http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141 Perhaps you could open an issue on the Python bug tracker. That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. So *please* submit a patch with explanation. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Why isn't this code working how I want it to?
I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... Thanks for any help. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
On Saturday, October 12, 2013 10:56:27 AM UTC+2, reuben...@gmail.com wrote: I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... Thanks for any help. Hi, Remember that keys in a dictionary are unique. So if you defined ( means it I typed it at the interactive terminal prompt, d = { 'filled' : 'apple' , 'filled' : 'orange' } and do a print d it will show: {'filled': 'orange'} One way to solve this problem is to define two dictionaries. One holding the status of the variable, the other one holding the data. For example: status = { 'a' : 'filled', 'b' : 'empty', 'c' : 'filled' } data = { 'a' : 'orange', 'b' : 'apple', 'c' : 'banana' } for k in status: if status[k]=='filled': print data[k] Regards and let us know if it works for you, Marco -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
reubennott...@gmail.com wrote: I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} You have duplicate keys here, which becomes obvious when you spell out the values testdict = {filled: apple, filled: banana, ...} When you do that, the last value (banana) wins, all others (e. g. apple) are dropped. Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... A dictionary is spot-on, but you have to use the unique apple, banana,... as keys: status = {apple: filled, banana: filled, cake: empty} for item in status: ... if status[item] == filled: ... print(item) ... apple banana Could it be that you just confused dict keys with dict values? -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
On 12/10/2013 09:56, reubennott...@gmail.com wrote: I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... Thanks for any help. You've effectively set up a dictionary with keys 'filled' and 'entries' which you can see if you run this loop for key, value in testdict.items(): print(key, value) which gives me this empty fish filled glue I'm too lazy to type anything else so please refer to this http://stackoverflow.com/questions/843277/how-do-i-check-if-a-variable-exists-in-python. I'll also leave the argument over whether it's a variable or a name to others :) -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
reubennott...@gmail.com writes: [...] The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) This is equivalent to for fillempt in testdict: if fillempt == 'filled': print(testdict['filled']) which in turn can be optimized to if 'filled' in testdict: print(testdict['filled']) without knowing anything of the contents of tesdict. -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode Objects in Tuples
On 10/12/13 2:20 AM, Ian Kelly wrote: On Fri, Oct 11, 2013 at 7:31 AM, Stephen Tucker stephen_tuc...@sil.org wrote: On the original question, well, I accept Ned's answer (at 10.22). I also like the idea of a helper function given by Peter Otten at 09.51. It still seems like a crutch to help poor old Python 2.X to do what any programmer (or, at least the programmers like me :-) ) think it ought to be able to by itself. The distinction between the geekiness of a tuple compared with the non-geekiness of a string is, itself, far too geeky for my liking. The distinction seems to be an utterly spurious - even artificial or arbitrary one to me. (Sorry about the rant.) I agree, and that's not how I would explain the distinction. The str of an object is meant to be human-readable, while the repr of an object is meant to be something that could be pasted into the interpreter to reconstruct the object. In the case of tuples, the repr of the tuple uses the reprs of the components because the resulting string will more likely be acceptable to the interpreter, and the str of the tuple is the same as the repr because there is no convincing reason why it should be different. This idea that the repr can reconstruct the object always fell flat with me since the vast majority of classes don't have a repr that works that way. I look at it a little differently: the repr is meant to be as unambiguous as possible to a developer. It turns out that Python literal syntax is really good at that, so where possible, that's what's used. But most classes don't make an attempt to create a Python expression, because that's very difficult, and in fact, the literal syntax may not be useful: object() object object at 0x1088bb0d0 Here, the valid Python syntax is object(), but that's useless as a repr, because it doesn't help you distinguish between two instances. In fact, you say repr could be used to reconstruct the object, but really what you mean is reconstruct an equal object. There is no way to construct an equal object(), so right at the root of the Python object hierarchy, repr doesn't even attempt it. --Ned. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
On Saturday, October 12, 2013 10:20:24 AM UTC+1, Peter Otten wrote: reubennott...@gmail.com wrote: I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} You have duplicate keys here, which becomes obvious when you spell out the values testdict = {filled: apple, filled: banana, ...} When you do that, the last value (banana) wins, all others (e. g. apple) are dropped. Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... A dictionary is spot-on, but you have to use the unique apple, banana,... as keys: status = {apple: filled, banana: filled, cake: empty} for item in status: ... if status[item] == filled: ... print(item) ... apple banana Could it be that you just confused dict keys with dict values? This fixed it, thank you! I did think a dictionary was right; I never considered swapping the keys with the values, though. A simple 'fix, but it worked. You've been a great help. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why isn't this code working how I want it to?
On 12/10/2013 12:03, reubennott...@gmail.com wrote: On Saturday, October 12, 2013 10:20:24 AM UTC+1, Peter Otten wrote: reubennott...@gmail.com wrote: I've been working on a program and have had to halt it due a slight problem. Here's a basic version of the code: a = 'filled' b = 'filled' c = 'empty' d = 'empty' e = 'filled' f = 'empty' g = 'filled' testdict = {a : 'apple' , b : 'banana' , c : 'cake' , d : 'damson' , e : 'eggs' , f : 'fish' , g : 'glue'} You have duplicate keys here, which becomes obvious when you spell out the values testdict = {filled: apple, filled: banana, ...} When you do that, the last value (banana) wins, all others (e. g. apple) are dropped. Now what I want to do, is if a variable is filled, print it out. This however isn't working how I planned. The following doesn't work. for fillempt in testdict: if fillempt == 'filled': print(testdict[fillempt]) All this does though, is print glue, where I'd want it to print: apple banana eggs glue Perhaps a dictionary isn't the best way to do this.. I wonder what else I can do... A dictionary is spot-on, but you have to use the unique apple, banana,... as keys: status = {apple: filled, banana: filled, cake: empty} for item in status: ... if status[item] == filled: ... print(item) ... apple banana Could it be that you just confused dict keys with dict values? This fixed it, thank you! I did think a dictionary was right; I never considered swapping the keys with the values, though. A simple 'fix, but it worked. You've been a great help. That's good to hear. Would you please read and digest this https://wiki.python.org/moin/GoogleGroupsPython if you need to post again, a quick glance above will soon tell you why :) -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On Sat, Oct 12, 2013 at 2:46 AM, Terry Reedy tjre...@udel.edu wrote: On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. So *please* submit a patch with explanation. Easier said than done. The module is currently written in pure Python, and the comment Note: Please keep this module compatible to Python 1.5.2 would appear to rule out the use of ctypes to call the glibc function. I wonder though whether that comment is really still appropriate. -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On Sat, 12 Oct 2013 05:43:22 -0600, Ian Kelly wrote: On Sat, Oct 12, 2013 at 2:46 AM, Terry Reedy tjre...@udel.edu wrote: On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. So *please* submit a patch with explanation. Easier said than done. The module is currently written in pure Python, and the comment Note: Please keep this module compatible to Python 1.5.2 would appear to rule out the use of ctypes to call the glibc function. I wonder though whether that comment is really still appropriate. if sys.version '2.5': # I think that's when ctypes was introduced import ctypes do_the_right_thing() else: do_something_bogus() Works for me :-) -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Unicode Objects in Tuples
In article mailman.1034.1381575143.18130.python-l...@python.org, Ned Batchelder n...@nedbatchelder.com wrote: This idea that the repr can reconstruct the object always fell flat with me since the vast majority of classes don't have a repr that works that way. I look at it a little differently: the repr is meant to be as unambiguous as possible to a developer. It turns out that Python literal syntax is really good at that, so where possible, that's what's used. But most classes don't make an attempt to create a Python expression, because that's very difficult Well, it's not actually difficult. You could imagine doing something like: def __repr__(self): return pickle.loads(%s) % pickle.dumps(self) and while you can paste that into a REPL, it's not really useful to most people. What we do with our database model layer is have the repr include the name of the class and the primary key. So: str(u) 'roysmith' repr(u) User 1000564: u'roysmith' That follow's Ned's idea that reprs should be unambiguous. In this case, if I want to reconstitute myself as an object, I can just do a database query for user_id = 1000564. -- https://mail.python.org/mailman/listinfo/python-list
web scraping
I am new to programming and trying to figure out python. I am trying to learn which tools and tutorials I need to use along with some good beginner tutorials in scraping the the web. The end result I am trying to come up with is scraping auto dealership sites for the following: 1.Name of dealership 2. State where dealership is located 3. Name of Owner, President or General Manager 4. Email address of number 3 above 5. Phone number of dealership Note: Many times the Owner, President or General Manager and their email address is under a tab on the website such as Meet our team or Support. Sometimes this information is not available on the website. I sure would appreciate any help I can get to get me on the right track. From what I have read so far, believe I have to use urllib but know nothing about how to us it.. Thanks ronro...@gmail.com -- https://mail.python.org/mailman/listinfo/python-list
Re: web scraping
On 12/10/2013 15:12, Ronald Routt wrote: I am new to programming and trying to figure out python. I am trying to learn which tools and tutorials I need to use along with some good beginner tutorials in scraping the the web. The end result I am trying to come up with is scraping auto dealership sites for the following: 1.Name of dealership 2. State where dealership is located 3. Name of Owner, President or General Manager 4. Email address of number 3 above 5. Phone number of dealership Note: Many times the Owner, President or General Manager and their email address is under a tab on the website such as Meet our team or Support. Sometimes this information is not available on the website. I sure would appreciate any help I can get to get me on the right track. From what I have read so far, believe I have to use urllib but know nothing about how to us it.. Thanks ronro...@gmail.com Take a look at this http://www.crummy.com/software/BeautifulSoup/ -- Roses are red, Violets are blue, Most poems rhyme, But this one doesn't. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On 10/12/2013 7:43 AM, Ian Kelly wrote: On Sat, Oct 12, 2013 at 2:46 AM, Terry Reedy tjre...@udel.edu wrote: On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. Was this always presence and missed, or has it been added in say, the last 10 years? So *please* submit a patch with explanation. Easier said than done. The module is currently written in pure Python, and the comment Note: Please keep this module compatible to Python 1.5.2 would appear to rule out the use of ctypes to call the glibc function. I wonder though whether that comment is really still appropriate. I do not see that line in the 3.4 version. Anyway, submit a patch with explanation and assign the issue to lemburg, who is the maintainer. (He sells 3rd party add-ons and obvious uses this function for those.) He can decide if a conditional (2.4) is needed. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Error connecting to MySQL from Python
Hello guys I am currently working in a python project at my school. First I want to make clear that I'm not a python programmer (I was just called to put out the flames in this project because no one else would and I was brave enough to say yes). I have the following problem here. I have to write a method that connects to an existing localhost MySQL database (I'm using connector version 1.0.12) and then does pretty basic stuff. The parameters are sent by a GTK-written GUI (I didn't write that interface). So I wrote my method like this: --PYTHON CODE def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try connecting to DB try: print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user, password,'localhost',database) except: print Error: Database connection failed. User name or Database name may be wrong return #More code ... END OF PYTHON CODE- But when I run my code I get this: -CONSOLE OUTPUT Calling conn with U:root P:PK17LP12r DB:TESTERS Error: Database connection failed. User name or Database name may be wrong ---END OF COLSOLE OUTPUT--- And I don't know why, since the arguments sent are the same arguments that get printed (telling me that the GUI the other guy coded works fine) and they are valid login parameters. If I hardcode the login parameters directly insetad of using the GUI everything goes ok and the functions executes properly; the following code executes nice and smooth: --PYTHON CODE- def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try hardcoding try: #print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user=root, password='PK17LP12r',host='localhost',database='TESTERS') print 'No prob with conn' except: print Error: Database connection failed. User name or Database name may be wrong return #more code ... END OF PYTHON CODE-- Console output: CONSOLE OUTPUT-- No prob with conn END OF CONSOLE OUTPUT--- Any ideas guys? This one is killing me. I'm just learning Python but I imagine the problem to be something very easy for a seasoned python developer so any help would be strongly appreciated. Thanks in advance. -- https://mail.python.org/mailman/listinfo/python-list
Re: Error connecting to MySQL from Python
carlos.ortiz@gmail.com writes: So I wrote my method like this: ... cnxOMC = mysql.connector.connect(user, password, 'localhost', database) ... the following code executes nice and smooth: ... cnxOMC = mysql.connector.connect(user=root, password='PK17LP12r', host='localhost', database='TESTERS') You pass the hardcoded parameters as keyword arguments, unlike in the version that doesn't work. Maybe that is the difference. Try this: cnxOMC = mysql.connector.connect(user=user, password=password, host='localhost', database=database) It only looks funny. In user=user the first user is a parameter name, the other is the variable in your code. Try help(mysql.connector.connect) at the interactive prompt, or otherwise check the documentation. -- https://mail.python.org/mailman/listinfo/python-list
Re: Error connecting to MySQL from Python
On 12/10/2013 17:09, carlos.ortiz@gmail.com wrote: Hello guys I am currently working in a python project at my school. First I want to make clear that I'm not a python programmer (I was just called to put out the flames in this project because no one else would and I was brave enough to say yes). I have the following problem here. I have to write a method that connects to an existing localhost MySQL database (I'm using connector version 1.0.12) and then does pretty basic stuff. The parameters are sent by a GTK-written GUI (I didn't write that interface). So I wrote my method like this: --PYTHON CODE def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try connecting to DB try: print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user, password,'localhost',database) except: print Error: Database connection failed. User name or Database name may be wrong return #More code ... END OF PYTHON CODE- But when I run my code I get this: -CONSOLE OUTPUT Calling conn with U:root P:PK17LP12r DB:TESTERS Error: Database connection failed. User name or Database name may be wrong ---END OF COLSOLE OUTPUT--- And I don't know why, since the arguments sent are the same arguments that get printed (telling me that the GUI the other guy coded works fine) and they are valid login parameters. If I hardcode the login parameters directly insetad of using the GUI everything goes ok and the functions executes properly; the following code executes nice and smooth: --PYTHON CODE- def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try hardcoding try: #print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user=root, password='PK17LP12r',host='localhost',database='TESTERS') print 'No prob with conn' except: print Error: Database connection failed. User name or Database name may be wrong return #more code ... END OF PYTHON CODE-- Console output: CONSOLE OUTPUT-- No prob with conn END OF CONSOLE OUTPUT--- Any ideas guys? This one is killing me. I'm just learning Python but I imagine the problem to be something very easy for a seasoned python developer so any help would be strongly appreciated. In the first example you're using positional arguments, whereas in the second example you're using keyword arguments. Are you sure that the positional arguments are in the correct order? Try using keyword arguments in the first argument: cnxOMC = mysql.connector.connect(user=user, password=password, host='localhost', database=database) It might also help if you print the repr of the arguments; that way you'll be able to see the difference between, say, 0 and 0. On another point, using a 'bare' except (except:) is virtually always a *bad* idea. It'll catch _all_ exceptions, including NameError, which could indicate a bug in your code. Catch only what you need to, only what you're expecting and can handle. -- https://mail.python.org/mailman/listinfo/python-list
Re: Error connecting to MySQL from Python
On Saturday, October 12, 2013 11:46:49 AM UTC-5, Jussi Piitulainen wrote: carlos.o...@gmail.com writes: So I wrote my method like this: ... cnxOMC = mysql.connector.connect(user, password, 'localhost', database) ... the following code executes nice and smooth: ... cnxOMC = mysql.connector.connect(user=root, password='PK17LP12r', host='localhost', database='TESTERS') You pass the hardcoded parameters as keyword arguments, unlike in the version that doesn't work. Maybe that is the difference. Try this: cnxOMC = mysql.connector.connect(user=user, password=password, host='localhost', database=database) It only looks funny. In user=user the first user is a parameter name, the other is the variable in your code. Try help(mysql.connector.connect) at the interactive prompt, or otherwise check the documentation. Thanks a lot man, it worked flawlessly. -- https://mail.python.org/mailman/listinfo/python-list
Re: OT: looking for best solutions for tracking projects and skills
I don't know about civic hacking, but Trello is a free online tool to track high level aspects of collaborative projects. It is somewhat focused on a to do planning perspective. But with the customizable columns, labels, and checklists associated with items in the view I think you might be able to track static info like skills. -Rob On Fri, Oct 11, 2013 at 11:09 PM, Jason Hsu jhsu802...@gmail.com wrote: I realize this is off-topic, but I'm not sure what forum is best for asking about this. I figure that at least a few of you are involved in civic hacking groups. I recently joined a group that does civic hacking. (Adopt-A-Hydrant is an example of civic hacking.) We need a solution for tracking projects and the skills needed for the projects (such as Ruby on Rails, Python, Drupal, Javascript, etc.). I'd like to hear from those of you in similar groups that have a great system for tracking projects. Is there an in-house solution you use, or is there something else available? -- https://mail.python.org/mailman/listinfo/python-list -- Robert Clewley, Ph.D. Assistant Professor Neuroscience Institute and Department of Mathematics and Statistics Georgia State University PO Box 5030 Atlanta, GA 30302, USA tel: 404-413-6420 fax: 404-413-5446 http://neuroscience.gsu.edu/rclewley.html -- https://mail.python.org/mailman/listinfo/python-list
Re: Error connecting to MySQL from Python
On Saturday, October 12, 2013 12:13:05 PM UTC-5, MRAB wrote: On 12/10/2013 17:09, carlos.o...@gmail.com wrote: Hello guys I am currently working in a python project at my school. First I want to make clear that I'm not a python programmer (I was just called to put out the flames in this project because no one else would and I was brave enough to say yes). I have the following problem here. I have to write a method that connects to an existing localhost MySQL database (I'm using connector version 1.0.12) and then does pretty basic stuff. The parameters are sent by a GTK-written GUI (I didn't write that interface). So I wrote my method like this: --PYTHON CODE def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try connecting to DB try: print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user, password,'localhost',database) except: print Error: Database connection failed. User name or Database name may be wrong return #More code ... END OF PYTHON CODE- But when I run my code I get this: -CONSOLE OUTPUT Calling conn with U:root P:PK17LP12r DB:TESTERS Error: Database connection failed. User name or Database name may be wrong ---END OF COLSOLE OUTPUT--- And I don't know why, since the arguments sent are the same arguments that get printed (telling me that the GUI the other guy coded works fine) and they are valid login parameters. If I hardcode the login parameters directly insetad of using the GUI everything goes ok and the functions executes properly; the following code executes nice and smooth: --PYTHON CODE- def compMySQL(self, user, database, password, db_level, table_level, column_level): sql_page_textview = self.mainTree.get_widget('sql_text_view') sql_page_textview.modify_font(pango.FontDescription(courier 10)) sql_page_buffer = sql_page_textview.get_buffer() #Gonna try hardcoding try: #print(Calling conn with U:{0} P:{1} DB:{2}.format(user,password,database)) cnxOMC = mysql.connector.connect(user=root, password='PK17LP12r',host='localhost',database='TESTERS') print 'No prob with conn' except: print Error: Database connection failed. User name or Database name may be wrong return #more code ... END OF PYTHON CODE-- Console output: CONSOLE OUTPUT-- No prob with conn END OF CONSOLE OUTPUT--- Any ideas guys? This one is killing me. I'm just learning Python but I imagine the problem to be something very easy for a seasoned python developer so any help would be strongly appreciated. In the first example you're using positional arguments, whereas in the second example you're using keyword arguments. Are you sure that the positional arguments are in the correct order? Try using keyword arguments in the first argument: cnxOMC = mysql.connector.connect(user=user, password=password, host='localhost', database=database) It might also help if you print the repr of the arguments; that way you'll be able to see the difference between, say, 0 and 0. On another point, using a 'bare' except (except:) is virtually always a *bad* idea. It'll catch _all_ exceptions, including NameError, which could indicate a bug in your code. Catch only what you need to, only what you're expecting and can handle. Thanks, I really don't know the difference between positional and keyboard arguments so I think I must do some python reading. I'm not really a python programmer (I'm a C, assembly, Java and C# programmer). Anyway the code is now working. Thanks a lot to both of you. Regards. -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On Sat, 12 Oct 2013 05:43:22 -0600, Ian Kelly wrote: Easier said than done. The module is currently written in pure Python, and the comment Note: Please keep this module compatible to Python 1.5.2 would appear to rule out the use of ctypes to call the glibc function. Last I heard, there was a standing policy to avoid using ctypes from within the standard library. The stated rationale was that ctypes is unsafe (it allows pure Python code to crash the process) and site administrators should be able to remove the ctypes module without breaking any part of the standard library other than ctypes itself. There appear to be a few exceptions to this rule, i.e. a few standard library modules import ctypes. But they are all within try/except blocks (so they degrade gracefully if ctypes isn't present), and are limited to improving the handling of edge cases rather than being essential to providing documented functionality. -- https://mail.python.org/mailman/listinfo/python-list
Grant permission for your Python bug tracker account (taewong.seo).
(You're not subscribed!) You want to apply issue #19038. When you try to log in to Python bug tracker using your account (taewong.seo), a message says that “you don't have permission to login”. -- https://mail.python.org/mailman/listinfo/python-list
Re: What version of glibc is Python using?
On Sat, Oct 12, 2013 at 9:59 AM, Terry Reedy tjre...@udel.edu wrote: On 10/12/2013 7:43 AM, Ian Kelly wrote: On Sat, Oct 12, 2013 at 2:46 AM, Terry Reedy tjre...@udel.edu wrote: On 10/12/2013 3:53 AM, Christian Gollwitzer wrote: That function is really bogus. It states itself, that it has intimate knowledge of how different libc versions add symbols to the executable and thus is probably only useable for executables compiled using gcc which is just another way of saying it'll become outdated and broken soon. It's not even done by reading the symbol table, it opens the binary and matches a RE *shocked* I would have expected such hacks in a shell script. glibc has a function for this: gnu_get_libc_version () which should be used. Was this always presence and missed, or has it been added in say, the last 10 years? Reading the docs more closely, I think that the function is actually working as intended. It says that it determines the libc version against which the file executable (defaults to the Python interpreter) is linked -- or in other words, the minimum compatible libc version, NOT the libc version that is currently loaded. So I think that a patch to replace this with gnu_get_libc_version() should be rejected, since it would change the documented behavior of the function. It may be worth considering adding an additional function that matches the OP's expectations, but since it would just be a simple ctypes wrapper it is probably best done by the user. -- https://mail.python.org/mailman/listinfo/python-list
Re: web scraping
On Saturday, October 12, 2013 7:12:38 AM UTC-7, Ronald Routt wrote: I am new to programming and trying to figure out python. I am trying to learn which tools and tutorials I need to use along with some good beginner tutorials in scraping the the web. The end result I am trying to come up with is scraping auto dealership sites for the following: 1.Name of dealership 2. State where dealership is located 3. Name of Owner, President or General Manager 4. Email address of number 3 above 5. Phone number of dealership Note: Many times the Owner, President or General Manager and their email address is under a tab on the website such as Meet our team or Support. Sometimes this information is not available on the website. I sure would appreciate any help I can get to get me on the right track. From what I have read so far, believe I have to use urllib but know nothing about how to us it.. Thanks ronro...@gmail.com if you are really new to python I will suggest you go through the tutorial at www.learnpythonthehardway.org and when you are done search either google or youtube for how to use beautiful soup I believe you should be fine. -- https://mail.python.org/mailman/listinfo/python-list
Re: closure = decorator?
On Thursday, October 10, 2013 6:51:21 AM UTC-7, Tim wrote: I've read a couple of articles about this, but still not sure. When someone talks about a closure in another language (I'm learning Lua on the side), is that the same concept as a decorator in Python? It sure looks like it. thanks, --Tim In the proper lambda calculus, you don't have side effects. So Terry's balance example is helpful for Python, but perhaps it might be better think of it as a Pythonic extension to the lambda calculus closure. In other words, Python's closure handles cases that don't present themselves in the lambda calculus. When you are taught about closures in a purely formal setting the example will not include a side effect nor any need for a statement like nonlocal balance. The closed variable (here it is balance) simply remains part of the scope of the inner function and can referenced appropriately. This might distract the original questioner, I only mention that closure probably means different things to different people. -- https://mail.python.org/mailman/listinfo/python-list
Python was designed (was Re: Multi-threading in Python vs Java)
On Sat, Oct 12, 2013 at 7:10 AM, Peter Cacioppi peter.cacio...@gmail.com wrote: Along with batteries included and we're all adults, I think Python needs a pithy phrase summarizing how well thought out it is. That is to say, the major design decisions were all carefully considered, and as a result things that might appear to be problematic are actually not barriers in practice. My suggestion for this phrase is Guido was here. Designed. You simply can't get a good clean design if you just let it grow by itself, one feature at a time. You'll end up with something where you can do the same sort of thing in three different ways, and they all have slightly different names: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/#general (Note, I'm not here to say that PHP is awful and Python is awesome (they are, but I'm not here to say it). It's just that I can point to a blog post that shows what I'm saying.) Design is why, for instance, Python's builtin types all behave the same way with regard to in-place mutator methods: they don't return self. I personally happen to quite like the return self style, as it allows code like this: GTK2.MenuBar() -add(GTK2.MenuItem(_File)-set_submenu(GTK2.Menu() -add(menuitem(_New Tab,addtab)-add_accelerator(...)) -add(menuitem(Close tab,closetab)-add_accelerator(...)) ... etc ... )) -add(GTK2.MenuItem(_Options)-set_submenu(GTK2.Menu() -add(menuitem(_Font,fontdlg)) ... etc ... )) ... etc ... It's a single expression (this is from Pike, semantically similar to Python) that creates and sets up the whole menu bar. Most of Pike's object methods will return this (aka self) if it's believed to be of use. The Python equivalent, since the .add() method on GTK objects returns None, is a pile of code with temporary names. But that's a smallish point of utility against a large point of consistency; newbies can trust that a line like: lst = lst.sort() will trip them up immediately (since lst is now None), rather than surprise them later when they try to make a sorted copy of the list: sorted_lst = lst.sort() which, if list.sort returned self, would leave you with sorted_lst is lst, almost certainly not what the programmer intended. Oh, and the use of exceptions everywhere is a sign of design, too. Something went wrong that means you can't return a plausible value? Raise. json.loads({) ValueError: Expecting object: line 1 column 0 (char 0) pickle.loads(b\x80) EOFError Etcetera. PHP borrows from C in having piles and piles of was there an error functions; there's no consistency in naming, nor (in many cases) in the return values. Pike generally raises exceptions, but I/O failure usually results in a zero return and the file object's errno attribute set; but at least they're consistent error codes. This is design. Python has a king (Guido). It wasn't built by a committee. Maybe you won't like some aspect of Python's design, but it has one, it's not just sloppily slapped together. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On Sun, 13 Oct 2013 09:37:58 +1100, Chris Angelico wrote: This is design. Python has a king (Guido). It wasn't built by a committee. Maybe you won't like some aspect of Python's design, but it has one, it's not just sloppily slapped together. While I agree with your general thrust, I don't think it's quite so simple. Perl has a king, Larry Wall, but his design is more or less throw everything into the pot, it'll be fine and consequently Perl is, well, *weird*, with some pretty poor^W strange design decisions. - Subroutines don't have signatures, you have to parse arguments yourself by popping values off the magic variable @_ . - More special variables than you can shake a stick at: @_ $_ $a $b @ARGV $ ${^ENCODING} $. $| $= $$ $^O $^S @F and many, many more. - Context sensitivity: these two lines do very different things: $foo = @bar @foo = @bar and so do these two: my($foo) = `bar` my $foo = `bar` - Sigils. Sigils everywhere. - Separate namespaces for scalars, arrays, hashes, filehandles, and subroutines (did I miss anything?), co-existing in the same scope, all the better for writing code like this: $bar = foo($foo, $foo[1], $foo{1}) If you think that all three references to $foo refer to the same variable, you would be wrong. - Two scoping systems (dynamic and lexical) which don't cooperate. - Strangers to Perl might think that the way to create a local variable is to define it as local: local $foo; but you'd be wrong. local does something completely different. To create a local variable, use my $foo instead. More here: http://perl.plover.com/FAQs/Namespaces.html Likewise Rasmus Lerdorf, king of PHP (at least initially), but he had no idea what he was doing: I had no intention of writing a language. I didn't have a clue how to write a language. I didn't want to write a language, Lerdorf explained. I just wanted to solve a problem of churning out Web applications very, very fast. http://www.devshed.com/c/a/PHP/PHP-Creator-Didnt-Set-Out-to-Create-a-Language/ -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Python was designed (was Re: Multi-threading in Python vs Java)
On Sun, Oct 13, 2013 at 2:38 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 13 Oct 2013 09:37:58 +1100, Chris Angelico wrote: This is design. Python has a king (Guido). It wasn't built by a committee. Maybe you won't like some aspect of Python's design, but it has one, it's not just sloppily slapped together. While I agree with your general thrust, I don't think it's quite so simple. Perl has a king, Larry Wall, but his design is more or less throw everything into the pot, it'll be fine and consequently Perl is, well, *weird*, with some pretty poor^W strange design decisions. My apologies, I wasn't exactly clear. Having a king doesn't in any way guarantee a clean design... Likewise Rasmus Lerdorf, king of PHP (at least initially), but he had no idea what he was doing: I had no intention of writing a language. I didn't have a clue how to write a language. I didn't want to write a language, Lerdorf explained. I just wanted to solve a problem of churning out Web applications very, very fast. ... yeah, what he said; but having no king pretty much condemns a project to design-by-committee. Python has a king and a clear design. In any case, we're broadly in agreement here. It's design that makes Python good. That's why the PEP system and the interminable bike-shedding on python-dev is so important... and why, at the end of the day, the PEP's acceptance comes down to one person (Guido or a BDFL-Delegate). ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Inter-process locking
The lockfile solution seems to be working, thank you. On Fri, Oct 11, 2013 at 10:15 PM, Piet van Oostrum p...@vanoostrum.org wrote: Jason Friedman jsf80...@gmail.com writes: I have a 3rd-party process that runs for about a minute and supports only a single execution at a time. $ deploy If I want to launch a second process I have to wait until the first finishes. Having two users wanting to run at the same time might happen a few times a day. But, these users will not have the skills/patience to check whether someone else is currently running. I'd like my program to be able to detect that deploy is already running, tell the user, wait a minute, try again, repeat. I do not know whether anyone has had success with http://pythonhosted.org/lockfile/lockfile.html. It seems to work on Mac OS X. I supose I could use http://code.google.com/p/psutil/ to check for a process with a particular name. That will quite probably give you race conditions. File locking is generally the best solution for this kind of problems, unless you can make use of OS level semaphores. -- Piet van Oostrum p...@vanoostrum.org WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots
Charles-François Natali added the comment: Here is a more useful traceback: If the failures aren't linked to ENFILE, then you could use strace to find the process on which the test is doing a waitpid(), and then perform an strace and gdb on that process to see where it's stuck. And send it a fatal signal that will make faulthander dump the stack. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19227 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19202] Additions to function docs: reduce and itertools.
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19202] Additions to function docs: reduce and itertools.
Raymond Hettinger added the comment: Almost all of these make the docs worse and should not be applied. The purpose of the equivalent code is simply to make the documentation clearer, not to show all the ways it could have been done. I do think Georg's reduce() equivalent should be added because it is clearer than the current prose description. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19201] Add 'x' mode to lzma.open()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- components: +Library (Lib) title: Add 'x' mode to lzma.open - Add 'x' mode to lzma.open() ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19201 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19222] Add 'x' mode to gzip.open()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- components: +Library (Lib) stage: - patch review title: gzip and 'x' mode open - Add 'x' mode to gzip.open() versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19222 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19223] Add 'x' mode to bz2.open()
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- components: +Library (Lib) stage: - patch review title: bz2 and 'x' mode open - Add 'x' mode to bz2.open() versions: -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19223 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Antoine Pitrou added the comment: IMO this should be rejected. Failure to improve startup time + more complicated maintenance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19205] Don't import re and sysconfig in site.py
Antoine Pitrou added the comment: Christian, the test is failing on Snow Leopard: == FAIL: test_startup_imports (test.test_site.StartupImportTests) -- Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_site.py, line 435, in test_startup_imports self.assertFalse(modules.intersection(re_mods)) AssertionError: {'re', 'sre_compile', 'sre_constants', 'sre_parse', '_sre'} is not false http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/106/steps/test/logs/stdio -- assignee: - christian.heimes status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19205 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12853] global name 'r' is not defined in upload.py
Esa Peuha added the comment: so I don't know where the global name 'r' is not defined message came from. It came from Python 2.7. There are two separate bugs here, one in 3.x and the other in 2.7: the 3.x bug has to do with bytes/string separation, while the 2.7 bug is that result was changed to r in baf1a482b57d. -- nosy: +Esa.Peuha ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12853 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19205] Don't import re and sysconfig in site.py
Roundup Robot added the comment: New changeset a57dfbba91f9 by Christian Heimes in branch 'default': Issue #19205: add debugging output for failing test on Snow Leopard http://hg.python.org/cpython/rev/a57dfbba91f9 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19205 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12413] make faulthandler dump traceback of child processes
Changes by Richard Oudkerk shibt...@gmail.com: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12413 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19227] test_multiprocessing_xxx hangs under Gentoo buildbots
Richard Oudkerk added the comment: I'm already confused by the fact that the test is named test_multiprocessing_spawn and the error is coming from a module named popen_fork...) popen_spawn_posix.Popen is a subclass of popen_fork.Popen. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19227 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Christian Heimes added the comment: Here is a simpler patch that directly uses the grammar definition to create a list of keywords. It completely removes the necessity of a script. -- components: +Extension Modules stage: - patch review Added file: http://bugs.python.org/file32058/keyword_grammar.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Antoine Pitrou added the comment: -1 again. We shouldn't gratuitously convert Python code to C code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Georg Brandl added the comment: Well, combined with the fact that it gets rid of a manual regeneration step (that is easy to forget, since adding a keyword is not done very often) I think it's a net gain. The same could be done with the token module BTW. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Antoine Pitrou added the comment: Well, combined with the fact that it gets rid of a manual regeneration step (that is easy to forget, since adding a keyword is not done very often) I think it's a net gain. If it needs to be automated it can be added to the Makefile... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13203] Doc: say id() is only useful for existing objects
Georg Brandl added the comment: Suggestion attached. -- keywords: +patch Added file: http://bugs.python.org/file32059/id_unique.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13203 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19231] ctype cant's use printf
New submission from FreedomKnight: the code is simple, so i paste all of mycode #!/usr/bin/env python3 from ctypes import * cdll.LoadLibrary(libc.so.6) libc = CDLL(libc.so.6) libc.printf(hello\n) result: h expect result: hello plateform: fedora 19 x64 python3 (3.3.2) -- components: ctypes messages: 199552 nosy: FreedomKnight priority: normal severity: normal status: open title: ctype cant's use printf type: crash versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
New submission from Stefan Krah: As discussed on python-dev, importing _decimal at the bottom of decimal.py is about 9x slower than importing _decimal directly. -- assignee: skrah components: Extension Modules messages: 199553 nosy: skrah priority: normal severity: normal stage: needs patch status: open title: Speed up _decimal import type: performance versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19231] ctype cant's use printf
Georg Brandl added the comment: In Python 3, hello\n is a Unicode string. printf() expects a byte string, so you should use bhello\n (or s.encode() for string object named s). -- nosy: +georg.brandl resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19231 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
STINNER Victor added the comment: I proposed something similar for issue #19229. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
STINNER Victor added the comment: If it needs to be automated it can be added to the Makefile... I tested keyword_grammar.patch on a fresh Python source code (make distclean; ./configure --with-pydebug; make): I can compile Python. I don't understand what should be automated? This patch doesn't need to build a dependency. keyword_grammar.patch needs probably something for Visual Studio (PC/config.c and PCbuild/pythoncore.vcxproj?). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13203] Doc: say id() is only useful for existing objects
Ezio Melotti added the comment: LGTM + created and deleted during execution of the ``id()`` If you want to be more accurate you could say before and after instead of during. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13203 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Eric V. Smith added the comment: Remember that one reason for importing the C version at the bottom of the python version is so that alternate implementations (PyPy, IronPython, Jython) could provide partial versions of the C (or equivalent) versions. By importing after the Python version, the alternate implementation could continue to use parts of the Python code. I think the impact on alternate implementations needs to be considered before we start rearchitecting these imports. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Changes by Stefan Krah stefan-use...@bytereef.org: -- keywords: +patch Added file: http://bugs.python.org/file32060/issue19232.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18754] Run Python child processes in isolated mode in the test suite?
Roundup Robot added the comment: New changeset 72b2e7b74307 by Victor Stinner in branch 'default': Close #18754: Run Python child processes in isolated more in the test suite. http://hg.python.org/cpython/rev/72b2e7b74307 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18754 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18758] Fix internal references in the documentation
Serhiy Storchaka added the comment: Here is a patch to Sphinx which helped me to search dead internal references. Not all references were fixed by proposed patches. -- Added file: http://bugs.python.org/file32061/sphinx_warn_refs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18758 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19233] test_io.test_interrupted_write_retry_text() hangs on Solaris 10 and FreeBSD 7.2
New submission from STINNER Victor: http://buildbot.python.org/all/builders/x86%20FreeBSD%207.2%203.x/builds/4531/steps/test/logs/stdio [136/380] test_io Timeout (1:00:00)! Thread 0x28401040: File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_io.py, line 3215 in check_interrupted_write_retry File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/test_io.py, line 3237 in test_interrupted_write_retry_text File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/case.py, line 571 in run File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/case.py, line 610 in __call__ File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 117 in run File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 117 in run File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 117 in run File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/suite.py, line 79 in __call__ File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/unittest/runner.py, line 168 in run File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support/__init__.py, line 1661 in _run_suite File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/support/__init__.py, line 1695 in run_unittest File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/regrtest.py, line 1275 in lambda File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/regrtest.py, line 1276 in runtest_inner File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/regrtest.py, line 965 in runtest File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/regrtest.py, line 761 in main File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/regrtest.py, line 1560 in main_in_temp_cwd File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/test/__main__.py, line 3 in module File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/runpy.py, line 73 in _run_code File /usr/home/db3l/buildarea/3.x.bolen-freebsd7/build/Lib/runpy.py, line 160 in _run_module_as_main and http://buildbot.python.org/all/builders/SPARC%20Solaris%2010%20%28cc%2C%2064b%29%20%5BSB%5D%203.x/builds/980/steps/test/logs/stdio [324/377/2] test_io Timeout (1:00:00)! Thread 0x0001: File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/test_io.py, line 3215 in check_interrupted_write_retry File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/test_io.py, line 3237 in test_interrupted_write_retry_text File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/case.py, line 496 in run File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/case.py, line 535 in __call__ File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 105 in run File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 67 in __call__ File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 105 in run File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 67 in __call__ File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 105 in run File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/suite.py, line 67 in __call__ File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/unittest/runner.py, line 168 in run File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/support/__init__.py, line 1624 in _run_suite File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/support/__init__.py, line 1658 in run_unittest File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/regrtest.py, line 1304 in lambda File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/regrtest.py, line 1305 in runtest_inner File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/regrtest.py, line 998 in runtest File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/regrtest.py, line 796 in main File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/regrtest.py, line 1590 in main_in_temp_cwd File /home/cpython/buildslave/cc-64/3.x.snakebite-sol10-sparc-cc-64/build/Lib/test/__main__.py, line 3 in module File
[issue19131] Broken support of compressed AIFC files
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19131 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Stefan Krah added the comment: Right, let's start collecting objections. :) Mark, Raymond: Would you support the change (__name__ hack and all)? Maciej: Is this approach a problem for PyPy? -- nosy: +fijall, mark.dickinson, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19205] Don't import re and sysconfig in site.py
STINNER Victor added the comment: New changeset a57dfbba91f9 by Christian Heimes in branch 'default': Issue #19205: add debugging output for failing test on Snow Leopard http://hg.python.org/cpython/rev/a57dfbba91f9 So the import re comes from _osx_support, _osx_support is imported by sysconfig. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19205 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Changes by Stefan Krah stefan-use...@bytereef.org: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
STINNER Victor added the comment: If the Python implementation is renamed to _pydecimal, I don't expect it to be used in CPython. I never used _pyio in a real application, only for some tests to debug. I don't think that we need the __name__ = 'decimal' hack. If you really want to keep it, please add at least a comment explaining it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19205] Don't import re and sysconfig in site.py
Roundup Robot added the comment: New changeset 9f6ef09f6492 by Christian Heimes in branch 'default': Issue #19205: _osx_support uses the re module all over the place. Omit the test for nw. http://hg.python.org/cpython/rev/9f6ef09f6492 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19205 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19229] operator.py: move the Python implementation in the else block of try/except ImportError
Stefan Krah added the comment: Using the microbenchmark I get (standard version): ./python -m timeit import sys; modname='operator' __import__(modname); del sys.modules[modname] 1000 loops, best of 3: 460 usec per loop Victor's version: ./python -m timeit import sys; modname='operator' __import__(modname); del sys.modules[modname] 1000 loops, best of 3: 355 usec per loop Importing _operator directly: ./python -m timeit import sys; modname='_operator' __import__(modname); del sys.modules[modname] 1 loops, best of 3: 35.7 usec per loop Extrapolating from what I did with decimal, I guess a _pyoperator version could get down to something like 70 usec. -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19229 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Stefan Krah added the comment: I guess if some of the pickling stuff get's rewritten, we can drop __name__. The other thing is that traditionally the types were decimal.Decimal etc., so I'm not sure if it is good idea to have _decimal.Decimal and _pydecimal.Decimal. Of course adding __module__ everywhere is another option. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18804] pythorun.c: is_valid_fd() should not duplicate the file descriptor
STINNER Victor added the comment: Did you encounter this in real life? Well, my initial concern was that dup() creates an inheritable file descriptor. It is unlikely that fork() occurs while is_valid_fd() is called, because is_valid_fd() is only called early during Python initialization. Replacing dup() with _Py_dup() would be overkill: _Py_dup() releases the GIL and raises an exception, which is not needed here. I'm closing the issue. I will reopen it if I find a simple solution to this non-issue :-) -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18804 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18509] CJK decoders should return MBERR_EXCEPTION on PyUnicodeWriter error
STINNER Victor added the comment: This is a regression of Python 3.4, so it would be nice to fix it before the Python 3.4 final. -- nosy: +larry priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18509 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
STINNER Victor added the comment: The other thing is that traditionally the types were decimal.Decimal etc., so I'm not sure if it is good idea to have _decimal.Decimal and _pydecimal.Decimal. Why not renaming the _decimal module to decimal? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Stefan Krah added the comment: _decimal already lies about its name (for pickling). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19221] Upgrade to Unicode 6.3.0
Roundup Robot added the comment: New changeset cc1e2f9a569a by Ezio Melotti in branch 'default': #19221: update whatsnew entry about UCD version. http://hg.python.org/cpython/rev/cc1e2f9a569a -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19221 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12187] subprocess.wait() with a timeout uses polling on POSIX
STINNER Victor added the comment: On BSDs and OS X, you can use kqueue with EVFILT_PROC+NOTE_EXIT to do exactly that. No polling required. Unfortunately there's no Linux equivalent. http://stackoverflow.com/questions/1157700/how-to-wait-for-exit-of-non-children-processes/7477317#7477317 An example: http://doc.geoffgarside.co.uk/kqueue/proc.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12187] subprocess.wait() with a timeout uses polling on POSIX
STINNER Victor added the comment: On Linux, it possible to watch processes using a netlink socket: http://www.outflux.net/blog/archives/2010/07/01/reporting-all-execs/ Example: http://users.suse.com/~krahmer/exec-notify.c Python binding (written in Cython) for proc connector: http://debathena.mit.edu/trac/browser/trunk/debathena/debathena/metrics/debathena/metrics/connector.pyx There is just a minor limitation: you must be root (CAP_NET_ADMIN) to use this interface... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9548] locale can be imported at startup but relies on too many library modules
Brett Cannon added the comment: Just a quick favour to ask people: please post benchmark numbers of startup_nosite and normal_startup with your patches, otherwise we are taking stabs in the dark that the code complexity being suggested is worth it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19131] Broken support of compressed AIFC files
Roundup Robot added the comment: New changeset 567241d794bd by Serhiy Storchaka in branch '2.7': Issue #19131: The aifc module now correctly reads and writes sampwidth of http://hg.python.org/cpython/rev/567241d794bd New changeset 863a92cc9e03 by Serhiy Storchaka in branch '3.3': Issue #19131: The aifc module now correctly reads and writes sampwidth of http://hg.python.org/cpython/rev/863a92cc9e03 New changeset cff4dd674efe by Serhiy Storchaka in branch 'default': Issue #19131: The aifc module now correctly reads and writes sampwidth of http://hg.python.org/cpython/rev/cff4dd674efe -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19131 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19230] Reimplement the keyword module in C
Brett Cannon added the comment: Is there any change in any benchmark? -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19230 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19232] Speed up _decimal import
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19232 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12187] subprocess.wait() with a timeout uses polling on POSIX
Charles-François Natali added the comment: Honestly, I think the extra complexity and non-portability isn't worth it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19108] Benchmark runner tries to execute external Python command and fails on error reporting
Stefan Behnel added the comment: Here's a patch that replaces the current simplistic Python executable command config with a dedicated PythonRuntime config class. That makes it easy to properly pass around the program specific configuration. Part of that is the Python executable path, the Python version, the specific command line arguments and the relative benchmark library path. The patch also adds a --pyversions command line option to avoid calling the executable for figuring out the Python versions, as discussed. -- keywords: +patch Added file: http://bugs.python.org/file32062/add_pyversions_option_and_refactor_runtime_config.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19108 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19233] test_io.test_interrupted_write_retry_text() hangs on Solaris 10 and FreeBSD 7.2
Charles-François Natali added the comment: I think the problem is that those buildbots are really slow (just look at the second buildbot's backlog), and the signal is delivered before the large buffer is allocated, hence the write() syscall doesn't fail with EINTR. -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19233 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9548] locale can be imported at startup but relies on too many library modules
Antoine Pitrou added the comment: Here normal_startup and startup_nosite wouldn't show a difference (under Linux anyway) because the locale module is only imported for non-interactive streams, AFAICT. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9548 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12187] subprocess.wait() with a timeout uses polling on POSIX
Antoine Pitrou added the comment: Honestly, I think the extra complexity and non-portability isn't worth it. That's what I think too. If we want to avoid polling, there's another approach: - fork() a first time - fork() in the first child - exec() in the second child - in the first child, call waitpid() and then write() the return code to a fd - in the parent, wait on the fd using select() or poll() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12187 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8090] PEP 4 should say something about the standard library
Roundup Robot added the comment: New changeset f7e3f6a53823 by Georg Brandl in branch 'default': PEP 4: convert to reST, update SourceForge - bugs.python.org, update DeprecationWarning policy http://hg.python.org/peps/rev/f7e3f6a53823 -- nosy: +python-dev resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8090 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13203] Doc: say id() is only useful for existing objects
Roundup Robot added the comment: New changeset 8525cc1f342f by Georg Brandl in branch '2.7': Closes #13203: add a FAQ section about seemingly duplicate id()s. http://hg.python.org/cpython/rev/8525cc1f342f -- nosy: +python-dev resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13203 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13203] Doc: say id() is only useful for existing objects
Roundup Robot added the comment: New changeset 0d5de993db66 by Georg Brandl in branch '3.3': Closes #13203: add a FAQ section about seemingly duplicate id()s. http://hg.python.org/cpython/rev/0d5de993db66 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13203 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19179] doc bug: confusing table of values
Roundup Robot added the comment: New changeset 9aae58596349 by Georg Brandl in branch '2.7': Closes #19179: make table of XML vulnerabilities clearer by using everyday booleans and explaining the table beforehand. http://hg.python.org/cpython/rev/9aae58596349 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19179 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18758] Fix internal references in the documentation
Georg Brandl added the comment: The -n (nitpicky) option to Sphinx should also report missing references. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18758 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19179] doc bug: confusing table of values
Roundup Robot added the comment: New changeset 6b0ca3963ff1 by Georg Brandl in branch '3.3': Closes #19179: make table of XML vulnerabilities clearer by using everyday booleans and explaining the table beforehand. http://hg.python.org/cpython/rev/6b0ca3963ff1 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19179 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19202] Additions to function docs: reduce and itertools.
Georg Brandl added the comment: What do you think of the two references added to the itertools docs? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com