Re: [pygame] This program breaks on my Linux

2014-06-29 Thread DR0ID

On 2014-06-28 19:14, bw wrote:

if e.key == K_ESCAPE:
print(1)
pygame.display.get_init()
print(2)
pygame.display.get_surface()
print(3)
screen.unlock()
print(4)
pygame.display.set_mode((16, 64))
print(5)
pygame.display.flip()
print(6)
pygame.quit()
print(7)
sys.exit()
print(8)

In this sequence it's understood 8 will never be reached. When the 
program exits normally 7 is printed and the program terminates. When 
the fps gallops away, indicating the problem has occurred, the last 
thing printed is always 6 and the program hangs. In all cases the 
pygame functions return, except for pygame.quit(). When trying other 
exit routines in lieu of pygame.quit() the exiting statement hangs, I 
presume because pygame's cleanup is called.


Gumm

On 6/28/2014 05:29, Sam Bull wrote:

On ven, 2014-06-27 at 22:35 -0700, bw wrote:

I attached the small program. I'm curious if anyone can run it and
reproduce the problem. I plan on upgrading Ubuntu soon, when I am ready
to risk it: maybe the problem will go away. I'll post the outcome--but
I've been too busy to risk the upgrade, so don't hold yer breath. =)

No idea what the problem could be. I can't reproduce it, but also not
getting more than 130 FPS on my old laptop. I'm curious as to exactly
when it crashes though, can you add some print statements to find
exactly where it crashes?

 if e.key == K_ESCAPE:
 print(Before)
 pygame.quit()
 print(After Pygame exit)
 quit()
 print(Never reached)
 I'd also experiment with a couple of different exit 
functions, to see if

that makes any difference. For example, try removing the pygame.quit()
call (Pygame will exit safely with Python anyway, so it's a redundant
call here), and using sys.exit() instead of the builtin.




Hi

Could it be that quitting pygame while processing the event queue (well, 
the if is in the loop where you process the events) isn't that nice?


Maybe this does not address the actual problem, but might help finding 
the problem.


I would prefer something like this (using the pygame.quit *after* 
leaving the while loop):


running = True
while running:
...
for event in pygame.event.get():

if event.key == K_ESCAPE:
running = False

pygame.quit()
sys.exit()


Also I thought (maybe I'm wrong) that pygame.quit() is registered by 
pygame in the 'atexit' module (so no needed to call separately if 
quiting the program, of course you need a pygame.quit() if you only want 
to quit pygame but keep python running).


I hope that helps

~DR0ID



Re: [pygame] This program breaks on my Linux

2014-06-29 Thread bw

Hi, Jake,

This is not true. A process's default action for an unhandled event is 
to abort. During normal execution, when the problem is not occurring, an 
unhandled SIGTERM aborts the process just fine.


Gumm

On 6/29/2014 00:48, Jake b wrote:


 SIGTERM (15) does not kill the program. SIGKILL (9) does.

You need to handle event QUIT.





Re: [pygame] This program breaks on my Linux

2014-06-29 Thread bw

Hi, DR0ID,

While it may not be elegant there is nothing syntactically wrong with 
what I did in the event loop. :) When the misbehavior is not occurring 
there is no problem exiting the program as it is designed.


To get to the bottom of this I think someone with the right skills and 
knowledge would have to dig well beneath the Python code. I lack the 
requisites, unfortunately.


Gumm

On 6/29/2014 02:10, DR0ID wrote:

On 2014-06-28 19:14, bw wrote:

if e.key == K_ESCAPE:
print(1)
pygame.display.get_init()
print(2)
pygame.display.get_surface()
print(3)
screen.unlock()
print(4)
pygame.display.set_mode((16, 64))
print(5)
pygame.display.flip()
print(6)
pygame.quit()
print(7)
sys.exit()
print(8)

In this sequence it's understood 8 will never be reached. When the 
program exits normally 7 is printed and the program terminates. When 
the fps gallops away, indicating the problem has occurred, the last 
thing printed is always 6 and the program hangs. In all cases the 
pygame functions return, except for pygame.quit(). When trying other 
exit routines in lieu of pygame.quit() the exiting statement hangs, I 
presume because pygame's cleanup is called.


Gumm

On 6/28/2014 05:29, Sam Bull wrote:

On ven, 2014-06-27 at 22:35 -0700, bw wrote:

I attached the small program. I'm curious if anyone can run it and
reproduce the problem. I plan on upgrading Ubuntu soon, when I am 
ready

to risk it: maybe the problem will go away. I'll post the outcome--but
I've been too busy to risk the upgrade, so don't hold yer breath. =)

No idea what the problem could be. I can't reproduce it, but also not
getting more than 130 FPS on my old laptop. I'm curious as to exactly
when it crashes though, can you add some print statements to find
exactly where it crashes?

 if e.key == K_ESCAPE:
 print(Before)
 pygame.quit()
 print(After Pygame exit)
 quit()
 print(Never reached)
 I'd also experiment with a couple of different exit 
functions, to see if

that makes any difference. For example, try removing the pygame.quit()
call (Pygame will exit safely with Python anyway, so it's a redundant
call here), and using sys.exit() instead of the builtin.




Hi

Could it be that quitting pygame while processing the event queue 
(well, the if is in the loop where you process the events) isn't that 
nice?


Maybe this does not address the actual problem, but might help finding 
the problem.


I would prefer something like this (using the pygame.quit *after* 
leaving the while loop):


running = True
while running:
...
for event in pygame.event.get():

if event.key == K_ESCAPE:
running = False

pygame.quit()
sys.exit()


Also I thought (maybe I'm wrong) that pygame.quit() is registered by 
pygame in the 'atexit' module (so no needed to call separately if 
quiting the program, of course you need a pygame.quit() if you only 
want to quit pygame but keep python running).


I hope that helps

~DR0ID





[pygame] Potential Malware in Pygame 1.9.2a0.win32-py3.2

2014-06-29 Thread Jeffrey Kleykamp
I just downloaded and installed
pygame-1.9.2a0.win32-py3.2.msi
and my webroot secure anywhere caught some malware in it. I have no idea if
this is real or what. Here's the log,


Automated Cleanup Engine
Starting Cleanup at 29/06/2014 - 21:35:57 GMT

Starting Routine Removing
c:\python32\lib\site-packages\pygame\fastevent.pyd...#(PX5:
5958229000E66EC43402003B3C2E0700DECDFB7E - MD5:
CB274A3F1A83260D82957409855CA077)...
Deleting File c:\python32\lib\site-packages\pygame\fastevent.pyd

Automated Cleanup Engine
Starting Cleanup at 29/06/2014 - 21:36:05 GMT

Starting Routine Removing
c:\python32\lib\site-packages\pygame\rwobject.pyd...#(PX5:
9715EE78004EFB243081002B48A504004E3053AE - MD5:
2C5778D0816BEBA8ECC7D1FE11B23384)...
Deleting File c:\python32\lib\site-packages\pygame\rwobject.pyd

Automated Cleanup Engine
Starting Cleanup at 29/06/2014 - 21:36:13 GMT

Starting Routine Removing
c:\python32\lib\site-packages\pygame\surflock.pyd...#(PX5:
84FADE1C0046001620F7009522A6E30019BD6E14 - MD5:
685D26D6E4EF4ADE48436B92B9118669)...
Deleting File c:\python32\lib\site-packages\pygame\surflock.pyd


-- 

  Jeffrey Kleykamp


Re: [pygame] Potential Malware in Pygame 1.9.2a0.win32-py3.2

2014-06-29 Thread diliup gabadamudalige
this could be potentially dangerous! does anyone else have more info? i am
using this version.


On Mon, Jun 30, 2014 at 3:13 AM, Jeffrey Kleykamp 
jeffrey.kleyk...@gmail.com wrote:

 I just downloaded and installed
 pygame-1.9.2a0.win32-py3.2.msi
 and my webroot secure anywhere caught some malware in it. I have no idea
 if this is real or what. Here's the log,


 Automated Cleanup Engine
 Starting Cleanup at 29/06/2014 - 21:35:57 GMT

 Starting Routine Removing
 c:\python32\lib\site-packages\pygame\fastevent.pyd...#(PX5:
 5958229000E66EC43402003B3C2E0700DECDFB7E - MD5:
 CB274A3F1A83260D82957409855CA077)...
 Deleting File c:\python32\lib\site-packages\pygame\fastevent.pyd

 Automated Cleanup Engine
 Starting Cleanup at 29/06/2014 - 21:36:05 GMT

 Starting Routine Removing
 c:\python32\lib\site-packages\pygame\rwobject.pyd...#(PX5:
 9715EE78004EFB243081002B48A504004E3053AE - MD5:
 2C5778D0816BEBA8ECC7D1FE11B23384)...
 Deleting File c:\python32\lib\site-packages\pygame\rwobject.pyd

 Automated Cleanup Engine
 Starting Cleanup at 29/06/2014 - 21:36:13 GMT

 Starting Routine Removing
 c:\python32\lib\site-packages\pygame\surflock.pyd...#(PX5:
 84FADE1C0046001620F7009522A6E30019BD6E14 - MD5:
 685D26D6E4EF4ADE48436B92B9118669)...
 Deleting File c:\python32\lib\site-packages\pygame\surflock.pyd


 --

   Jeffrey Kleykamp




-- 
Diliup Gabadamudalige

http://www.diliupg.com
http://soft.diliupg.com/

**
This e-mail is confidential. It may also be legally privileged. If you are
not the intended recipient or have received it in error, please delete it
and all copies from your system and notify the sender immediately by return
e-mail. Any unauthorized reading, reproducing, printing or further
dissemination of this e-mail or its contents is strictly prohibited and may
be unlawful. Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability for any
errors or omissions.
**