Correctly use tempfile.mkstemp().
This commit is contained in:
		
							parent
							
								
									156bfd8fbe
								
							
						
					
					
						commit
						84e2e2bd14
					
				| @ -661,8 +661,8 @@ class Activity(Window, gtk.Container): | |||||||
|         # TODO: Find a way of taking a png out of the pixbuf without saving |         # TODO: Find a way of taking a png out of the pixbuf without saving | ||||||
|         # to a temp file. Impementing gtk.gdk.Pixbuf.save_to_buffer in pygtk |         # to a temp file. Impementing gtk.gdk.Pixbuf.save_to_buffer in pygtk | ||||||
|         # would solve this. |         # would solve this. | ||||||
|         fd, file_path = tempfile.mkstemp('.png')[0] |         fd, file_path = tempfile.mkstemp('.png') | ||||||
|         fd.close() |         os.close(fd) | ||||||
| 
 | 
 | ||||||
|         pixbuf.save(file_path, 'png') |         pixbuf.save(file_path, 'png') | ||||||
|         f = open(file_path) |         f = open(file_path) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Tomeu Vizoso
						Tomeu Vizoso