Jerzy Kozera 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,
(2) e.args[0] must be
Jerzy Kozera 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
Jerzy Kozera 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/math.so
seems to have
Jerzy added the comment:
good point!
I will give it a try
Jerzy
Martin v. Löwis wrote:
> Martin v. Löwis added the comment:
>
> If you want to switch to a different language, consider switching to
> Python 3. There, all strings are Unicode strings, and files opened in
> text
Jerzy 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 for all
input
Jerzy 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 to change it in a reasonable
Jerzy 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
New submission from Jerzy :
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 recent call l
New submission from Jerzy Jalocha N :
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 d
New submission from Jerzy Jalocha N :
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
Jerzy 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" or something
Jerzy 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 of c
Jerzy 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 added the comment:
>
>> I still do not understand what is going on when python executed
Jerzy 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 process because
1
New submission from Jerzy :
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 time
import
15 matches
Mail list logo