[issue7978] SocketServer doesn't handle syscall interruption

2012-04-08 Thread Jerzy Kozera
Jerzy Kozera jerzy.koz...@gmail.com added the comment: I forgot to mention my patch is 3.3-only, sorry - it depends on changes from #12555 (http://hg.python.org/cpython/rev/41a1de81ef2b#l18.21 to be precise). To support 3.2 and 2.7: (1) select.error must be caught as in the original patch

[issue7978] SocketServer doesn't handle syscall interruption

2012-04-06 Thread Jerzy Kozera
Jerzy Kozera jerzy.koz...@gmail.com added the comment: I've updated the patch according to suggestions from Gregory P. Smith. Thanks to a change from #12555 (PEP 3151) now just checking for OSError is enough. (I've decided to use mocked select() instead of calling alarm() to avoid depending

[issue9742] Python 2.7: math module fails to build on Solaris 9

2010-11-23 Thread Jerzy Kozera
Jerzy Kozera jerzy.koz...@gmail.com added the comment: Running gcc -Wl,-R/usr/local/lib,-R/usr/lib -o python Python/pymath.o Modules/python.o libpython2.7.a -lresolv -lsocket -lnsl -lrt -ldl -lpthread -lm mv build/lib.solaris-2.8-sun4u-2.7/math_failed.so build/lib.solaris-2.8-sun4u-2.7

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
New submission from Jerzy jer...@genesilico.pl: Hi When I am outputting unicode strings to terminal my script works OK, but when I redirect it to file I get a crash: $ python mailing/message_sender.py -l Bia Białystok $ python mailing/message_sender.py -l Bia ~/tmp/aaa.txt Traceback (most

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: I know how to make it work. The question is why outputting to file makes it crush when outputting to terminal does not. I have never seen $program file behaving in a different way than $program in any other language Jerzy Orlowski Benjamin

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: Well, I would suggest using the terminal encoding as default one when redirecting. In my opinion sys.stdin and sys.stdout should always have the terminal encoding Alternatively you could make the function sys.setdefaultencoding() visible

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: OK, I give up. The problem is that one might test a program on terminal and think that everything is running OK and then spend a reasonable amount of time trying to find the problem later Another approach: couldn't utf8 be set as default encoding

[issue6832] Outputting unicode crushes when printing to file on Linux

2009-09-03 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: good point! I will give it a try Jerzy Martin v. Löwis wrote: Martin v. Löwis mar...@v.loewis.de added the comment: If you want to switch to a different language, consider switching to Python 3. There, all strings are Unicode strings

P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
I've stumbled upon the following in Python 3: Python 3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information. import sys sys.stdout.write() 0 sys.stdout.write(something) something9 write() is appending the length of the

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
import sys n = sys.stdout.write('something') something n 9 Yes, that works as expected, now, similar to 2.6. Thank you both, Diez and André! -Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Re: P3 weird sys.stdout.write()

2009-08-24 Thread Jerzy Jalocha N
the return value(9), which is suppressed if it's None, which it was in 2.x.   This has nothing to do with how the language behaves in normal use. This makes it much clearer! You are right, output in a shell script is normal, without the return value. Thank you, Dave. -Jerzy -- http

[issue6518] Enable 'with' statement in ossaudiodev module

2009-07-18 Thread Jerzy Jalocha N
New submission from Jerzy Jalocha N jjalo...@gmail.com: Actually, it is not possible to use the 'with' statement in the ossaudiodev module: import ossaudiodev with ossaudiodev.open('/dev/dsp', 'r') as device: ... pass ... Traceback (most recent call last): File stdin, line 1 in module

[issue6519] Reorder 'with' statement for files in Python Tutorial

2009-07-18 Thread Jerzy Jalocha N
New submission from Jerzy Jalocha N jjalo...@gmail.com: Actually, the Python Tutorial recommends the use of the 'with' statement in Section 7.2.1. Methods of File Objects: It is good practice to use the with keyword when dealing with file objects. [etc.] But the example and description

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: OK, I see and if don't want l to exist in f() I have to: def f(): pass def a(): l=[] f() a() Jurek Martin v. Löwis wrote: Martin v. Löwis mar...@v.loewis.de added the comment: I still do not understand what is going on when

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: And anyway, for me it's not OK if something in a code of a function like 'del' affect how variables are affected in whole function. It is really illogical. There code is in lines and line are one below another. The logical way is that a line

[issue5092] weird memory usage in multiprocessing module

2009-01-30 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: I am not an expert. But for me it is much better. If you cannot delete the global variable in a function (del makes the variable local anyway). So trying to delete a global variable should raise an exception Cannot delete a global variable

[issue5092] weird memory usage in multiprocessing module

2009-01-29 Thread Jerzy
Jerzy jer...@genesilico.pl added the comment: I still do not understand what is going on when python executed thic code. I have a local variable l in my parent process. When I create a child process, program makes first makes a copy of memory. Than what? I am sure that l still exists in child

[issue5092] weird memory usage in multiprocessing module

2009-01-28 Thread Jerzy
New submission from Jerzy jer...@genesilico.pl: Hi I am using the multiprocessing mudule and I found a very weird thing. It seems that that the result of one fragment of the code depends on the fragment of the code that is after it, which should not happen. My script looks like this import

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-25 Thread Jerzy Jalocha N
Scott David Daniels wrote: So, the first question is: How do I install the complete Python test framework under Ubuntu (Debian)? You could use BZR or SVN to get a copy of the full Lib/test tree. Given your long-disconnected running, I'd consider getting a full source set for

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-24 Thread Jerzy Jalocha N
to support the _complete_ Python release. Thanks, Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't find Python Library packages in Ubuntu (Debian)

2008-11-21 Thread Jerzy Jalocha N
to compile Python? The one thing you will definitely need is the python-dev-package. It will contain things such as headers and distutils that are needed to build and install 3rd-party-packages. Thanks for your comments, Diez! Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Can't find Python Library packages in Ubuntu (Debian)

2008-11-20 Thread Jerzy Jalocha N
, my second question: What (meta?-)package(s) do I have to install under Ubuntu (Debian) in order to get a full (as in the official release) Python installation? Thank you in advance! Jerzy -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-08 Thread Jerzy Karczmarczuk
* be overloaded, but the absence of *aliasing* (undiscriminate handling of pointers) in Python. Am I wrong? Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: Addressing the last element of a list

2005-11-08 Thread Jerzy Karczmarczuk
my words. Sure, I didn't want to claim that the assignment a=anything can be plainly overloaded. But getitem, setitem, getattr, setattr - yes. And they (set-) are also assignments. Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Jerzy Karczmarczuk
pornography to teenagers, or driving without a licence. Possession of banned books is a crime in many countries, [enough ...] Now, tell me: is the polluting of a newsgroup with off-topic postings, a crime, and if yes then what? Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo

Re: Microsoft Hatred FAQ

2005-10-19 Thread Jerzy Karczmarczuk
no harm. More than hundred - become annoying. Cross-posting to 5 groups is bad. Please go away. Claiming that this is an interesting, great thread is utterly silly in this context. Shall Python newsgroup discuss the trial of Saddam Hussein as well? Jerzy Karczmarczuk -- http://mail.python.org

Technical question on complexity.

2005-10-13 Thread Jerzy Karczmarczuk
time (unless the whole stuff is copied, which again makes the complexity related to the size of existing structure...) It is probably possible to retrieve this information from the sources, but I try first an easier way. Thank you. Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo

What is executed when in a generator

2005-10-04 Thread Jerzy Karczmarczuk
either. *EVERYTHING* from the beginning until the yield gets executed only upon s.next(). Could you tell me please where can I read something in depth about the semantics of generators? I feel a bit lost. Thank you. Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: What is executed when in a generator

2005-10-04 Thread Jerzy Karczmarczuk
some co-recursive algorithms with them. So i use next() when I wish, and never 'for'. Thank you once more. Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Twist and perversion. Was: Software bugs aren't inevitable

2005-09-19 Thread Jerzy Karczmarczuk
to many. Well, *why* people who jump into Python from other languages very often like functional constructs, and dislike the fact that destructive methods return nothing?... Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-16 Thread Jerzy Karczmarczuk
algorithms to Python generators... Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
calling Jerzy Karczmarczuk's efficiently recursive function with n=1000, while my iterative version works for at least values of n an order of magnitude larger.) Yes, the maximum recursion depth in Python is an artificial limit. But that artificial limit is built into Python specifically

Re: Software bugs aren't inevitable

2005-09-15 Thread Jerzy Karczmarczuk
rather inacceptable. It is not the machine code which matters, but human effort [provided you spent sufficient time to be fluent in *good* recursive programming of complex tasks.] Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Re: Software bugs aren't inevitable

2005-09-14 Thread Jerzy Karczmarczuk
memoization, though, so it is not entirely senseless to learn it. Jerzy Karczmarczuk -- http://mail.python.org/mailman/listinfo/python-list

Inconsistent reaction to extend

2005-09-09 Thread Jerzy Karczmarczuk
is similar. I didn't try other methods, but I suspect that it won't improve. WHY? It seems that there was already some discussion about consistency and somebody produced the example: h = {}.update(l) which didn't work, but I wasn't subscribed to this nsgr, I couldn't follow this affair. Jerzy