I think I've found a bug in (py)SFML or Python 3.3.
When I run this code (it looks strange, but this is what remained after removing everything that didn't cause the crash):
import sfml as sf
window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')
texture = sf.Texture.from_file('map.png')
window.close()
print('test')
the whole script executes, prints 'test' and then Windows shows a window saying that python.exe has stopped working. However, it doesn't crash in the IDLE python shell, only when I run the script directly.
Deleting the texture before the window is closed fixes everything:
import sfml as sf
window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')
texture = sf.Texture.from_file('map.png')
del texture
window.close()
Looks like the crash is caused by the texture not being deleted before the window is closed.
And this code:
import sfml as sf
window = sf.RenderWindow(sf.VideoMode(640, 480), 'test')
texture = sf.Texture.from_file('map.png')
window.close()
print('test1')
del texture
print('test2')
prints 'test1' and crashes like the first snippet, but unlike the first one it doesn't run fine in IDLE (it enters an infinite loop after print('test1')).