-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storage.py _cleanup TypeError: unsupported operand type(s) for -: 'str' and 'int' #12
Comments
Both 'modified' values should be integers or floats. It is the same as what you get when you run Is this with the standard Image content type of Plone? Or a different one from own code or an add-on? Maybe you have code that overrides the The two values you pasted above are the same. What is strange, is that they start with You could check |
Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@05d238a Avoid TypeErrors when looking for outdated scales. Fixes plone/plone.scale#12 Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@9d95279 When getting an outdated scale, don't throw it away when there is no factory. Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@bcca32a modified time can be a long. Fixes plone.namedfile and plone.app.imaging tests. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@9d0cf3e Fix modified scale comparison with offset. We were subtracting from the wrong value. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T23:07:48-04:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.scale@4938b05 Merge pull request #19 from plone/modified-time-compare-14 Various scale storage bug fixes [1.4.x] Files changed: M CHANGES.rst M plone/scale/storage.py
Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@05d238a Avoid TypeErrors when looking for outdated scales. Fixes plone/plone.scale#12 Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@9d95279 When getting an outdated scale, don't throw it away when there is no factory. Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@bcca32a modified time can be a long. Fixes plone.namedfile and plone.app.imaging tests. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T22:53:44-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@9d0cf3e Fix modified scale comparison with offset. We were subtracting from the wrong value. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/1.4.x Date: 2016-10-22T23:07:48-04:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.scale@4938b05 Merge pull request #19 from plone/modified-time-compare-14 Various scale storage bug fixes [1.4.x] Files changed: M CHANGES.rst M plone/scale/storage.py
Branch: refs/heads/master Date: 2016-10-22T22:45:43-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@8236f40 Avoid TypeErrors when looking for outdated scales. Fixes plone/plone.scale#12 Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/master Date: 2016-10-22T22:49:02-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@329796c When getting an outdated scale, don't throw it away when there is no factory. Files changed: M CHANGES.rst M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/master Date: 2016-10-22T22:49:04-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@1c3ce6e modified time can be a long. Fixes plone.namedfile and plone.app.imaging tests. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/master Date: 2016-10-22T22:49:04-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@e041d81 Require the `six` package so we can more easily check number types. On Python 3 `long` has been merged into `int`. Files changed: M CHANGES.rst M plone/scale/storage.py M setup.py Repository: plone.scale Branch: refs/heads/master Date: 2016-10-22T22:49:04-04:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.scale@111249f Fix modified scale comparison with offset. We were subtracting from the wrong value. Files changed: M plone/scale/storage.py Repository: plone.scale Branch: refs/heads/master Date: 2016-10-22T23:08:31-04:00 Author: Jens W. Klein (jensens) <jk@kleinundpartner.at> Commit: plone/plone.scale@9bae0a4 Merge pull request #21 from plone/modified-time-compare-master Various scale storage bug fixes [master] Files changed: M CHANGES.rst M plone/scale/storage.py M setup.py
Funny, I just got this error in an old Plone 4.3.3 installation and plone.scale 1.3.4. We were having the same issue as https://github.com/plone/plone.scale/pull/3/files#r10500627, then after seeing https://github.com/plone/plone.scale/pull/4/files we decided to upgrade just plone.scale to 1.3.4 (since we can't do a full upgrade on this specific instance). But then we're getting the same problem as this issue when trying to replace an image to a new one: we get the same traceback
Debugging the values we have:
How safe it's to update only plone.scale to 1.4.2 (since your fix |
Plone 4.3.8 updates But it also updates It updates So: it is worth a shot to update, possibly in combination with plone.namedfile. |
Thanks for answering @mauritsvanrees. I haven't even thought about In the worst case, a patch to this specific case can be done as well, but I want to avoid that since it gets out of control pretty quickly. |
Most important changes between versions mentioned by @mauritsvanrees in #12 (comment): (There's a bug in github rendering, so please add an anchor 1.3.4...1.4.2#diff-d10a7080d4907760fc31685295aba766 plone.scale 1.4.2 is using a new And in plone.namedfile: plone/plone.namedfile@2.0.9...3.0.7#diff-3191fc72b422536280e8a8692b6d23d7 |
Hi, i get an error while rendering an template with Images. I use Plone 4.3.9. Please no irritations because of the path in the traceback.
File "/opt/Plone-4.3.3/buildout-cache/eggs/plone.scale-1.4.1-py2.7.egg/plone/scale/storage.py", line 166, in scale self._cleanup() File "/opt/Plone-4.3.3/buildout-cache/eggs/plone.scale-1.4.1-py2.7.egg/plone/scale/storage.py", line 190, in _cleanup value['modified'] < modified_time - KEEP_SCALE_MILLIS): TypeError: unsupported operand type(s) for -: 'str' and 'int' # Here my Debug Output of the Values: 2016-08-27 18:58:05 INFO plone.scale key: d7620496-5e61-4f6b-8490-b30399d809ba 2016-08-27 18:58:05 INFO plone.scale modified time 1467291549.8024411467291549.8028791467291549.8032841467291549.8036901467291549.804092 2016-08-27 18:58:05 INFO plone.scale value['modified'] 1467291549.8024411467291549.8028791467291549.8032841467291549.8036901467291549.804092
I think it's not an Integer, all values are 'str'. The comparison but needs integer values . What should i do? Should I overwrite the _cleanup Method and purge the Storage every time?
The text was updated successfully, but these errors were encountered: