<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
You know, now I remember that twice I got errors that I thought they might have been generated by the copy module, and when one of those errors triggered in one page, several other different asp.net pages started to do the same at the same time. if they came from the copy module, could that be for the dictionary implementation not being thread safe as you mentioned?<div><br></div><div>I'm not 100% if those 2 times the error came from the copy module but it was very likely. I was in production server, the copy module was called from an inner module and I got the error message from the outer module and err... I didnt know how to go down to the inner error in production server. In development I get the errors from the module where </div><div>the error is actually placed</div><div><br></div><div>Greetings, Pablo<br><div><br></div><div><br><br><hr id="stopSpelling">From: dinov@microsoft.com<br>To: users@lists.ironpython.com<br>Date: Thu, 14 Oct 2010 17:58:51 +0000<br>Subject: Re: [IronPython] expected behavior of the module copy with .net objects<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxshape
{;}
</style><style>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxMsoAcetate, .ExternalClass li.ecxMsoAcetate, .ExternalClass div.ecxMsoAcetate
{margin-bottom:.0001pt;font-size:8.0pt;font-family:'Tahoma','sans-serif';}
.ExternalClass p.ecxecxmsonormal, .ExternalClass li.ecxecxmsonormal, .ExternalClass div.ecxecxmsonormal
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxecxmsochpdefault, .ExternalClass li.ecxecxmsochpdefault, .ExternalClass div.ecxecxmsochpdefault
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink
{;}
.ExternalClass span.ecxecxmsohyperlinkfollowed
{;}
.ExternalClass span.ecxecxemailstyle18
{;}
.ExternalClass p.ecxecxmsonormal1, .ExternalClass li.ecxecxmsonormal1, .ExternalClass div.ecxecxmsonormal1
{margin-right:0in;margin-bottom:0in;margin-left:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink1
{color:blue;text-decoration:underline;}
.ExternalClass span.ecxecxmsohyperlinkfollowed1
{color:purple;text-decoration:underline;}
.ExternalClass span.ecxecxemailstyle181
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass p.ecxecxmsochpdefault1, .ExternalClass li.ecxecxmsochpdefault1, .ExternalClass div.ecxecxmsochpdefault1
{margin-right:0in;margin-left:0in;font-size:10.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxEmailStyle28
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass span.ecxBalloonTextChar
{font-family:'Tahoma','sans-serif';}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}
</style>
<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">Ahh, well if it’s ASP.NET it’s all multi-threaded because you’re probably handling more than one request at a time.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From:</span></b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com]
<b>On Behalf Of </b>Pablo Dalmazzo<br>
<b>Sent:</b> Thursday, October 14, 2010 4:49 AM<br>
<b>To:</b> IronPython Mailing list<br>
<b>Subject:</b> Re: [IronPython] expected behavior of the module copy with .net objects</span></p>
</div>
</div>
<p class="ecxMsoNormal"> </p>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">thanks for the reply Dino, If I get any additional info about it, I'll post it. </span></p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">In one application (which triggered the error you mentioned it) Im using an asp.net timer. That runs in another thread, right?</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">Greetings, Pablo</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
<div class="ecxMsoNormal" align="center" style="text-align:center"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">
<hr size="2" width="100%" align="center" id="ecxstopSpelling">
</span></div>
<p class="ecxMsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From: dinov@microsoft.com<br>
To: users@lists.ironpython.com<br>
Date: Wed, 13 Oct 2010 19:47:04 +0000<br>
Subject: Re: [IronPython] expected behavior of the module copy with .net objects</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">I think as of now copy is certainly not suitable for all .NET objects. For starters not all .NET objects are serializable/copyable. There should probably
be some effort to close the gaps where it makes sense. For example something which implements ICloneable could have a __copy__ method added to it. This is similar to how we add a __reduce_ex__ method for things which implement ISerializable. But if something
doesn’t implement either of these interfaces then there’s no standard way for us to copy these objects.</span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">If you have specific object types which you know you need to copy I would suggest registering the type with copy_reg. That should at least give you a solution
for your specific scenarios. </span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">You also mentioned the null reference exception (“object reference not set to object instance…”). That sounds like a bug – I would guess you’re running in
a multi-threaded environment? If you could get a repro of this that’d be great as it looks like it could be an issue w/ our dictionary implementation not being thread safe.</span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From:</span></b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com]
<b>On Behalf Of </b>Pablo Dalmazzo<br>
<b>Sent:</b> Wednesday, October 13, 2010 11:51 AM<br>
<b>To:</b> IronPython Mailing list<br>
<b>Subject:</b> [IronPython] expected behavior of the module copy with .net objects</span></p>
</div>
</div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">Hi guys,</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">Sorry for being annoying about this but I just want to know where I'm standing at :)</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">It would seem to me the copy module has some problems copying .net objects in general. I was wondering if I'm pretending too much for that module and it will never fully copy
objects instantiated from .net classes, or it's a goal for it to do it someday, or I just happened to find a couple of errors, or Im not using it rightly for what it was meant to be. I dont know 5% of what you know so it's an honest question :)</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">Aside there are a couple of errors I cant reproduce, and that it didnt copy System.DBNull , now I see it loses property values when copying</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">a System.Data.SqlConnection object, properties such as "DataSource", "DataBase", etc. they get empty strings after being copied. Just in case</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">I tried with the original version of the module/file copy. I guess you have thousands of things to check but I just want to know, it's the module supposed to copy any object
instantiated from .net classes or it's only supposed to fully work only for custom made classes?</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">Greetings, Pablo Dalmazzo</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">P.S: sorry about insisting again with this but I've also added another example where it seems to fail :)</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p>
</div>
</div>
</div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br>
_______________________________________________ Users mailing list <a href="mailto:Users@lists.ironpython.com">
Users@lists.ironpython.com</a> <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a></span></p>
</div>
</div>
</div>
</div>
<br>_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</div></div>                                            </body>
</html>