[ANN] Leipzig Python User Group - Meeting, February 12, 2013, 08:00 p.m.

2013-02-09 Thread Mike Müller
=== Leipzig Python User Group === We will meet on Tuesday, February 12 at 8:00 p.m. at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Mike Müller (me ;)) will talk about IPython [1] and especially the new IPython notebook. IPython is

Can you help me???

2013-02-09 Thread MoneyMaker
Are you traveling abroad on holiday??? Does the resort have enough information on the internet??? Would you like to ask local people information about attractions, good places to eat, nice places, that is, just about anything??? For this site, I have asked people around the world to join and

Coercing one object to type of another

2013-02-09 Thread Vijay Shanker
Hi Inside a function i get a two arguments, say arg1 and arg2, how can i convert arg2 to same type as arg1 ? I dont know type of arg1 or arg2 for that matter, I just want to convert arg2 to type of arg1 if possible and handle the exception if raised. Also: int('2') 2 float('2.0') 2.0

Re: Coercing one object to type of another

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 9:29 PM, Vijay Shanker deont...@gmail.com wrote: Hi Inside a function i get a two arguments, say arg1 and arg2, how can i convert arg2 to same type as arg1 ? I dont know type of arg1 or arg2 for that matter, I just want to convert arg2 to type of arg1 if possible and

python3 binascii.hexlify ...

2013-02-09 Thread Cameron Simpson
This seems to return a bytes object in Python 3.3.0. I was expecting a string. The documentation here: http://docs.python.org/3/library/binascii.html#binascii.hexlify also keeps me expecting a string. Am I missing something? Example: [hg/css-venti-bytes+utf8]fleet*2 python3 Python 3.3.0

string.replace doesn't removes :

2013-02-09 Thread Joshua Robinson
Hi *Monte-Pythons*, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is still in the text Is this a bug or am I doing something wrong ? Py.Version: 2.7

Re: python3 binascii.hexlify ...

2013-02-09 Thread Peter Otten
Cameron Simpson wrote: This seems to return a bytes object in Python 3.3.0. I was expecting a string. The documentation here: http://docs.python.org/3/library/binascii.html#binascii.hexlify also keeps me expecting a string. Am I missing something? Return the hexadecimal representation

Re: string.replace doesn't removes :

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 10:04 PM, Joshua Robinson shooki.robin...@gmail.com wrote: Hi Monte-Pythons, x = this is a simple : text: that has colon s = x.replace(string.punctuation, ); OR s = x.replace(string.punctuation, ); print x # 'this is a simple : text: that has colon' # The colon is

Python3 curses behavior

2013-02-09 Thread Vlasov Vitaly
Hello. I found strange behavior of curses module, that i can't understand. I initialize screen with curses.initscr(), then i create subwin of screen with screen.subwin(my_subwin_sizes). After that i fill subwin with my_char in for-loop. On last char in last line subwin.addch() raises

Re: Coercing one object to type of another

2013-02-09 Thread Vijay Shanker
On Saturday, February 9, 2013 4:13:28 PM UTC+5:30, Chris Angelico wrote: On Sat, Feb 9, 2013 at 9:29 PM, Vijay Shanker deont...@gmail.com wrote: Hi Inside a function i get a two arguments, say arg1 and arg2, how can i convert arg2 to same type as arg1 ? I dont know type of arg1 or

Re: python3 binascii.hexlify ...

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 10:10 PM, Peter Otten __pete...@web.de wrote: Return the hexadecimal representation of the binary data. Every byte of data is converted into the corresponding 2-digit hex representation. makes it pretty clear that the function is operating on bytes, not str. That

Re: Python3 curses behavior

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 10:23 PM, Vlasov Vitaly vnig...@gmail.com wrote: Hello. I found strange behavior of curses module, that i can't understand. I initialize screen with curses.initscr(), then i create subwin of screen with screen.subwin(my_subwin_sizes). After that i fill subwin with

Re: Coercing one object to type of another

2013-02-09 Thread Chris Angelico
On Sat, Feb 9, 2013 at 10:23 PM, Vijay Shanker deont...@gmail.com wrote: well it will always return me this: type 'str' what i want is if i know arg1 is of string type(and it can be of any type, say list, int,float) and arg2 is of any type, how can i convert it to type of arg1, if

Alternatives to Splunk?

2013-02-09 Thread sssdevelop
Are there any opensource alternatives to Splunk? Need tool to analyze the log files.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3 curses behavior

2013-02-09 Thread Vlasov Vitaly
суббота, 9 февраля 2013 г., 15:28:51 UTC+4 пользователь Chris Angelico написал: On Sat, Feb 9, 2013 at 10:23 PM, Vlasov Vitaly vnig...@gmail.com wrote: Hello. I found strange behavior of curses module, that i can't understand. I initialize screen with curses.initscr(), then i

Re: Jinja2 installation help

2013-02-09 Thread Robert Iulian
Here is the fucked up thing that I learned from all the hours of reading from different websites and documentation. To install Pip I need to install Easy_Install-- To install Easy_install I need to install Setup Tools whitch is NOT compatible with Python 3.XX ... If PIP is a replacement for

Re: Jinja2 installation help

2013-02-09 Thread Kwpolska
On Sat, Feb 9, 2013 at 1:55 PM, Robert Iulian robert.iulia...@gmail.com wrote: Here is the fucked up thing that I learned from all the hours of reading from different websites and documentation. To install Pip I need to install Easy_Install-- To install Easy_install I need to install Setup

Re: Jinja2 installation help

2013-02-09 Thread Robert Iulian
Ah...Must have slipped that. It worked! Thank you all for the support ! Be well ! Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternatives to Splunk?

2013-02-09 Thread Rodrick Brown
On Sat, Feb 9, 2013 at 7:27 AM, sssdevelop sssdeve...@gmail.com wrote: Are there any opensource alternatives to Splunk? Need tool to analyze the log files.. This is highly off topic, however I'm using logstash + kibana for my log analysis. --

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Dave Angel
On 02/09/2013 09:27 AM, Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me know how can i do

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread D'Arcy J.M. Cain
On Sat, 9 Feb 2013 15:27:16 +0100 Morten Engvoldsen mortene...@gmail.com wrote: I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Morten Engvoldsen
Hi Cain, Thanks for your reply. I am stroning all the contents in batchdate and then, data = base64.encodestring(batchdata) and then writing data in doc file. I know i can append ***Start file*** in the batchdata, but is there a better python code like multiply * into 10

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Peter Otten
Morten Engvoldsen wrote: I know i can append ***Start file*** in the batchdata, but is there a better python code like multiply * into 10 times -- any python code i can add the formatting in dynamic way instead of hardcoding with ***Start file*** line.

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Morten Engvoldsen
Hi Davea, I am using Python 2.7. -- http://mail.python.org/mailman/listinfo/python-list

Logwatch python

2013-02-09 Thread Cleuson Alves
Hello, I am trying to run this code, but I get an answer incorrect arguments numbers. someone could put an example of arguments for me to use in the / var / log? Thank you. import os, sys from optparse import

Re: Logwatch python

2013-02-09 Thread Roy Smith
In article 1de56e5b-4f9b-477d-a1d4-71e7222a2...@googlegroups.com, Cleuson Alves cleuso...@gmail.com wrote: Hello, I am trying to run this code, but I get an answer incorrect arguments numbers. someone could put an example of arguments for me to use in the / var / log? Since the first cave

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread rusi
On Feb 9, 7:27 pm, Morten Engvoldsen mortene...@gmail.com wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Dave Angel
On 02/09/2013 10:01 AM, Morten Engvoldsen wrote: Hi Davea, I am using Python 2.7. Sorry, I should have noticed the python version in the subject line, but didn't until this reply. How about print outfile, Start the File.center(55, *) after creating the file, and print outfile, Start

Re: Alternatives to Splunk?

2013-02-09 Thread sssdevelop
Yup - its off topic. I was triggered to write here because Splunk is written in Python. And Python is good at Parsing/Regex. Thank you for your response about logstash, kibana. I was looking for such tools only - thank you so much. ---sss On Saturday, February 9, 2013 7:05:57 PM UTC+5:30,

Re: Alternatives to Splunk?

2013-02-09 Thread Matty Sarro
Look up any nosql database. At it's heart that is what splunk is built on. Or, if you're working with less than 500mb of data a day, just use the free version of splunk. On Sat, Feb 9, 2013 at 12:09 PM, sssdevelop sssdeve...@gmail.com wrote: Yup - its off topic. I was triggered to write here

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Mark Lawrence
On 09/02/2013 14:27, Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me know how can i do that

Re: Python3 curses behavior

2013-02-09 Thread Terry Reedy
On 2/9/2013 6:23 AM, Vlasov Vitaly wrote: Hello. I found strange behavior of curses module, that i can't understand. I initialize screen with curses.initscr(), then i create subwin of screen with screen.subwin(my_subwin_sizes). After that i fill subwin with my_char in for-loop. On last char in

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Terry Reedy
On 2/9/2013 11:21 AM, rusi wrote: On Feb 9, 7:27 pm, Morten Engvoldsen mortene...@gmail.com wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of

Re: python3 binascii.hexlify ...

2013-02-09 Thread Cameron Simpson
On 09Feb2013 22:26, Chris Angelico ros...@gmail.com wrote: | On Sat, Feb 9, 2013 at 10:10 PM, Peter Otten __pete...@web.de wrote: | Return the hexadecimal representation of the binary data. Every byte of | data is converted into the corresponding 2-digit hex representation. | | | makes it

Re: Alternatives to Splunk?

2013-02-09 Thread Steven D'Aprano
sssdevelop wrote: Are there any opensource alternatives to Splunk? Need tool to analyze the log files.. Is Google blocked where you are? How about other search engines like DuckDuckGo, Bling, Yahoo, etc? Surely *some* search engine must work. If not, I suggest asking on a mailing list for

Re: Coercing one object to type of another

2013-02-09 Thread Steven D'Aprano
Vijay Shanker wrote: Hi Inside a function i get a two arguments, say arg1 and arg2, how can i convert arg2 to same type as arg1 ? I dont know type of arg1 or arg2 for that matter, I just want to convert arg2 to type of arg1 if possible and handle the exception if raised. How do you

Re: Is Python programming language?

2013-02-09 Thread Tim Roberts
Grant Edwards invalid@invalid.invalid wrote: IMO, a scripting language is used to automate tasks that would otherwise be done by a human sitting at a keyboard typing commands. [Perhaps that definition should be extended to include tasks that would otherwise by done by a human sitting and clicking

Re: Is Python programming language?

2013-02-09 Thread Michael Torrie
On 02/09/2013 04:26 PM, Tim Roberts wrote: Most people would call bash a scripting language, but it is also clearly a programming language. It has syntax, variables and expressions. I suspect it is Turing-complete, although I haven't seen a proof of that. I would assert that scripting

Re: Is Python programming language?

2013-02-09 Thread Terry Reedy
On 2/9/2013 6:53 PM, Michael Torrie wrote: On 02/09/2013 04:26 PM, Tim Roberts wrote: Most people would call bash a scripting language, but it is also clearly a programming language. It has syntax, variables and expressions. I suspect it is Turing-complete, although I haven't seen a proof of

Re: Is Python programming language?

2013-02-09 Thread Terry Reedy
On 2/9/2013 6:26 PM, Tim Roberts wrote: Grant Edwards invalid@invalid.invalid wrote: IMO, a scripting language is used to automate tasks that would otherwise be done by a human sitting at a keyboard typing commands. [Perhaps that definition should be extended to include tasks that would

Re: Is Python programming language?

2013-02-09 Thread Michael Torrie
On 02/09/2013 07:40 PM, Terry Reedy wrote: If the language has arrays, conditional execution, and explicit (while) loops or recursion, you can be pretty sure it is Turing complete. I presume this covers awk and bash. Something like the game of Life, where the looping in implicit in the

Re: Spawn a process, then exit, whilst leaving process running?

2013-02-09 Thread Nobody
On Fri, 08 Feb 2013 21:04:33 -0800, Victor Hooi wrote: I have a Python script that I'd like to spawn a separate process (SSH client, in this case), and then have the script exit whilst the process continues to run. I looked at Subprocess, however, that leaves the script running, and it's

Re: LangWart: Method congestion from mutate multiplicty

2013-02-09 Thread Rick Johnson
On Friday, February 8, 2013 9:36:52 PM UTC-6, Steven D'Aprano wrote: Rick Johnson wrote: The solution is simple. Do not offer the copy-mutate methods and force all mutation to happen in-place: py l = [1,2,3] py l.reverse py l [3,2,1] If the user wants a mutated copy he

Re: LangWart: Method congestion from mutate multiplicty

2013-02-09 Thread Chris Angelico
On Sun, Feb 10, 2013 at 2:54 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: My point was this: All mutate methods should mutate in-place, if the programmer wishes to create a mutated copy of the object, then the programmer should /explicitly/ create a copy of the object and then apply

Re: Implicit conversion to boolean in if and while statements

2013-02-09 Thread Rick Johnson
On Friday, February 8, 2013 11:01:00 PM UTC-6, Chris Angelico wrote: [...] Another advantage of using two characters: There's no conflict between set and dict literals. How do you notate an empty set in Python? {} means an empty dict. What makes you believe that a language must provide

Re: Implicit conversion to boolean in if and while statements

2013-02-09 Thread Chris Angelico
On Sun, Feb 10, 2013 at 3:26 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: On Friday, February 8, 2013 11:01:00 PM UTC-6, Chris Angelico wrote: [...] Another advantage of using two characters: There's no conflict between set and dict literals. How do you notate an empty set in Python?

Re: LangWart: Method congestion from mutate multiplicty

2013-02-09 Thread Mark Janssen
On Sat, Feb 9, 2013 at 8:20 PM, Chris Angelico ros...@gmail.com wrote: On Sun, Feb 10, 2013 at 2:54 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: My point was this: All mutate methods should mutate in-place, if the programmer wishes to create a mutated copy of the object, then the

Re: Implicit conversion to boolean in if and while statements

2013-02-09 Thread Rick Johnson
On Friday, February 8, 2013 7:17:26 PM UTC-6, Chris Angelico wrote: On Sat, Feb 9, 2013 at 11:49 AM, Rick Johnson nested_list = array(array(string)) Actually, that's not a declaration, that's an assignment; and in Pike, a 'type' is a thing, same as it is in Python (though not quite). If I

Re: Implicit conversion to boolean in if and while statements

2013-02-09 Thread Chris Angelico
On Sun, Feb 10, 2013 at 3:54 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: Well Chris i have wonderful news for you! Python /does/ have homogenous arrays, and they're called, wait for it. arrays! Imagine that! That's not a built-in. But you were the one who complained about the

Re: Implicit conversion to boolean in if and while statements

2013-02-09 Thread Rick Johnson
On Friday, February 8, 2013 7:06:34 PM UTC-6, Ian wrote: On Fri, Feb 8, 2013 at 12:58 PM, Rick Johnson wrote: I'm a bit unnerved by the sum function. Summing a sequence only makes sense if the sequence in question contains /only/ numeric types. For that reason i decided to create a

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7

2013-02-09 Thread Morten Engvoldsen
Hi Dave, This sounds great, thanks for your help :) On Sat, Feb 9, 2013 at 6:13 PM, Dave Angel da...@davea.name wrote: On 02/09/2013 10:01 AM, Morten Engvoldsen wrote: Hi Davea, I am using Python 2.7. Sorry, I should have noticed the python version in the subject line, but didn't until

[issue17166] Fix the suggested usage of _dummy_thread module

2013-02-09 Thread Berker Peksag
New submission from Berker Peksag: The dummy_thread module has been renamed to _dummy_thread in Python 3: import dummy_thread Traceback (most recent call last): File stdin, line 1, in module ImportError: No module named 'dummy_thread' -- assignee: docs@python

[issue17167] python man page contains $Date$ in page footer

2013-02-09 Thread Ned Deily
New submission from Ned Deily: The center footer in the source for the python man page, specifically the .th macro in Misc/python.man, contains an unexpanded $Date$ left over from the days of svn keyword expansions. Since hg does not support such expansions, either the source should be

[issue16686] audioop overflow issues

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6add6ac6a802 by Serhiy Storchaka in branch '2.7': Issue #16686: Fixed a lot of bugs in audioop module. http://hg.python.org/cpython/rev/6add6ac6a802 New changeset 104b17f8316b by Serhiy Storchaka in branch '3.2': Issue #16686: Fixed a lot of bugs

[issue16686] audioop overflow issues

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I fixed yet one bug in avgpp() and remove my XXX comment. *All* audioop functions are unsafe regarding unaligned access. I'll open a new issue for this. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed

[issue16686] audioop overflow issues

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: *All* audioop functions are unsafe regarding unaligned access. Actually this is not true because currently audioop functions work only with bytes (and str, see issue16685) and not with arbitrary memoryview. --

[issue17147] BytesIO should be mentioned in SpooledTemporaryFile documentation

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb4ed16f35bd by Serhiy Storchaka in branch '3.2': Issue #17147. Mention BytesIO in SpooledTemporaryFile documentation. http://hg.python.org/cpython/rev/fb4ed16f35bd New changeset 8f772825029f by Serhiy Storchaka in branch '3.3': Issue #17147.

[issue17147] BytesIO should be mentioned in SpooledTemporaryFile documentation

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for corrections Éric. -- assignee: docs@python - serhiy.storchaka resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue10355] SpooledTemporaryFile's name property is broken

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c2ff6e64c47 by Serhiy Storchaka in branch '2.7': Issue #10355: SpooledTemporaryFile properties and xreadline method now work for unrolled files. http://hg.python.org/cpython/rev/5c2ff6e64c47 New changeset dfc6902b63d7 by Serhiy Storchaka in

[issue17168] test.support 3.x docs mentions stringio.stringio

2013-02-09 Thread Ramchandra Apte
New submission from Ramchandra Apte: StringIO.StringIO has been renamed to io.StringIO in 3.x. Attached is a patch with the corrected version which mentions io.StringIO. -- assignee: docs@python components: Documentation files: issue.patch keywords: patch messages: 181729 nosy:

[issue17157] issubclass() should accept iterables in 2nd arg

2013-02-09 Thread Ramchandra Apte
Ramchandra Apte added the comment: Just so you know, I'm neutral on this idea. I think it should at least accept sequences though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17157 ___

[issue17156] Tools/i18n/pygettext.py doesn't parse unicode string.

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Default encoding on Python 3 is UTF-8. You should declare your encoding at the top of file if it differs from UTF-8 or ASCII (i.e. # -*- coding: euc-jp -*-). Otherwise Python will reject your file (for Shift_JIS and EUC-JP) or produce incorrect result (for

[issue10355] SpooledTemporaryFile's name property is broken

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10355

[issue17152] Array module should support boolean natively

2013-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: There's already a fairly well known 3rd-party library for this: http://pypi.python.org/pypi/bitarray/ I'd be -1 on putting something like this in the standard library: the array module doesn't get enough maintenance as it is, and a packed bit array sounds

[issue7358] cStringIO not 64-bit safe

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset a025b04332fe by Serhiy Storchaka in branch '2.7': Issue #7358: cStringIO.StringIO now supports writing to and reading from http://hg.python.org/cpython/rev/a025b04332fe -- nosy: +python-dev ___ Python

[issue17136] ctypes tests fail with clang on non-OS X

2013-02-09 Thread Dirkjan Ochtman
Dirkjan Ochtman added the comment: libffi now has this fix: https://github.com/atgreen/libffi/commit/6a790129427121f7db2d876e7218a3104e6d2741 Can someone test with that? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17136

[issue17168] test.support 3.x docs mentions stringio.stringio

2013-02-09 Thread Ramchandra Apte
Ramchandra Apte added the comment: Please commit or review. This is *very* trivial. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17168 ___ ___

[issue17166] Fix the suggested usage of _dummy_thread module

2013-02-09 Thread Ramchandra Apte
Ramchandra Apte added the comment: LGTM. -- nosy: +ramchandra.apte ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17166 ___ ___ Python-bugs-list

[issue17157] issubclass() should accept iterables in 2nd arg

2013-02-09 Thread Franck Michea
Franck Michea added the comment: I am neutral on this too, it just felt odd and this is why the question raised. Yesterday I tried to add sequences and iterables (only to issubclass but indeed it would need better testing and all) and came to a problem with sequences. The current

[issue17168] test.support 3.x docs mentions stringio.stringio

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 474296d6d4a1 by Benjamin Peterson in branch '3.3': StringIO.StringIO - io.StringIO (closes #17168) http://hg.python.org/cpython/rev/474296d6d4a1 New changeset 87e95b853be2 by Benjamin Peterson in branch 'default': merge 3.3 (#17168)

[issue17169] Restore errno in tempfile exceptions

2013-02-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Before 3.3 if not able to create the name of the temporary file then an OSError with meaninful errno (ENOENT or EEXIST) was raised. Now subclass of OSError raised with errno=None. This is an incompatible change because old user code can catch OSError

[issue17156] Tools/i18n/pygettext.py doesn't parse unicode string.

2013-02-09 Thread umedoblock
umedoblock added the comment: python3 output translate Japanese with pygettext.install(). EVERYTHING IS OK! please check to use a konnichiha.2.tar.gz. == please do below shell command. $ for f in `find . -name 'konnichiha.*.py'` ; do echo f=$f ;

[issue7358] cStringIO not 64-bit safe

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7358 ___

[issue17170] string replace is too slow

2013-02-09 Thread Guido van Rossum
New submission from Guido van Rossum: I'm trying to speed up a web template engine and I find that the code needs to do a lot of string replacements of this form: name = name.replace('_', '-') Characteristics of the data: the names are relatively short (1-10 characters usually), and the

[issue17170] string replace is too slow

2013-02-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Characteristics of the data: the names are relatively short (1-10 characters usually) $ ./python -m timeit -s a = 'hundred' 'x' in a 1000 loops, best of 3: 0.0431 usec per loop $ ./python -m timeit -s a = 'hundred' a.find('x') 100 loops, best of 3:

[issue17170] string method lookup is too slow

2013-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, you seem to be right. Changing the bug title. So, can we speed up method lookup? It's a shame that I have to start promoting this ugly idiom. There's a similar issue where s[:5]=='abcde' is faster than s.startswith('abcde'): ./python.exe -m timeit -s a

[issue17170] string method lookup is too slow

2013-02-09 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti, serhiy.storchaka versions: +Python 3.4 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17170 ___

[issue17170] string method lookup is too slow

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two overheads: an attribute lookup and a function call. $ ./python -m timeit -s a = 'hundred' 'x' in a 1000 loops, best of 3: 0.0943 usec per loop $ ./python -m timeit -s a = 'hundred' a.__contains__('x') 100 loops, best of 3: 0.271 usec

[issue16038] ftplib: unlimited readline() from connection

2013-02-09 Thread Michał Jastrzębski
Michał Jastrzębski added the comment: Hello, I've set up maxline limit to 8192. Also I've add some changes Antoine suggested earlier. -- Added file: http://bugs.python.org/file29019/ftplib_maxline.patch ___ Python tracker rep...@bugs.python.org

[issue17169] Restore errno in tempfile exceptions

2013-02-09 Thread Senthil Kumaran
Senthil Kumaran added the comment: The patch looks good and it is correct thing to do IMO. thanks. -- nosy: +orsenthil ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17169 ___

[issue16564] email.generator.BytesGenerator fails with bytes payload

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30f92600df9d by R David Murray in branch '2.7': #16564: test to confirm behavior that regressed in python3. http://hg.python.org/cpython/rev/30f92600df9d New changeset a1a04f76d08c by R David Murray in branch '3.2': #16564: Fix regression in use of

[issue17171] email.encoders.encode7or8bit does not work with binary data

2013-02-09 Thread R. David Murray
New submission from R. David Murray: Reported by Serhiy in issue 16564: import io, email bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff' msg = email.mime.application.MIMEApplication(bytesdata, _encoder=encoders.encode_7or8bit) s = io.BytesIO() g = email.generator.BytesGenerator(s)

[issue16564] email.generator.BytesGenerator fails with bytes payload

2013-02-09 Thread R. David Murray
R. David Murray added the comment: I've opened issue 17171 for the similar encode7or8bit problem. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue13555] cPickle MemoryError when loading large file (while pickle works)

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an updated patch. Fixed two bugs found by Antoine (an inappropriate format and a memory error in bigmemtest), fixed resizing of marks array and one possible integer overflow in write_other(). Used workaround to bypass limitations of cStringIO API.

[issue17166] Fix the suggested usage of _dummy_thread module

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6af3afbc7211 by R David Murray in branch '3.2': #17166: fix _dummy_thread import example. http://hg.python.org/cpython/rev/6af3afbc7211 New changeset dfefae8df4f7 by R David Murray in branch '3.3': Merge: #17166: fix _dummy_thread import example.

[issue17166] Fix the suggested usage of _dummy_thread module

2013-02-09 Thread R. David Murray
R. David Murray added the comment: Thanks, Berker. -- nosy: +r.david.murray resolution: - fixed stage: - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17166

[issue17170] string method lookup is too slow

2013-02-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed the function call cost actually dominates: $ ./python -m timeit -s a = 'hundred' a.find('x') 100 loops, best of 3: 0.206 usec per loop $ ./python -m timeit -s a = 'hundred'; f=a.find f('x') 1000 loops, best of 3: 0.176 usec per loop $ ./python -m

[issue17170] string method lookup is too slow

2013-02-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Some crude C benchmarking on this computer: - calling PyUnicode_Replace is 35 ns (per call) - calling hundred.replace is 125 ns - calling PyArg_ParseTuple with the same signature as hundred.replace is 80 ns Therefore, most of the overhead (125 - 35 = 90 ns) is

[issue16956] Allow signed line number deltas in the code object's line number table

2013-02-09 Thread Xavier de Gaye
Changes by Xavier de Gaye xdeg...@gmail.com: -- nosy: +xdegaye ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16956 ___ ___ Python-bugs-list

[issue17170] string method lookup is too slow

2013-02-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And PyArg_ParseTupleAndKeywords() is even more slow. $ ./python -m timeit str(b'', 'utf-8', 'strict') 100 loops, best of 3: 0.554 usec per loop $ ./python -m timeit str(object=b'', encoding='utf-8', errors='strict') 100 loops, best of 3: 1.74 usec per

[issue17169] Restore errno in tempfile exceptions

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 11eaa61124c2 by Serhiy Storchaka in branch '3.3': Issue #17169: Restore errno in tempfile exceptions. http://hg.python.org/cpython/rev/11eaa61124c2 New changeset fd3e3059381a by Serhiy Storchaka in branch 'default': Issue #17169: Restore errno in

[issue17172] Add turtledemo to IDLE menu

2013-02-09 Thread Raymond Hettinger
New submission from Raymond Hettinger: The turtledemo is an on-ramp for younger programmers and we should make it easy to launch. -- components: IDLE keywords: easy messages: 181757 nosy: rhettinger priority: normal severity: normal stage: needs patch status: open title: Add turtledemo

[issue17156] Tools/i18n/pygettext.py doesn't parse unicode string.

2013-02-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49b1fde510a6 by Serhiy Storchaka in branch '2.7': Issue #17156: pygettext.py now correctly escapes non-ascii characters. http://hg.python.org/cpython/rev/49b1fde510a6 New changeset cd59b398907d by Serhiy Storchaka in branch '3.2': Issue #17156:

[issue17156] Tools/i18n/pygettext.py doesn't parse unicode string.

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17156

[issue17169] Restore errno in tempfile exceptions

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17169

[issue17043] Invalid read in test_codecs

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17043

[issue17173] uses of locale-dependent ctype functions

2013-02-09 Thread Antoine Pitrou
New submission from Antoine Pitrou: Grepping through the code reveals we are still using a number of locale-dependent C library functions: Python/mystrtoul.c:102:while (*str isspace(Py_CHARMASK(*str))) Python/mystrtoul.c:141:while (isspace(Py_CHARMASK(*str)))

[issue17173] uses of locale-dependent ctype functions

2013-02-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for fixing this everywhere. -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17173 ___

[issue17170] string method lookup is too slow

2013-02-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch yielding a decent speedup (~ 40%) on PyArg_ParseTuple itself. More generally though, this would be improved by precompiling some of the information (like Argument Clinic does, perhaps). (note: PyArg_ParseTupleAndKeywords is a completely

[issue17170] string method lookup is too slow

2013-02-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17170 ___ ___

  1   2   >