<div dir="ltr"><div>That's tricky -- once you load and re-save a pickle with persistence version N, code that doesn't have that version defined (older code) will not be able to load the pickle.  So you'll need to apply the patch to all instances.<br><br></div><div>Pickles are no fun :(<br></div><div><br></div>Dustin<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 26, 2016 at 4:04 AM, Maria Marcano <span dir="ltr"><<a href="mailto:mariangemarcano@gmail.com" target="_blank">mariangemarcano@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Do you know how we should handle adding an attribute to serialized object.</div><div><br></div><div>We are doing some customizations and we would like to add content_type to </div><div><table style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2px"><tbody><tr></tr><tr><td style="padding:0px 10px;vertical-align:top;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;overflow:visible;word-wrap:normal"><span style="color:rgb(167,29,93)">class</span> <span style="color:rgb(121,93,163)">HTMLLogFile</span>(<span style="color:rgb(121,93,163)">styles</span>.<span style="color:rgb(121,93,163)">Versioned</span>, <span style="color:rgb(121,93,163)">LogFile</span>):</td></tr><tr><td style="padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td></tr></tbody></table></div><div><br></div><div>so we increased the </div><table style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2px"><tbody><tr><td style="padding:0px 10px;vertical-align:top;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;overflow:visible;word-wrap:normal"><br>    persistenceVersion <span style="color:rgb(167,29,93)">=</span> <span style="color:rgb(0,134,179)">2
<br></span></td></tr></tbody></table><div>and added the </div><div><br></div><div><span style="color:rgb(167,29,93);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">def</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap;background-color:rgb(248,238,199)"> </span><span style="color:rgb(121,93,163);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">upgradeToVersion2</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap;background-color:rgb(248,238,199)">(</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">self</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap;background-color:rgb(248,238,199)">):</span><br></div><div><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">        </span><span style="color:rgb(237,106,67);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">self</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">.content_type </span><span style="color:rgb(167,29,93);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">=</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap"> </span><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap"><span>'</span><span>'</span></span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap;background-color:rgb(248,238,199)"><br></span></div><div><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap"><span><span style="color:rgb(51,51,51);line-height:16.8px">        </span><span style="color:rgb(237,106,67);line-height:16.8px">self</span><span style="color:rgb(51,51,51);line-height:16.8px">.wasUpgraded </span><span style="color:rgb(167,29,93);line-height:16.8px">=</span><span style="color:rgb(51,51,51);line-height:16.8px"> </span><span style="color:rgb(0,134,179);line-height:16.8px">True</span><br></span></span></div><div><span style="color:rgb(24,54,145);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap"><span><span style="color:rgb(0,134,179);line-height:16.8px"><br></span></span></span></div><div><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap"><span><span style="line-height:16.8px"><div style="font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal">But we got an error if we want to run buildbot on a different branch that uses <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;line-height:18.2px">persistenceVersion </span><span style="color:rgb(167,29,93);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;line-height:18.2px">=</span><span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;line-height:18.2px"> </span><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;line-height:18.2px"><font color="#0086b3">1</font></span></div><div style="font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal"><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;line-height:18.2px"><font color="#0086b3"><br></font></span></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal"><span style="color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)">the exception is thrown from this library</span><span style="display:block;min-height:0.5rem;color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)"><i style="display:inline-block;vertical-align:baseline;min-height:0px;font-size:0px;color:transparent;float:left;background-repeat:no-repeat"><br></i></span><span style="color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)">twisted/persisted/styles.py:400 in versionUpgrade </span><br style="color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)"><span style="color:rgb(44,45,48);font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px;line-height:22px;background-color:rgb(249,249,249)">assert persistVers <=  currentVers, "Sorry, can't go backwards in time."</span><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal">Do you know how this should be handled?, it looks like we are missing/not handle something?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal">Thanks!</div><span class="HOEnZb"><font color="#888888"><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal">Maria</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;line-height:normal;white-space:normal"><br></div></font></span></span></span></span></div></div>
<br>_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@buildbot.net">devel@buildbot.net</a><br>
<a href="https://lists.buildbot.net/mailman/listinfo/devel" rel="noreferrer" target="_blank">https://lists.buildbot.net/mailman/listinfo/devel</a><br></blockquote></div><br></div>