<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi All<div><br></div><div>So I am going to go on a limb a little and say I have successfully compiled pycrypto with python 3.1.1</div><div><br></div><div>The attached patch makes the necessary changes to remove any errors during install.</div><div>If someone would like to give me a small test script, I am happy to see if my tinkering actually works</div><div>or is just allowing it to install??</div><div><br></div><div>I am also aware that some of the changes are probably not the best way to do it, but I am happy to investigate</div><div>further once I have it working :)</div><div><br></div><div>Cheers</div><div>Grail<br><br><hr id="stopSpelling">From: grail69@hotmail.com<br>To: pycrypto@lists.dlitz.net<br>Date: Fri, 15 Jan 2010 00:32:04 +0000<br>Subject: Re: [pycrypto] python crypto with python 3.0 or 3.1<br><br>



<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</style>


Hi<div><br></div><div>Thanks for the speedy reply :)</div><div><br></div><div>I am a little confused though as the doco for 3.1 says:</div><div><br></div><div><span class="ecxApple-style-span" style="font-family:sans-serif;font-size:16px"><dt id="ecxPyVarObject"><tt class="ecxdescname" style="background-color:transparent;padding-top:0px;padding-right:1px;padding-bottom:0px;padding-left:1px;font-weight:bold"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">PyVarObject</span></font></tt><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt"><a class="ecxheaderlink" href="http://docs.python.org/3.1/c-api/structures.html?highlight=pyobject#PyVarObject" title="Permalink to this definition" style="color:rgb(198, 15, 15);text-decoration:none;visibility:hidden;padding-top:0px;padding-right:4px;padding-bottom:0px;padding-left:4px"></a></span></font></dt><dd style="margin-bottom:10px;margin-left:30px;text-align:justify;line-height:20px"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">This is an extension of&nbsp;</span></font><a title="PyObject" class="ecxreference ecxinternal" href="http://docs.python.org/3.1/c-api/structures.html?highlight=pyobject#PyObject" style="color:rgb(53, 95, 124);text-decoration:none"><tt class="ecxxref ecxdocutils ecxliteral" style="background-color:transparent;padding-top:0px;padding-right:1px;padding-bottom:0px;padding-left:1px;font-weight:bold"><span class="pre"><span class="ecxhighlight" style="background-color:rgb(251, 229, 78)"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">PyObject</span></font></span></span></tt></a><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">&nbsp;that adds the&nbsp;</span></font><a title="ob_size" class="ecxreference ecxexternal" href="http://docs.python.org/3.1/c-api/typeobj.html#ob_size" style="color:rgb(53, 95, 124);text-decoration:none"><tt class="ecxxref ecxdocutils ecxliteral" style="background-color:transparent;padding-top:0px;padding-right:1px;padding-bottom:0px;padding-left:1px;font-weight:bold"><span class="pre"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">ob_size</span></font></span></tt></a><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">&nbsp;field. This is only used for objects that have some notion of&nbsp;</span></font><em><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">length</span></font></em><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">.&nbsp;</span></font></dd><dd style="margin-bottom:10px;margin-left:30px;text-align:justify;line-height:20px"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">This type does not often appear in the Python/C API. It corresponds to the fields defined by the expansion of the&nbsp;</span></font><tt class="ecxdocutils ecxliteral" style="background-color:rgb(236, 240, 243);padding-top:0px;padding-right:1px;padding-bottom:0px;padding-left:1px"><span class="pre"><span class="ecxhighlight" style="background-color:rgb(251, 229, 78)"><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">PyObject</span></font></span><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">_VAR_HEAD</span></font></span></tt><font class="ecxApple-style-span" face="Verdana"><span class="ecxApple-style-span" style="font-size:10pt">&nbsp;macro.</span></font></dd></span>This appears to be the same as what is written in the doco for 2.6.4 as well, which pycrypto seems to work with.</div><div><br></div><div>Well i will keep looking to see what i can find out.</div><div><br></div><div>Cheers</div><div>Grail</div><div><br>&gt; Date: Thu, 14 Jan 2010 10:07:36 +0100<br>&gt; From: don@amberfisharts.com<br>&gt; To: pycrypto@lists.dlitz.net<br>&gt; Subject: Re: [pycrypto] python crypto with python 3.0 or 3.1<br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; as far as I know there hasn't been a move to port pyCrypto to python 3.x<br>&gt; so simply compiling against python 3.x is bound to fail!<br>&gt; If you try to port yourself and during that effort ran into this compiler <br>&gt; error then if you look at the documentation [1] or this blog post [2]<br>&gt; (it's<br>&gt; a bit outdated since the docs have been fixed in the meantime) you will<br>&gt; see<br>&gt; that the first few lines (besides other things) of a python extension type<br>&gt; have<br>&gt; changed from <br>&gt;  <br>&gt;   PyObject_HEAD_INIT(NULL)<br>&gt;   0,                   /* ob_size */<br>&gt;   "myTypeName",        /* tp_name */<br>&gt; <br>&gt; to<br>&gt; <br>&gt;   PyVarObject_HEAD_INIT(NULL, 0)<br>&gt;   "myTypeName",        /* tp_name */<br>&gt; <br>&gt; If I recall correctly, the ob_size has be moved to a different structure<br>&gt; and no longer<br>&gt; is a member of PyTypeObject.<br>&gt; So to sum it up:<br>&gt;  * no porting effort exist so far, AFAIK<br>&gt;  * no, the error is not bogus<br>&gt; <br>&gt; sincerely yours<br>&gt; //Lorenz<br>&gt; <br>&gt; [1] http://docs.python.org/dev/py3k/extending/newtypes.html<br>&gt; [2]<br>&gt; http://rhodesmill.org/brandon/2008/porting-a-c-extension-module-to-python-30/<br>&gt; <br>&gt; <br>&gt; <br>&gt; On Thu, 14 Jan 2010 07:52:59 +0000, Grail Dane &lt;grail69@hotmail.com&gt;<br>&gt; wrote:<br>&gt; &gt; Hi GuysI am new to the list but have recently run into this issue.Has<br>&gt; &gt; there been any movement?Personally I am stuck when gcc tries to compile<br>&gt; &gt; src/_fastmath.cwhich seems to die with an error about 'ob_size' member<br>&gt; not<br>&gt; &gt; existing :(This seems to be bogus as I traced back the struct's to<br>&gt; include<br>&gt; &gt; PyObject_VAR_HEADwhich does have this as member.Any further help on this<br>&gt; &gt; would be appreciated ;)Cheers Grail&gt;On Fri, Dec 04, 2009 at 11:44:00AM<br>&gt; &gt; +0100, Tobias Koeck wrote:&gt;&gt;Is it possible to run python crypto with<br>&gt; python<br>&gt; &gt; 3.0 or 3.1. If not is <br>&gt; &gt;&gt;&gt;it planed to adjust?<br>&gt; &gt; <br>&gt; &gt;&gt;Sure, and it'll happen sooner if somebody volunteers to do it. :-)<br>&gt; &gt; <br>&gt; &gt;&gt;There will need to be be some strategy for Python 2.x compatibility, and<br>&gt; <br>&gt; &gt;&gt;the contributor(s) need to to meet the PyCrypto Code Submission <br>&gt; &gt;&gt;Requirements:<br>&gt; &gt; <br>&gt; &gt;&gt;http://www.dlitz.net/software/pycrypto/submission-requirements/<br>&gt; &gt; <br>&gt; &gt;&gt;-- <br>&gt; &gt;&gt;Dwayne C. Litzenberger &lt;dlitz at dlitz.net&gt;<br>&gt; &gt;&gt;  Key-signing key   - 19E1 1FE8 B3CF F273 ED17  4A24 928C EC13 39C2 5CF7<br>&gt; &gt;&gt;  Annual key (2009) - C805 1746 397B 0202 2758  2821 58E0 894B 81D2 582E<br>&gt; &gt;&gt;<br>&gt; &gt; _________________________________________________________________<br>&gt; &gt; View photos of singles in your area! Browse profiles for FREE<br>&gt; &gt; http://clk.atdmt.com/NMN/go/150855801/direct/01/<br>&gt; _______________________________________________<br>&gt; pycrypto mailing list<br>&gt; pycrypto@lists.dlitz.net<br>&gt; http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto<br></div>                                               <br><hr>If It Exists, You'll Find it on SEEK <a href="http://clk.atdmt.com/NMN/go/157639755/direct/01/">Shopping Trolley Mechanic</a></div>                                               <br /><hr />Sell your old one fast! <a href='http://clk.atdmt.com/NMN/go/157637060/direct/01/' target='_new'>Time for a new car?</a></body>
</html>