pyCologne Python User Group Cologne - Meeting, June 13, 6.30pm
We will meet Wednesday, July, 13th starting about 6.30 pm - 6.45 pm at Room 0.14, Benutzerrechenzentrum (RRZK-B) University of Cologne, Berrenrather Str. 136, 50937 Köln, Germany On this month's agenda: - EuroPython review (Reimar Bauer, ...) - pylint and Django apps (!django-lint) (Andi Albrecht) Any presentations, news, book presentations etc. are welcome on each of our meetings! At about 8.30 pm we will as usual enjoy the rest of the evening in a nearby restaurant. Further information including directions how to get to the location can be found at: http://www.pycologne.de (Sorry, the web-links are in German only.) Regards, Andi -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Seeking Feedback on Python Vulnerabilities Document
All: I have recently completed a draft of Python. Vulnerability descriptions for the language for eventual submission to the International Organization for Standardization (ISO) Information and Communication Technologies (ICT) committee. This document enumerates the standard ways in which programming languages are exposed to vulnerabilities, how Python is exposed to each, and how to avoid each vulnerability. I am seeking: .Advice as to the comprehensiveness and completeness of the vulnerabilities and remedies; .Comments about the code examples and explanations; .Additional vulnerabilities; .Suggestions for improving the readability of the document; and .Any general suggestions including typos etc. If you are interested please send me a short email with point of contact information and your background/interest in the Python language. Regards, Kevin Coyne kevinjco...@hotmail.com -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
ANN: PyIE - Python Inference Enginefd (0(
O Qui3(8 573 _Dustin Higgins -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Trying to chain processes together on a pipeline
I'm working on an audio/video converter script (moving from bash to Python for some extra functionality), and part of it is chaining the audio decoder (FFmpeg) either into SoX to change the volume and then to the Nero AAC encoder or directly into the Nero encoder. This is the chunk of code from my working bash script to give an idea of what I'm trying to accomplish (it's indented because it's nested inside a while loop and an if statement): if [ $process_audio = true ] then if [ $vol == 1.0 ] then ffmpeg -i ${ifile_a} -f wav - 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a else # the pipeline-as-file option of sox fails on Windows 7, so I use the safe method since there's only one pipeline going into sox ffmpeg -i ${ifile_a} -f sox - 2$nul | sox -t sox - -t wav - vol $vol 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a fi else echo Audio skipped. fi This is pretty easy and straightforward in bash, but not so in Python. This is what I have in Python (queue[position] points to an object I create earlier that holds a bunch of info on what needs to be encoded - input and output file names, command line options for the various encoders used, and so forth), but clearly it has some problems: try: ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': It\'s not a valid Win32 application.') break if queue[position].vol != 1: try: sox_proc = subprocess.Popen(queue[position].sox_cmd, stdin=ffmpeg_proc.stdout, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break wav_pipe = sox_proc.stdout else: wav_pipe = ffmpeg_proc.stdout try: nero_aac_proc = subprocess.Popen(queue[position].nero_aac_cmd, stdin=wav_pipe) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break ffmpeg_proc.wait() if queue[position].vol != 1: sox_proc.wait() nero_aac_proc.wait() break Note: those break statements are there to break out of the while loop this is in. Firstly, that first assignment to ffmpeg_proc raises an exception: Traceback (most recent call last): File C:\Users\Bahamut\workspace\Disillusion\disillusion.py, line 288, in module ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) File C:\Python32\lib\subprocess.py, line 700, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File C:\Python32\lib\subprocess.py, line 861, in _get_handles errwrite = msvcrt.get_osfhandle(stderr.fileno()) AttributeError: 'str' object has no attribute 'fileno' I'm not really sure what it's complaining about since the exception propagates from the msvcrt module through the subprocess module into my program. I'm thinking it has to do my stderr assignment, but if that's not right, I don't know what is. Secondly, there are no Popen.stdout.close() calls because I'm not sure where to put them. Thirdly, I have nearly identical except WindowsError: blocks repeated - I'm sure I can avoid this with decorators as suggested in a recent thread, but I haven't learned decorators yet. This code isn't very
How to read barcoded value from PDF
Hi, I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader' To read the PDF file, but how can I read the barcode form the existing PDF. Any solution? In Reportlab I can do the following code to generate barcode and to get the value of that barcode barcode=code39.Extended39(123456789,barWidth=0.2*mm,barHeight=8*mm) bc = Paragraph(Barcode value: %s % barcode.value, STYLES['Normal']) document.append(bc) But how can I achieve this from the existing PDF document?? -- http://mail.python.org/mailman/listinfo/python-list
How to read barcoded value from PDF
Hi, I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader' To read the PDF file, but how can I read the barcode form the existing PDF. Any solution? In Reportlab I can do the following code to generate barcode and to get the value of that barcode barcode=code39.Extended39(123456789,barWidth=0.2*mm,barHeight=8*mm) bc = Paragraph(Barcode value: %s % barcode.value, STYLES['Normal']) document.append(bc) But how can I achieve this from the existing PDF document?? -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to chain processes together on a pipeline
Andrew Berg wrote: I'm working on an audio/video converter script (moving from bash to Python for some extra functionality), and part of it is chaining the audio decoder (FFmpeg) either into SoX to change the volume and then to the Nero AAC encoder or directly into the Nero encoder. This is the chunk of code from my working bash script to give an idea of what I'm trying to accomplish (it's indented because it's nested inside a while loop and an if statement): if [ $process_audio = true ] then if [ $vol == 1.0 ] then ffmpeg -i ${ifile_a} -f wav - 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a else # the pipeline-as-file option of sox fails on Windows 7, so I use the safe method since there's only one pipeline going into sox ffmpeg -i ${ifile_a} -f sox - 2$nul | sox -t sox - -t wav - vol $vol 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a fi else echo Audio skipped. fi This is pretty easy and straightforward in bash, but not so in Python. This is what I have in Python (queue[position] points to an object I create earlier that holds a bunch of info on what needs to be encoded - input and output file names, command line options for the various encoders used, and so forth), but clearly it has some problems: try: ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': It\'s not a valid Win32 application.') break if queue[position].vol != 1: try: sox_proc = subprocess.Popen(queue[position].sox_cmd, stdin=ffmpeg_proc.stdout, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break wav_pipe = sox_proc.stdout else: wav_pipe = ffmpeg_proc.stdout try: nero_aac_proc = subprocess.Popen(queue[position].nero_aac_cmd, stdin=wav_pipe) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break ffmpeg_proc.wait() if queue[position].vol != 1: sox_proc.wait() nero_aac_proc.wait() break Note: those break statements are there to break out of the while loop this is in. Firstly, that first assignment to ffmpeg_proc raises an exception: Traceback (most recent call last): File C:\Users\Bahamut\workspace\Disillusion\disillusion.py, line 288, in module ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) File C:\Python32\lib\subprocess.py, line 700, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File C:\Python32\lib\subprocess.py, line 861, in _get_handles errwrite = msvcrt.get_osfhandle(stderr.fileno()) AttributeError: 'str' object has no attribute 'fileno' I'm not really sure what it's complaining about since the exception propagates from the msvcrt module through the subprocess module into my program. I'm thinking it has to do my stderr assignment, but if that's not right, I don't know what is. os.devnull is a string, but you need a writable file: subprocess.call([ls], stdout=os.devnull) Traceback (most recent call last): File stdin, line 1, in module File /usr/lib/python2.6/subprocess.py, line 470, in call return Popen(*popenargs,
Re: Trying to chain processes together on a pipeline
On 2011.06.28 01:32 AM, Peter Otten wrote: subprocess.call([ls], stdout=open(os.devnull, w)) 0 D'oh! Not sure why I was thinking os.devnull was a file object. :-[ Start with factoring out common code into a good old function. For some reason I was thinking I would have problems doing that, but looking at it again, I could probably refactor that into a really nice function that logs at least all the common Windows error codes that may arise. Thanks for pointing those out. -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to chain processes together on a pipeline
On Mon, Jun 27, 2011 at 11:47 PM, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.06.28 01:32 AM, Peter Otten wrote: subprocess.call([ls], stdout=open(os.devnull, w)) 0 D'oh! Not sure why I was thinking os.devnull was a file object. :-[ On the bright side, I think in part due to this /exact/ misunderstanding, in bleeding-edge Python v3.3 you can now write: subprocess.call([ls], stdout=subprocess.DEVNULL) http://docs.python.org/dev/library/subprocess.html#subprocess.DEVNULL Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to chain processes together on a pipeline
Am 28.06.2011 07:57 schrieb Andrew Berg: I'm working on an audio/video converter script (moving from bash to Python for some extra functionality), and part of it is chaining the audio decoder (FFmpeg) either into SoX to change the volume and then to the Nero AAC encoder or directly into the Nero encoder. This is the chunk of code from my working bash script to give an idea of what I'm trying to accomplish (it's indented because it's nested inside a while loop and an if statement): if [ $process_audio = true ] then if [ $vol == 1.0 ] then ffmpeg -i ${ifile_a} -f wav - 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a else # the pipeline-as-file option of sox fails on Windows 7, so I use the safe method since there's only one pipeline going into sox ffmpeg -i ${ifile_a} -f sox - 2$nul | sox -t sox - -t wav - vol $vol 2$nul | neroaacenc -ignorelength -q 0.4 -if - -of ${prefix}${zero}${ep}.m4a fi else echo Audio skipped. fi This is pretty easy and straightforward in bash, but not so in Python. This is what I have in Python (queue[position] points to an object I create earlier that holds a bunch of info on what needs to be encoded - input and output file names, command line options for the various encoders used, and so forth), but clearly it has some problems: try: ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].ffmpeg_exe + ': It\'s not a valid Win32 application.') break if queue[position].vol != 1: try: sox_proc = subprocess.Popen(queue[position].sox_cmd, stdin=ffmpeg_proc.stdout, stdout=subprocess.PIPE, stderr=os.devnull) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break wav_pipe = sox_proc.stdout else: wav_pipe = ffmpeg_proc.stdout try: nero_aac_proc = subprocess.Popen(queue[position].nero_aac_cmd, stdin=wav_pipe) except WindowsError: error_info = str(sys.exc_info()[1]) last_win_error_num = find_win_error_no(error_msg=error_info) if last_win_error_num == '2': # Error 2 = 'The system cannot find the file specified' logger.critical('Could not execute ' + queue[position].sox_exe + ': File not found.') elif last_win_error_num == '193': # Error 193 = '%1 is not a valid Win32 application' logger.critical('Could not execute ' + queue[position].sox_exe + ': It\'s not a valid Win32 application.') break ffmpeg_proc.wait() if queue[position].vol != 1: sox_proc.wait() nero_aac_proc.wait() break Note: those break statements are there to break out of the while loop this is in. Firstly, that first assignment to ffmpeg_proc raises an exception: Traceback (most recent call last): File C:\Users\Bahamut\workspace\Disillusion\disillusion.py, line 288, inmodule ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd, stdout=subprocess.PIPE, stderr=os.devnull) File C:\Python32\lib\subprocess.py, line 700, in __init__ errread, errwrite) = self._get_handles(stdin, stdout, stderr) File C:\Python32\lib\subprocess.py, line 861, in _get_handles errwrite = msvcrt.get_osfhandle(stderr.fileno()) AttributeError: 'str' object has no attribute 'fileno' I'm not really sure what it's complaining about since the exception propagates from the msvcrt module through the subprocess module into my program. I'm thinking it has to do my stderr assignment, but if that's not right, I don't know what is. Secondly, there are no Popen.stdout.close() calls because I'm not sure where to put them. Thirdly, I have nearly identical except WindowsError: blocks repeated - I'm sure I can avoid this with decorators as suggested in a recent thread, but I haven't learned decorators
Re: Mac OS X 10.6.6 and MacPyhton 2.6 idle doesn't work
This is the result of the test you suggested to me. What do you think? Last login: Mon Jun 27 19:35:21 on ttys000 host220-186-dynamic:~ luca$ cd /Library/Frameworks/Python.framework/ Versions/2.6 host220-186-dynamic:2.6 luca$ cd ./lib/python2.6/lib-dynload/ host220-186-dynamic:lib-dynload luca$ otool -L _tkinter.so _tkinter.so (architecture ppc): /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.1) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.1) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 47.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) _tkinter.so (architecture i386): /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.1) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.1) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) host220-186-dynamic:lib-dynload luca$ ls -l /Library/Frameworks/ Tcl.framework/Versions/ total 8 drwxr-xr-x 8 root admin 272 23 Giu 15:57 8.5 lrwxr-xr-x 1 root admin3 23 Giu 15:57 Current - 8.5 host220-186-dynamic:lib-dynload luca$ ls -l /Library/Frameworks/ Tk.framework/Versions/ total 8 drwxr-xr-x 8 root admin 272 23 Giu 15:57 8.5 lrwxr-xr-x 1 503 wheel3 23 Giu 15:57 Current - 8.5 host220-186-dynamic:lib-dynload luca$ ls -l /System/Library/Frameworks/ Tk.framework/Versions/ total 8 drwxr-xr-x 10 root wheel 340 23 Giu 21:53 8.4 drwxr-xr-x 10 root wheel 340 23 Giu 21:53 8.5 lrwxr-xr-x 1 root wheel3 12 Ott 2010 Current - 8.5 host220-186-dynamic:lib-dynload luca$ ls -l /System/Library/Frameworks/ Tcl.framework/Versions/ total 8 drwxr-xr-x 11 root wheel 374 23 Giu 21:53 8.4 drwxr-xr-x 11 root wheel 374 23 Giu 21:53 8.5 lrwxr-xr-x 1 root wheel3 12 Ott 2010 Current - 8.5 host220-186-dynamic:lib-dynload luca$ sudo /usr/local/bin/idle2.6 Password: Traceback (most recent call last): File /usr/local/bin/idle2.6, line 5, in module main() File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/idlelib/PyShell.py, line 1382, in main root = Tk(className=Idle) File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/lib-tk/Tkinter.py, line 1645, in __init__ self._loadtk() File /Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/lib-tk/Tkinter.py, line 1659, in _loadtk % (_tkinter.TK_VERSION, tk_version) RuntimeError: tk.h version (8.4) doesn't match libtk.a version (8.5) -- http://mail.python.org/mailman/listinfo/python-list
Re: Trying to chain processes together on a pipeline
On 2011.06.28 02:44 AM, Thomas Rachel wrote: The way you work with the exception is not the very best - instead of parsing the stringified exception, you better would trigger on exc.winerror (it is an integer with the error number). Or, even better, just pas the error information contained in the exception: def handle_winerr(exc): logger.critical('Could not execute %s: %s' % (queue[position].sox_exe, exc.strerror)) I didn't see winerror and strerror in the docs before, but another look and they are indeed documented. I brought up Windows error codes before, and I'm surprised no one pointed this out. Thanks for that. -- http://mail.python.org/mailman/listinfo/python-list
Re: module problem on windows 64bit
Am 27.06.2011 22:03, schrieb Peter Irbizon: well, my program exe generated from py2exe. I am running Python 2.7 on my win xp 32bit box then I compile my application with py2exe. After that I can use it on other computers (on 32bit everything works perfect) but on 64 bit windows I am getting this error. :( kinterbasdb's extension module _kinterbasdb.pyd depends on the shared library fbclient.dll. The Firebird client library is of the Firebird SQL server. As I already explained you have to install the 32bit (!) version of Firebird and enable the copy client dll to system32 option during the installation. -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
On Tue, 28 Jun 2011 01:16 pm Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Zero sig figure: 0 Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) Two. I was actually being slightly silly about zero fig figures. Although, I suppose, if you genuinely had zero significant figures, you couldn't tell what the number was at all, so you'd need to use a NaN :) -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Mac OS X 10.6.6 and MacPyhton 2.6 idle doesn't work
In article 7e5a3cc6-93d0-4750-93cd-fe721960d...@u26g2000vby.googlegroups.com, mando mandol...@gmail.com wrote: This is the result of the test you suggested to me. What do you think? Last login: Mon Jun 27 19:35:21 on ttys000 host220-186-dynamic:~ luca$ cd /Library/Frameworks/Python.framework/ Versions/2.6 host220-186-dynamic:2.6 luca$ cd ./lib/python2.6/lib-dynload/ host220-186-dynamic:lib-dynload luca$ otool -L _tkinter.so _tkinter.so (architecture ppc): /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.1) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.1) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 47.1.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) _tkinter.so (architecture i386): /Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.1) /Library/Frameworks/Tk.framework/Versions/8.5/Tk (compatibility version 8.5.0, current version 8.5.1) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9) I'm not sure where you got that version of Python from but the output from otool is definitely not that of a _tkinter.so from the standard python.org 2.6.6 installer and it explains the results you are seeing. If you want to stick with the python.org Python 2.6, I suggest you download the latest installer from here: http://python.org/download/releases/2.6.6/ and re-install. Good luck. -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list
Re: How to read barcoded value from PDF
On 28/06/2011 06:59, Asif Jamadar wrote: Hi, ... In Reportlab I can do the following code to generate barcode and to get the value of that barcode barcode=code39.Extended39(123456789,barWidth=0.2*mm,barHeight=8*mm) bc = Paragraph(Barcode value: %s % barcode.value, STYLES['Normal']) document.append(bc) But how can I achieve this from the existing PDF document?? . you might consider asking on the reportlab list as there is considerable experience there about pdf in general. It's unlikely that you will be able to easily discern which string/text in the pdf corresponds to the barcode values that you are interested in. PDF does allow things called annotations which reportlab can generate. Alternatively you can generate an invisible string which may make more sense than the simple barcode value. So when you draw the barcode you also need to add the magic string using some prefix/postfix that allows easy extraction with pypdf or similar eg ===radamajfisa===123456789===radamajfisa===. Your text extractor should be able to find this without too much trouble. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
Erik Max Francis wrote: Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) Yes. They're order of magnitude estimates. 1 x 10^6 has one significant figure. 10^6 has zero. By convention, nobody ever talks about 1 x 9.97^6 . Mel. -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
On Tue, Jun 28, 2011 at 9:47 PM, Mel mwil...@the-wire.com wrote: By convention, nobody ever talks about 1 x 9.97^6 . Unless you're a British politician of indeterminate party allegiance famous line, quoted as #6 in here: http://www.telegraph.co.uk/culture/tvandradio/7309332/The-ten-funniest-ever-Yes-Minister-moments.html But, that would presumably have three sig figs. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: module problem on windows 64bit
kinterbasdb's extension module _kinterbasdb.pyd depends on the shared library fbclient.dll. The Firebird client library is of the Firebird SQL server. As I already explained you have to install the 32bit (!) version of Firebird and enable the copy client dll to system32 option during the installation. yes, that's right. but I am using embedable version of fbclient.dll so I don't need to install Firebird Sql Server package. all dlls are in my program folder even so it does not work. -- http://mail.python.org/mailman/listinfo/python-list
Re: module problem on windows 64bit
Am 28.06.2011 14:59, schrieb Peter Irbizon: yes, that's right. but I am using embedable version of fbclient.dll so I don't need to install Firebird Sql Server package. all dlls are in my program folder even so it does not work. fbclient.dll may depend on more DLLs. Dependency walker is a great tool to detect and resolve missing dependencies on Windows. Christian -- http://mail.python.org/mailman/listinfo/python-list
Re: Mac OS X 10.6.6 and MacPyhton 2.6 idle doesn't work
Why my post aren't here? -- http://mail.python.org/mailman/listinfo/python-list
Re: PyPad 2.7.1 Update 4 (Python on iPad and iPhone)
On Jun 23, 2:07 pm, Jon Dowdall jon.dowdall+newsgr...@gmail.com wrote: Hi All, I'm pleased to announce that PyPad (Python environment for iOS) 2.7.1 Update 4 is now available in the iTunes App Store. New in this version is the ability to create custom modules. Modules can be independent or can include other user modules to build larger frame works. Plans for future versions include: Improved cursor handling in interactive mode. Access to the interactive command history. Modules to access iOS specific functionality. Additional documentation. Syntax highlighting. Improved script debugging support. Regards, Jon Hi Jon, I would be interested in having a play with this. How is it restricted when running in the iPad? thanks, Matt. -- http://mail.python.org/mailman/listinfo/python-list
Suppressing newline writing to file after variable
Hi all, newbie question here. I'm using python 2.7. I've built my first program to pull some info off the web, process it, and build dialpeers for a cisco router. I have 2 problems - the first is the formatting of printing the gathered information to a file. It seems to be inserting a new line after the variable is written. I've searched the web, but unsure of which method could fix this issue. Here is my code snippet: count=0 o = open('dialpeers.txt', 'w') for line in open('final.txt', 'r'): figureDpn = count + 1000 dpn = str(figureDpn) label = dial-peer voice + dpn o.write(label) o.write('\n') destpatt = destination-pattern + line + o.write(destpatt) o.write('\n') o.write(description *** local outbound dialpeer ***) o.write('\n') port = port + p o.write(port) o.write('\n') o.write('\n') count = count + 1 Output: dial-peer voice 1000 destination-pattern 252200 description *** local outbound dialpeer *** port 0/1 Desired Output: dial-peer voice 1000 destination-pattern 252200 description *** local outbound dialpeer *** port 0/1 I've just started with Python 3 weeks ago, so my code is poortly written. I would appreciate any suggestions to improve. Ed Ellerbee -- http://mail.python.org/mailman/listinfo/python-list
Re: Suppressing newline writing to file after variable
On Tue, Jun 28, 2011 at 5:05 PM, Ellerbee, Edward eeller...@bbandt.com wrote: Hi all, newbie question here. I'm using python 2.7. I've built my first program to pull some info off the web, process it, and build dialpeers for a cisco router. I have 2 problems - the first is the formatting of printing the gathered information to a file. It seems to be inserting a new line after the variable is written. I've searched the web, but unsure of which method could fix this issue. Here is my code snippet: count=0 o = open('dialpeers.txt', 'w') for line in open('final.txt', 'r'): figureDpn = count + 1000 dpn = str(figureDpn) label = dial-peer voice + dpn o.write(label) o.write('\n') destpatt = destination-pattern + line + Try line.rstrip() instead. It'll remove all newlines. Also, I suggest you use string formatting, for example, destpatt = destination-pattern %s % line.rstrip() -- http://mail.python.org/mailman/listinfo/python-list
Using decorators with argument in Python
I am new to Python and Django, was going through the concept of decorators where I came across a special case of using arguments with decorators Below is the code for memoization where I was looking at the concept... cache = {} def get_key(function, *args, **kw) : key = '%s. %s: ' % (function. __module__,function. __name__) hash_args = [ str(arg) for arg in args] hash_kw = [' %s: %s' % (k, hash(v) ) for k, v in kw.items() ] return ' %s:: %s: : %s' % (key, hash_args, hash_kw) def memoize(get_key=get_key, cache=cache) : def _memoize( function) : print function def __memoize(*args, **kw) : key = get_key(function, *args, **kw) try: return cache[key] except KeyError: cache[key] = function( *args, **kw) return cache[key] return __memoize return _memoize @memoize() def factory(n) : return n * n # testcase #print factory(3) # # coming across to certain views from people, it is not a good practice to use decorators with arguments (i.e. @memoize() ) and instead it is good to just use @memoize. Can any of you guys explain me advantages and disadvantages of using each of them -- http://mail.python.org/mailman/listinfo/python-list
Re: Using decorators with argument in Python
On 06/29/2011 02:52 AM, Jigar Tanna wrote: coming across to certain views from people, it is not a good practice to use decorators with arguments (i.e. @memoize() ) and instead it is good to just use @memoize. Can any of you guys explain me advantages and disadvantages of using each of them Simplicity is one, using @decor() means you have at least three-level nested functions, which means the code is likely to be very huge and perhaps unnecessarily. However, there is nothing wrong with using decorators with arguments; except that if you have a simpler alternative, then why use the more complex ones? -- http://mail.python.org/mailman/listinfo/python-list
Re: Using decorators with argument in Python
On Tue, Jun 28, 2011 at 10:52 AM, Jigar Tanna poisonousratt...@gmail.com wrote: coming across to certain views from people, it is not a good practice to use decorators with arguments (i.e. @memoize() ) and instead it is good to just use @memoize. Can any of you guys explain me advantages and disadvantages of using each of them The main concern I think is not with how the decorators are used but how they are designed. An argument-less decorator will normally be used as @memoize, and @memoize() will likely not work. A decorator with arguments that are all optional will normally be used as @memoize(), and @memoize will likely not work. This naturally leads to some confusion: do I need parentheses to use this particular decorator or not? As a personal design goal I try to make my decorators either take at least one required argument or take no arguments at all. This way it's either @memoize or @memoize(foo), but never just the confusing @memoize(). Cheers, Ian -- http://mail.python.org/mailman/listinfo/python-list
RE: Suppressing newline writing to file after variable
Thank you! That works perfect, I'll have to look into string formatting more. My next issue to solve I've been researching is: How to condense a group of numbers to a wildcard list. For example: 252205 252206 252208 252220 252221 25 252223 919745 919725 919785 704770 thru 704799 (all numbers listed individually in a file) Condense to: 25220[568] 25222[0-3] (or 25222[0123] is fine too) 9197[248]5 7047[0-9][0-9] Any recommendations on where to start, a method or function to research? Thanks! Edward Ellerbee -Original Message- From: Noah Hall [mailto:enali...@gmail.com] Sent: Tuesday, June 28, 2011 12:18 PM To: Ellerbee, Edward Cc: python-list@python.org Subject: Re: Suppressing newline writing to file after variable On Tue, Jun 28, 2011 at 5:05 PM, Ellerbee, Edward eeller...@bbandt.com wrote: Hi all, newbie question here. I'm using python 2.7. I've built my first program to pull some info off the web, process it, and build dialpeers for a cisco router. I have 2 problems - the first is the formatting of printing the gathered information to a file. It seems to be inserting a new line after the variable is written. I've searched the web, but unsure of which method could fix this issue. Here is my code snippet: count=0 o = open('dialpeers.txt', 'w') for line in open('final.txt', 'r'): figureDpn = count + 1000 dpn = str(figureDpn) label = dial-peer voice + dpn o.write(label) o.write('\n') destpatt = destination-pattern + line + Try line.rstrip() instead. It'll remove all newlines. Also, I suggest you use string formatting, for example, destpatt = destination-pattern %s % line.rstrip() -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
Mel wrote: Erik Max Francis wrote: Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) Yes. They're order of magnitude estimates. 1 x 10^6 has one significant figure. 10^6 has zero. By convention, nobody ever talks about 1 x 9.97^6 . Not sure what the relevance is, since nobody had mentioned any such thing. If it was intended as a gag, I don't catch the reference. -- Erik Max Francis m...@alcyone.com http://www.alcyone.com/max/ San Jose, CA, USA 37 18 N 121 57 W AIM/Y!M/Skype erikmaxfrancis Love is the selfishness of two persons. -- Antoine de la Salle -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
Steven D'Aprano wrote: On Tue, 28 Jun 2011 01:16 pm Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Zero sig figure: 0 Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) Two. I was actually being slightly silly about zero fig figures. Although, I suppose, if you genuinely had zero significant figures, you couldn't tell what the number was at all, so you'd need to use a NaN :) No, values with zero significant figures are just order of magnitude estimates. They're used fairly often when doing very vague estimates, but obviously they're subject to pretty atrocious rounding error. For instance, let's do an order of magnitude estimate for the Planck energy. The most obvious method is to start with the Planck mass. In SI, it's about 2 x 10^-8 kg, or on the order of 10^-8 kg (zero significant figures). To convert to energy, multiply by c^2. c = 3 x 10^8 m/s, so c^2 = 9 x 10^16 m^2/s^2, or about 10^17 m^2/s^2, so the Planck energy is on the order of 10^9 J. That's a calculation to zero significant figures. -- Erik Max Francis m...@alcyone.com http://www.alcyone.com/max/ San Jose, CA, USA 37 18 N 121 57 W AIM/Y!M/Skype erikmaxfrancis Love is the selfishness of two persons. -- Antoine de la Salle -- http://mail.python.org/mailman/listinfo/python-list
Change the name with the random names in a text file
Hi Guys, I am fairly new to the language and programing. I am trying to solve a problem in a text file. Where names are something like in this manner [**Name2 (NI) 98**] [**Last Name (STitle) 97**] [**First Name4 (NamePattern1) 93**] [**Last Name (NamePattern1) 94**] ([**Name (NI) 95**]) [**Last Name (un) 96**] I am trying to change these with random names. Any ideas or how should I do it. Any help appreciated. Thank in advance -- http://mail.python.org/mailman/listinfo/python-list
Re: Suppressing newline writing to file after variable
On Tue, Jun 28, 2011 at 6:32 PM, Ellerbee, Edward eeller...@bbandt.com wrote: Thank you! That works perfect, I'll have to look into string formatting more. My next issue to solve I've been researching is: How to condense a group of numbers to a wildcard list. For example: 252205 252206 252208 252220 252221 25 252223 919745 919725 919785 704770 thru 704799 (all numbers listed individually in a file) Condense to: 25220[568] 25222[0-3] (or 25222[0123] is fine too) 9197[248]5 7047[0-9][0-9] Any recommendations on where to start, a method or function to research? Hm, perhaps re (http://docs.python.org/library/re.html). It depends on whether it's a standard static set of values you need to compare against, or a undefined dynamic set. -- http://mail.python.org/mailman/listinfo/python-list
How to create n number of threads
How to create n number thread in python. i want iterate over the for loop and create a thread for each iteration . sample code for i in range(o,50): i want to create 50 thread here which call the same function. how start and stop each thread after completion -- http://mail.python.org/mailman/listinfo/python-list
what is the airspeed velocity of an unladen swallow
this will be of interest to those bleeding-edge pythoners. “what… is the airspeed velocity of an unladen swallow?” xahlee.org/funny/unladen_swallow.html Xah -- http://mail.python.org/mailman/listinfo/python-list
Re: How to create n number of threads
On Tue, Jun 28, 2011 at 1:33 PM, hisan santosh.s...@gmail.com wrote: How to create n number thread in python. i want iterate over the for loop and create a thread for each iteration . sample code for i in range(o,50): i want to create 50 thread here which call the same function. how start and stop each thread after completion from threading import Thread threads = [Thread(target=func) for i in range(50)] for thread in threads: thread.start() for thread in threads: thread.join() -- http://mail.python.org/mailman/listinfo/python-list
Re: what is the airspeed velocity of an unladen swallow
On Tue, 28 Jun 2011 12:33:27 -0700, Xah Lee wrote: this will be of interest to those bleeding-edge pythoners. “what… is the airspeed velocity of an unladen swallow?” xahlee.org/funny/unladen_swallow.html Xah is that an African or European swallow? -- -- http://mail.python.org/mailman/listinfo/python-list
Re: what is the airspeed velocity of an unladen swallow
On Tue, Jun 28, 2011 at 1:33 PM, Xah Lee xah...@gmail.com wrote: this will be of interest to those bleeding-edge pythoners. “what… is the airspeed velocity of an unladen swallow?” xahlee.org/funny/unladen_swallow.html More interesting to me is not the ad but that Wolfram Alpha will actually answer the question. http://www.wolframalpha.com/input/?i=airspeed+velocity+of+an+unladen+swallow It even gives you an option to switch between an African or European swallow. -- http://mail.python.org/mailman/listinfo/python-list
how can I disable tkinter install?
I am building Python 2.7.2 with a standard set of options as part of a nightly build system. Some of our machines apparently have the tk headers installed, so Python automatically builds Tkinter on those platforms. Unfortunately, this now breaks matplotlib. Is there a way to turn of tkinter altogether? I am using wxPython anyway and do not want or need another set of GUI libraries, especially not if they're breaking other software. thanks, Nat -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
Erik Max Francis wrote: Mel wrote: Erik Max Francis wrote: Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) Yes. They're order of magnitude estimates. 1 x 10^6 has one significant figure. 10^6 has zero. By convention, nobody ever talks about 1 x 9.97^6 . Not sure what the relevance is, since nobody had mentioned any such thing. If it was intended as a gag, I don't catch the reference. I get giddy once in a while.. push things to limits. It doesn't really mean anything. The point was that it's only the 2 in a number like 2e6 that is taken to have error bars. The 6 is always an absolute number. As is the 10 in 2*10**6. The thought also crossed my mind of a kind of continued fraction in reverse -- 2e1.3e.7 . I managed to keep quiet about that one. Mel. -- http://mail.python.org/mailman/listinfo/python-list
Re: Significant figures calculation
Mel wrote: Erik Max Francis wrote: Mel wrote: By convention, nobody ever talks about 1 x 9.97^6 . Not sure what the relevance is, since nobody had mentioned any such thing. If it was intended as a gag, I don't catch the reference. I get giddy once in a while.. push things to limits. It doesn't really mean anything. The point was that it's only the 2 in a number like 2e6 that is taken to have error bars. The 6 is always an absolute number. As is the 10 in 2*10**6. They're not absolute numbers. It's just that the whole convention surrounding significant digits means that the figure is accurate to the last significant digit, plus or minus the range that would round to it. That would be true for any base, it's just that we use base 10. If the error bars are something other than that, they're either written down explicitly (they need not even be symmetric), or they're written with the convention of using parentheses to indicate the (symmetric) error in the final set of significant digits. For instance, RPP 2010* has a figure for Newton's gravitational constant of 6.67428(67) x 10^-11 m^3/(kg s^2), which means (6.67428 +- 0.00067) x 10^-11 m^3/(kg s^2). . * http://pdg.lbl.gov/2011/reviews/rpp2011-rev-phys-constants.pdf -- Erik Max Francis m...@alcyone.com http://www.alcyone.com/max/ San Jose, CA, USA 37 18 N 121 57 W AIM/Y!M/Skype erikmaxfrancis When in doubt, C4. -- Jamie Hyneman -- http://mail.python.org/mailman/listinfo/python-list
Re: Using decorators with argument in Python
Jigar Tanna poisonousratt...@gmail.com writes: where I came across a special case of using arguments with decorators A decorator is a function which takes exactly one parameter, and returns a function based on that parameter. URL:http://docs.python.org/glossary.html#term-decorator URL:http://docs.python.org/reference/compound_stmts.html#function So a decorator always takes an argument: the function to be decorated. Below is the code for memoization where I was looking at the concept... […] def memoize(get_key=get_key, cache=cache) : def _memoize( function) : print function def __memoize(*args, **kw) : key = get_key(function, *args, **kw) try: return cache[key] except KeyError: cache[key] = function( *args, **kw) return cache[key] return __memoize return _memoize Note that the function ‘memoize’ is not a decorator. It's a decorator creator; it returns a decorator. That is, you pass this function zero, one, or two arguments, and it defines a new function with the name ‘_memoize’; *that* function is then returned. That function is the decorator, and will receive exactly one parameter when you decorate a function. @memoize() ‘memoize()’ calls the ‘memoize’ function, which creates and returns the decorator. That return value is then used (because of the ‘@’ syntax) to decorate the function whose definition follows. def factory(n) : return n * n This function is created, and then immediately passed as the single argument to the decorator that ‘memoize()’ returned above. The return value from that decorator then gets bound to the name ‘factory’. (Side note: it's unfortunate the writer of ‘memoize’ didn't wrap the decorated function better. In this implementation, the resulting function will be bound to the name ‘factory’, but will consider its name to be ‘_memoize’. It will also lack the docstring of the ‘factory’ function. For a better way, see ‘functools.wraps’.) coming across to certain views from people, it is not a good practice to use decorators with arguments (i.e. @memoize() ) Correcting your mental model: those are not decorators. They are creating a decorator, by calling a function that returns a decorator. And if you've come across views that say there's something wrong with that, those views are mistaken. There are many good reasons to call a function to return a decorator, and “I get a different decorator depending on what arguments I give to this decorator-creator” is the pattern. and instead it is good to just use @memoize. That wouldn't work in this case, of course, since the function ‘memoize’ is not a decorator: it doesn't take the function-to-be-decorated as an argument. In other cases where the decorator is available immediately as a defined function (e.g. ‘functools.partial’ or the built-in ‘property’), there is of course no problem using that. But it's not always the case that you have that decorator yet, and calling another function (with whatever arguments it needs) to create the decorator at the point where you need to use it is also fine. Can any of you guys explain me advantages and disadvantages of using each of them I hope that explains. -- \ “Men never do evil so completely and cheerfully as when they do | `\it from religious conviction.” —Blaise Pascal (1623–1662), | _o__) Pensées, #894. | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: Suppressing newline writing to file after variable
On Wed, Jun 29, 2011 at 3:32 AM, Ellerbee, Edward eeller...@bbandt.com wrote: How to condense a group of numbers to a wildcard list. For example: 252205 252206 252208 Condense to: 25220[568] Assuming you have the list sorted (if not, that's the first place to start), I'd do a six-pass approach - one pass for each digit. It's simple and readable, and I doubt you'll be working with enough numbers for its inefficiency to be a problem. Something like this (untested code): lastprefix=tails=None for cur in list_of_numbers: prefix=cur[:5]; tail=cur[5] if prefix!=lastprefix: if lastprefix!=None: if len(tails)1: emit(%s[%s]%(lastprefix,tails)) else emit(lastprefix+tails) lastprefix,tails=prefix, tails+=tail if lastprefix!=None: if len(tails)1: emit(%s[%s]%(lastprefix,tails)) else emit(lastprefix+tails) Feed the emitted results from this pass into the next pass, in which prefix is cur[:4] and tail is cur[4], etc. For the subsequent passes, you'll also need to worry about a suffix (which would be cur[5:] when you're looking at cur[4]), and ensure that that matches, same as the prefix. This is completely untested, but it should be a start. (Replace the calls to the imaginary emit function with whatever you do to emit results - for the intermediate passes, that's probably appending to a list.) Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list
Re: Suppressing newline writing to file after variable
On Wed, Jun 29, 2011 at 8:56 AM, Chris Angelico ros...@gmail.com wrote: else emit(lastprefix+tails) else emit(lastprefix+tails) Typo in the above code. The else needs a colon after it, both times. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
[issue10736] test_ttk_guionly fails on OS X using ActiveState Tcl 8.5.9 (Cocoa)
Roundup Robot devnull@devnull added the comment: New changeset 4a0b929b5c3d by Ned Deily in branch '2.7': Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9 http://hg.python.org/cpython/rev/4a0b929b5c3d New changeset 570cdef34066 by Ned Deily in branch '3.2': Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9 http://hg.python.org/cpython/rev/570cdef34066 New changeset b7c61000ceec by Ned Deily in branch 'default': Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9 http://hg.python.org/cpython/rev/b7c61000ceec -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10736] test_ttk_guionly fails on OS X using ActiveState Tcl 8.5.9 (Cocoa)
Changes by Ned Deily n...@acm.org: -- resolution: - fixed stage: - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8746] os.chflags() and os.lchflags() are not built when they should be be
Roundup Robot devnull@devnull added the comment: New changeset abfe28e7e5cd by Ned Deily in branch '2.7': Issue #8746: Correct faulty configure checks so that os.chflags() and http://hg.python.org/cpython/rev/abfe28e7e5cd New changeset 529e26aa4fa3 by Ned Deily in branch '3.2': Issue #8746: Correct faulty configure checks so that os.chflags() and http://hg.python.org/cpython/rev/529e26aa4fa3 New changeset 9da64c0bdc33 by Ned Deily in branch 'default': Issue #8746: Correct faulty configure checks so that os.chflags() and http://hg.python.org/cpython/rev/9da64c0bdc33 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8746 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8746] os.chflags() and os.lchflags() are not built when they should be be
Ned Deily n...@acm.org added the comment: Thanks for the additional tests, Garrett. I've applied them (modulo a fix). I've also applied the corrections to configure which should make os.chflags() and os.lchflags() reappear again in BSD and OS X builds where supported. I've also added and documented two new OS X specific file flags: UF_HIDDEN and UF_COMPRESSED. Applied in default (for 3.3), 3.2 (3.2.1), and 2.7 (2.7.3). -- assignee: ronaldoussoren - ned.deily resolution: - fixed stage: patch review - committed/rejected status: open - pending type: compile error - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8746 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12425] gettext breaks on empty plural-forms value
New submission from Dirkjan Ochtman dirk...@ochtman.nl: See https://bugzilla.redhat.com/show_bug.cgi?id=692632 for more details and a proposed patch. -- components: Library (Lib) messages: 139347 nosy: djc priority: normal severity: normal status: open title: gettext breaks on empty plural-forms value versions: Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12425 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1475523] gettext breaks on plural-forms header
Dirkjan Ochtman dirk...@ochtman.nl added the comment: Okay, I've filed issue12425. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1475523 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] sysconfig.get_config_vars('srcdir') fails in specific cases
Roundup Robot devnull@devnull added the comment: New changeset c8ffa3891d5e by Ned Deily in branch '2.7': Issue #12141: Install a copy of template C module file so that http://hg.python.org/cpython/rev/c8ffa3891d5e New changeset de226a510b52 by Ned Deily in branch '3.2': Issue #12141: Install a copy of template C module file so that http://hg.python.org/cpython/rev/de226a510b52 New changeset ef8e9e99de88 by Ned Deily in branch 'default': Issue #12141: Install copies of template C module file so that http://hg.python.org/cpython/rev/ef8e9e99de88 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] sysconfig.get_config_vars('srcdir') fails in specific cases
Ned Deily n...@acm.org added the comment: Patches applied as described above for 3.3, 3.2.1, and 2.7.3. I'm setting the status of the issue to pending and, assuming there are no buildbot failures in the near future, I will close it unless anyone sees a reason not to. -- resolution: - fixed stage: patch review - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12426] packaging.tests.test_command_install_dist.InstallTestCase failure
New submission from STINNER Victor victor.stin...@haypocalc.com: FAIL: test_user_site (packaging.tests.test_command_install_dist.InstallTestCase) -- Traceback (most recent call last): File /home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py, line 93, in test_user_site self._test_user_site() File /home/buildbot/buildarea/3.x.ochtman-gentoo-amd64/build/Lib/packaging/tests/test_command_install_dist.py, line 122, in _test_user_site self.assertTrue(os.path.exists(self.user_base)) AssertionError: False is not true http://www.python.org/dev/buildbot/all/builders/AMD64%20Gentoo%20Wide%203.x/builds/1988/steps/test/logs/stdio -- assignee: tarek components: Distutils2, Tests messages: 139351 nosy: alexis, eric.araujo, haypo, tarek priority: normal severity: normal status: open title: packaging.tests.test_command_install_dist.InstallTestCase failure versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12426 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12427] packaging register fails because POST data should be bytes
New submission from Vinay Sajip vinay_sa...@yahoo.co.uk: vinay@eta-natty:~/projects/nemo$ pysetup3 run register running register Registering nemo to http://pypi.python.org/pypi Traceback (most recent call last): File /usr/local/bin/pysetup3, line 4, in module sys.exit(main()) File /usr/local/lib/python3.3/packaging/run.py, line 678, in main return dispatcher() File /usr/local/lib/python3.3/packaging/run.py, line 667, in __call__ return func(self, self.args) File /usr/local/lib/python3.3/packaging/run.py, line 204, in wrapper return f(*args, **kwargs) File /usr/local/lib/python3.3/packaging/run.py, line 344, in _run dist.run_command(cmd, dispatcher.command_options[cmd]) File /usr/local/lib/python3.3/packaging/dist.py, line 761, in run_command cmd_obj.run() File /usr/local/lib/python3.3/packaging/command/register.py, line 63, in run self.send_metadata() File /usr/local/lib/python3.3/packaging/command/register.py, line 167, in send_metadata auth) File /usr/local/lib/python3.3/packaging/command/register.py, line 267, in post_to_server result = opener.open(req) File /usr/local/lib/python3.3/urllib/request.py, line 367, in open req = meth(req) File /usr/local/lib/python3.3/urllib/request.py, line 1075, in do_request_ raise TypeError(POST data should be bytes TypeError: POST data should be bytes or an iterable of bytes. It cannot be str. vinay@eta-natty:~/projects/nemo$ -- assignee: tarek components: Distutils2, Library (Lib) messages: 139352 nosy: alexis, eric.araujo, tarek, vinay.sajip priority: high severity: normal status: open title: packaging register fails because POST data should be bytes type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12427 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12428] functools test coverage
New submission from Brian Thorne hardb...@gmail.com: The test coverage for functools was down around ~60%, this is a patch to bring that up to ~98%. Made two changes to the Lib/functools.py file itself: 1) Moved the Python implementation of partial into Lib/functools.py from Lib/test/test_functools.py which gets imported over the same as the Python implementation of cmp_to_key. 2) In order to allow the blocking of _functools, I grouped and moved the import functions from of _functools to the end of the file. In the test_functools.py file: 3) Added two new tests to TestLRU. 4) Add testing of Python implementation of cmp_to_key. I copied how test_warnings.py tests C and Python implementations of the same function. 5) Made the importing of functools itself far less clear -- components: Tests files: functools.diff keywords: patch messages: 139353 nosy: Thorney, ncoghlan, rhettinger priority: normal severity: normal status: open title: functools test coverage type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file22505/functools.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12428 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12406] msi.py needs updating for Python 3.3
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: and adding the two files added for packaging should do the trick Which two files would those be, exactly? In my branch I've changed to logic from parent.physical == distutils to parent.physical in (distutils, packaging) and this should cover the all the .exes and command_template. I haven't looked at the packaging test stuff, there may need to be some attention directed there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12406 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12429] test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2
New submission from STINNER Victor victor.stin...@haypocalc.com: test_io.check_interrupted_write() has two threads and a pipe: - reader (thread): read one byte from the pipe - writer (main thread): write 1 MB into the pipe An alarm (SIGALRM) is scheduled in one second. The writer blocks because the pipe buffer is smaller than 1 MB, but it is supposed to fill the pipe. The reader is supposed to exit quickly: the writer wrote a least one byte. The test fails *sometimes* on FreeBSD 6: [ 85/352] test_io Exception in thread Thread-274: Traceback (most recent call last): File /usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/threading.py, line 736, in _bootstrap_inner self.run() File /usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/threading.py, line 689, in run self._target(*self._args, **self._kwargs) File /usr/home/db3l/buildarea/3.2.bolen-freebsd/build/Lib/test/test_io.py, line 2660, in _read s = os.read(r, 1) OSError: [Errno 4] Interrupted system call It is a race condition, this buildbot is very slow. The reader has maybe not enough time to read 1 byte. The test was fixed in Python 3.3 (#11859) by adding pthread_sigmask() (issue #8407) and using it in the test: commit 28b9702a83d1. The problem looks to be specific of FreeBSD 6 and 7 (according to #11859). The easiest solution is to skip the test on these platforms. To workaround the lack of pthread_sigmark(), we can use two processes instead of two threads. But it is maybe too much work just to fix a bug in a test (the bug is not in Python). -- components: IO, Tests messages: 139355 nosy: haypo, neologix priority: normal severity: normal status: open title: test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2 versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12429 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12429] test_io.check_interrupted_write() sporadic failures on FreeBSD 6 on Python 2.7/3.2
STINNER Victor victor.stin...@haypocalc.com added the comment: Patch to skip the test on FreeBSD 5, 6 and 7. I was unable to reproduce #11859 on my FreeBSD 8 VM, so I didn't add freebsd8. -- keywords: +patch Added file: http://bugs.python.org/file22506/test_io_skip_freebsd.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12429 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12430] Pip fails to fetch from mirror if PyPi checksum times out
New submission from Seppo Yli-Olli seppo.ylio...@gmail.com: Checksums need to be mirrored as well, otherwise having mirrors is a waste of money because PyPi main server being slow ends up with whole download failing. If this is the wrong bug tracker, please advice me to the right one so this can be resolved. -- components: None files: pip.log messages: 139357 nosy: Seppo.Yli-Olli priority: normal severity: normal status: open title: Pip fails to fetch from mirror if PyPi checksum times out versions: Python 2.7 Added file: http://bugs.python.org/file22507/pip.log ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12430 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12430] Pip fails to fetch from mirror if PyPi checksum times out
Changes by Seppo Yli-Olli seppo.ylio...@gmail.com: -- type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12430 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12428] functools test coverage
Nick Coghlan ncogh...@gmail.com added the comment: Raymond, do we care whether or not the pure Python version of functools.partial supports inheritance and instance testing? The constructor is technically documented as returning a partial object rather than a simple staticmethod instance with additional attributes. My own preference leans towards keeping the closure based implementation due to its simplicity, which is what makes it particularly useful as a cross-check on the C implementation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12428 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12428] functools test coverage
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Raymond, do we care whether or not the pure Python version of functools.partial supports inheritance and instance testing? We don't care. The docs make very few guarantees beyond the core functionality. Everything else is an implementation detail. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12428 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12430] Pip fails to fetch from mirror if PyPi checksum times out
Stefan Krah stefan-use...@bytereef.org added the comment: Hello, The PyPI bug tracker is over here (you can find the link on the front page of http://pypi.python.org/pypi): http://sourceforge.net/tracker/?group_id=66150atid=513503 That said, having checksums come from the master server exclusively seems like a security feature, so I'm not sure whether your suggestion will be considered. -- nosy: +skrah resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12430 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12431] urllib2.Request.get_full_url() broken in newer versions of Python
New submission from Jon Siddle j...@corefiling.co.uk: Issue8280 fixed an issue where the fragment was being sent to the server (and returned by get_selector). Unfortunately the fix means that the full URL stored in the Request no longer includes the fragment either. This is in contradiction to the documentation which states: Request.get_full_url() Return the URL given in the constructor. Yet: import urllib2 urllib2.Request(http://host/path#fragment;).get_full_url() 'http://host/path' The particular use case is a custom scheme handler, which should be able to use the whole of the opaque part of the URL to operate. Ie, our code wants to do something like this: urllib2.Request(foo://opaquestring#opaquestring).get_full_url() -- messages: 139361 nosy: jonsiddle priority: normal severity: normal status: open title: urllib2.Request.get_full_url() broken in newer versions of Python type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12431 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12425] gettext breaks on empty plural-forms value
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12425 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12432] remove a bunch of unused imports in Lib
New submission from Vincent Legoll vincent.leg...@gmail.com: Using pylint I found some unused imports in Lib. I filtered the most obvious ones by hand to produce the attached patch. Should I submit individual patches, one for each file, so as to ease review ? -- components: Library (Lib) files: unused-imports-2.patch keywords: patch messages: 139362 nosy: vincele priority: normal severity: normal status: open title: remove a bunch of unused imports in Lib versions: Python 3.4 Added file: http://bugs.python.org/file22508/unused-imports-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12432 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12432] remove a bunch of unused imports in Lib
Roundup Robot devnull@devnull added the comment: New changeset 8c17e898e0e8 by Benjamin Peterson in branch 'default': remove unused imports (closes #12432) http://hg.python.org/cpython/rev/8c17e898e0e8 -- nosy: +python-dev resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12432 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12433] make clean doesn't clean up static libraries on 2.x
New submission from Garrett Cooper yaneg...@gmail.com: Running 'make clean' leaves libpython*.a behind. The attached patch removes it when make clean is run. This was resolved on py3k, not trunk; the attached patch matches what was done on py3k. -- components: Build files: cleanup-libpython-dot-a-trunk.patch keywords: patch messages: 139364 nosy: yaneurabeya priority: normal severity: normal status: open title: make clean doesn't clean up static libraries on 2.x type: compile error versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file22509/cleanup-libpython-dot-a-trunk.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12433 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12433] make clean doesn't clean up static libraries on 2.x
Ned Deily n...@acm.org added the comment: A similar fix was applied and released in both 2.6.6 and 2.7.1. -- nosy: +ned.deily resolution: - out of date stage: - committed/rejected status: open - closed type: compile error - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12433 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12431] urllib2.Request.get_full_url() broken in newer versions of Python
Changes by Ned Deily n...@acm.org: -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12431 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12433] make clean doesn't clean up static libraries on 2.x
Garrett Cooper yaneg...@gmail.com added the comment: Is svn not being updated anymore (in lieu of hg)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12433 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12432] remove a bunch of unused imports in Lib
Vincent Legoll vincent.leg...@gmail.com added the comment: Looking through http://hg.python.org/cpython/rev/8c17e898e0e8 I see that the glob.py hunk has been applied reversed. The changeset 68349:55bea11d892e removing it is 3 monthes old... Looks like I missed a svn-hg migration on my side, sorry for the screwup... -- resolution: fixed - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12432 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12433] make clean doesn't clean up static libraries on 2.x
Ned Deily n...@acm.org added the comment: No, the svn repos for python itself (at svn.python.org) are frozen as of the hg transition and are for historical reference only. See http://docs.python.org/devguide/ for more info on current practices. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12433 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12432] remove a bunch of unused imports in Lib
Vincent Legoll vincent.leg...@gmail.com added the comment: This one reverts glob.py to the previous state -- Added file: http://bugs.python.org/file22510/reremove-sys-import-from-glob.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12432 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12431] urllib2.Request.get_full_url() broken in newer versions of Python
Santoso Wijaya santoso.wij...@gmail.com added the comment: This has been fixed with issue #11703, latest version of Python 2.7 does not exhibit this behaviour anymore: Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win 32 Type help, copyright, credits or license for more information. import urllib2 urllib2.Request('http://host/path#fragment').get_full_url() 'http://host/path#fragment' -- components: +Library (Lib) nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12431 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12407] test_subinterps fails on Windows
Antoine Pitrou pit...@free.fr added the comment: I don't really understand why you need this. Under normal setups, the test is already properly skipped under Windows, since there's no rule to build the Modules/_testembed with MSVC. Or are you talking about another kind of setup? Cygwin? mingw? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12407 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12352] multiprocessing.Value() hangs
Antoine Pitrou pit...@free.fr added the comment: Nice work! I also think heap_gc_deadlock_lockless.diff is good, except for Victor's reservation: is it deliberate that you reversed the following two statements in _free_pending_blocks(), compared to the code in free()? +self._free(block) +self._allocated_blocks.remove(block) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12352 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray methods center, ljust, rjust don't accept a bytearray as the fill character
Antoine Pitrou pit...@free.fr added the comment: I do agree it is a nuisance that it doesn't work with bytearray instances. After all, these methods are supposed to be homogeneous, and they are when called on a str or bytes object. -- assignee: docs@python - stage: committed/rejected - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12380 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12380] bytearray methods center, ljust, rjust don't accept a bytearray as the fill character
Changes by Antoine Pitrou pit...@free.fr: -- components: -Documentation ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12380 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12434] Strengthen 2.7 io types warning
New submission from Terry J. Reedy tjre...@udel.edu: Trying 3.2 code with 2.7, I got this (greatly simplified): from __future__ import print_function from io import StringIO print('hello world', file=StringIO()) Traceback... TypeError: string argument expected, got 'str' (StringIO.StringIO works fine, of course.) This was initially confusing. Suggestion: after Note Since this module has been designed primarily for Python 3.x, you have to be aware that all uses of “bytes” in this document refer to the str type (of which bytes is an alias), and all uses of “text” refer to the unicode type. add 'String' in exception messages may also mean the unicode type. -- assignee: docs@python components: Documentation keywords: easy messages: 139374 nosy: docs@python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Strengthen 2.7 io types warning versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12434 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12147] smtplib.send_message does not implement corectly rfc 2822
Nicolas Estibals nicolas.estib...@gmail.com added the comment: Sorry for the late, my week-end was more busy than expected. Here is the corrected version of the patch. -- Added file: http://bugs.python.org/file22511/send_message_rfc2822_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12147 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12423] signal handler doesn't handle SIGABRT from os.abort
Kamil Kisiel ka...@kamilkisiel.net added the comment: The application is interfacing with a C library that uses abort() to signal fatal errors (horrible, I know..). Instead of core dumping I would like to be able to handle these errors at the Python level and do something else. It's starting to sound like that might be impossible. You explanation of the abort() behaviour makes sense to me. However, if that's the case then this portion of the docs appears to be incorrect: Be aware that programs which use signal.signal() to register a handler for SIGABRT will behave differently. Maybe my interpretation is wrong, but I would read behave differently as call the signal handler instead in this case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12417] Inappropriate copyright on profile files
Barry A. Warsaw ba...@python.org added the comment: I think we should apply this to earlier applicable versions too. I would accept this change for Python 2.6. -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12423] signal handler doesn't handle SIGABRT from os.abort
STINNER Victor victor.stin...@haypocalc.com added the comment: Be aware that programs which use signal.signal() to register a handler for SIGABRT will behave differently. I don't understand this sentence. I think that this sentence should be removed, and another should maybe be added. E.g. os.abort() doesn't call the Python signal handler installed by signal.signal(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12423 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12435] Input function does not strip trailing '\r' from string input
New submission from Brian Hare ha...@umkc.edu: In Windows, using python 3.2, the built-input function does not strip the trailing '\r' from the string input: Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. input('Enter ') Enter abcde 'abcde\r' This behavior does not appear in IDLE but does appear in a free-standing command window. While the docs only say that the trailing newline is dropped, the 2.6 docs for raw_input have exactly the same wording and the carriage return is dropped: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. raw_input('Enter ') Enter abcde 'abcde' -- components: Windows messages: 139379 nosy: BKHare priority: normal severity: normal status: open title: Input function does not strip trailing '\r' from string input type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12435 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12435] Input function does not strip trailing '\r' from string input
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12435 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12435] Input function does not strip trailing '\r' from string input
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: Already fixed with issue11272, which will be included in 3.2.1 and 3.3. -- nosy: +amaury.forgeotdarc resolution: - out of date status: open - closed superseder: - input() has trailing carriage return on windows ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12435 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12436] Provide reference to detailed installation instructions
New submission from Nick Coghlan ncogh...@gmail.com: The Boston Python Workshop folks have some detailed step-by-step instructions on getting Python up and running ([1]). Given that this can be a pain point for new users (primarily on Windows), it may be good to reference these instructions from the official docs. (Alternatively, we could use them as the basis for a HOWTO in the official docs and update release.py to adjust the relevant links. That's a lot more work than just adding a link, though) [1] http://openhatch.org/wiki/Boston_Python_Workshop_3/Friday -- assignee: docs@python components: Documentation messages: 139381 nosy: docs@python, ncoghlan priority: normal severity: normal status: open title: Provide reference to detailed installation instructions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12436 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12437] _ctypes.dlopen does not include errno in OSError
New submission from Matt Joiner anacro...@gmail.com: _ctypes.dlopen is not including the errno when it raises OSError. This occurs when attempting to load a library that doesn't exist, the error string given is clearly generated from an ENOENT. joiner@dbssyd800:~$ python3 dlopen_raise.py None somelib.so: cannot open shared object file: No such file or directory -- components: ctypes files: dlopen_raise.py messages: 139382 nosy: anacrolix priority: normal severity: normal status: open title: _ctypes.dlopen does not include errno in OSError type: behavior versions: Python 2.7, Python 3.2 Added file: http://bugs.python.org/file22512/dlopen_raise.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12437 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10736] test_ttk_guionly fails on OS X using ActiveState Tcl 8.5.9 (Cocoa)
Ned Deily n...@acm.org added the comment: No obvious buildbot problems so far so I'm going to close this as fixed. Thanks for the patch, Ronald. -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10736 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8746] os.chflags() and os.lchflags() are not built when they should be be
Changes by Ned Deily n...@acm.org: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8746 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12141] sysconfig.get_config_vars('srcdir') fails in specific cases
Changes by Ned Deily n...@acm.org: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12141 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12172] IDLE crashes when I use F5 to run
Ned Deily n...@acm.org added the comment: Since there's been no response and I believe the problem should not occur with a properly installed Python 3.2 and ActiveState Tcl 8.5 as described here (http://www.python.org/download/mac/tcltk/), I'm going to close this issue. Please reopen if the problem persists and you can supply more supporting information. -- resolution: - works for me stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12172 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12438] getpass error on idle
New submission from João Bernardo jbv...@gmail.com: The getpass function is raising an error when first used on idle (Python 3.2 and 2.7.1) The next time it'll work as expected (it echoes the data, but idle is just for testing purposes so no problems here) from getpass import getpass p = getpass() Traceback (most recent call last): File pyshell#1, line 1, in module p = getpass() File /usr/lib/python3.2/getpass.py, line 55, in unix_getpass passwd = fallback_getpass(prompt, stream) File /usr/lib/python3.2/getpass.py, line 114, in fallback_getpass stacklevel=2) File /usr/lib/python3.2/idlelib/PyShell.py, line 62, in idle_showwarning lineno, file=file, line=line)) TypeError: idle_formatwarning() got an unexpected keyword argument 'file' p = getpass() Warning: Password input may be echoed. Password: ok p 'ok' Looking at the /usr/lib/python3.2/idlelib/PyShell.py file the idle_formatwarning function don't have the file argument so it should be revomed from the function call at line 61: file.write(warnings.formatwarning(message, category, filename, lineno, file=file, line=line)) -- components: IDLE messages: 139385 nosy: JBernardo priority: normal severity: normal status: open title: getpass error on idle type: crash versions: Python 2.7, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12438 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12379] build outside source fail in head
Ned Deily n...@acm.org added the comment: Fixed by Benjamin in f8f1d5691ae8. -- nosy: +ned.deily resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12379 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12437] _ctypes.dlopen does not include errno in OSError
Santoso Wijaya santoso.wij...@gmail.com added the comment: On Windows: try: ... ctypes.CDLL('somelib') ... except OSError as exc: ... print repr(exc) ... print exc.errno ... WindowsError(126, 'The specified module could not be found') 22 -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12437 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12361] Memory Leak in File Logging
Jacob Perkins jap...@gmail.com added the comment: Sorry about this. Turns out the flattening of memory usage was a temporary coincidence, and I eventually tracked the bug down to an old version of MySQLdb. -- resolution: - invalid status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12361 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12417] Inappropriate copyright on profile files
Roundup Robot devnull@devnull added the comment: New changeset 02150e60636b by Benjamin Peterson in branch '2.6': update profile license (closes #12417) http://hg.python.org/cpython/rev/02150e60636b New changeset 633597815463 by Benjamin Peterson in branch '3.1': update profile license (closes #12417) http://hg.python.org/cpython/rev/633597815463 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12417 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now 10.3 but 10.5 during configure
Ned Deily n...@acm.org added the comment: While I am a little concerned about applying these fixes, it is clear that the previous behavior was broken and the initial set of patches as applied did not improve matters. The only risk I can see is that there is a slight chance that there *might* be some 3rd-party package that unknowingly depended on the previous behavior of setting MACOSX_DEPLOYMENT_TARGET globally and which might now fail. There is no simple way to find such packages short of attempting to build them and test them. However, if there *should* be such packages, the simple fix for them is to export the desired MACOSX_DEPLOYMENT_TARGET value into the interpreter process (via a shell variable, for instance). So, I think it best to bite the bullet. I've applied the Distutils patches to 2.7 (for 2.7.3), to 3.2 (for 3.2.1), to default (for 3.3) and the packaging patches to default (for 3.3). -- resolution: - fixed stage: patch review - committed/rejected status: open - pending versions: +Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9516 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10403] Use member consistently
Antoine Pitrou pit...@free.fr added the comment: So I'm -1 on using attributes to denote methods. It will actively confuse non-expert users. If you want to ditch members, please consider using the more explicit phrase attributes and methods. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10403 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10403] Use member consistently
Senthil Kumaran sent...@uthcode.com added the comment: Yes, I agree with you. Good Suggestion. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10403 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com