Code

Opened 4 years ago

Closed 4 years ago

#12457 closed (duplicate)

"IOError: Too many open files" when pulling height and width values from a long list of ImageField containing Model objects.

Reported by: legutierr Owned by: nobody
Component: Database layer (models, ORM) Version: 1.0
Severity: Keywords: "Too many open files"
Cc: legutierr Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

It appears as if ImageField.width and ImageField.height both open the referenced image file without closing it, resulting in the above mentioned IOError.

The behavior is induced as follows: I have a long list of objects, and I am trying to pull out the size of the images that they reference. After a certain point is reached, the IOError is raised when model_object.image_field.width is accessed and assigned.

This is taking place in OSX Server Leopard running fastcgi and apache, but I am sure that it would occur in other configurations as well.

I determined the nature of the problem by stepping through the code using pdb. In fastcgi the exeption is caught and obfuscated. Instead of the IOError being displayed, the following message is printed out directly by fastcgi, without any further information:

"An unhandled exception was thrown by the application."

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Dupe of #8817.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.