plone.namedfile deletes read-mode open files.
"Jens W. Klein" <jens-/[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Organization | Klein & Partner KG |
| Message-ID | <[email protected]> |
Hi, I just found a strange/surprising behavior in plone.namedfile Background: I had unicode problems in plone.app.contenttypes indexers. This is completly unrelated, but while debugging here I refined the tests to cover all three api cases for file field input: string, unicode and open file. Latter worked fine, except that the open file disappeared from filesystem, so running the test a second time failed. Now I had no idea what happens and added a failing test documenting the behavior. https://github.com/plone/plone.app.contenttypes/commit/2f758c15298f0f012e2f568accaad7f64060e5cb#L2R206 I also filed a bug at: https://github.com/plone/plone.app.contenttypes/issues/57 Fact is: Using plone.namedfile api to create a NamedBlobFile with 'data' kwarg set to an open (read-mode) file will remove the file from filesystem. So this is not an plone.app.contenttypes issue. I consider it as black magic: If some api kills files I pass over as read mode open files the api is a bad citizen. How can we handle this? regards Jens -- Klein & Partner KG, member of BlueDynamics Alliance ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk