[pycrypto] Pycrypto working with python 3.0 or 3.1

Grail Dane grail69 at hotmail.com
Tue Mar 16 23:09:52 CST 2010


Hi Christoph
Yes I am running into this issue as well. Another similar one is where2to3 suggests the following change:
from common import make_block_tests
to
from .common import make_block_tests 
In case hard top see the change is to add a full-stop at the start of common which makes thisa relative path reference. The error I get after making this change is:
ValueError: Attempted relative import in non-package
So I am trying to get this working as well. Let me know how you go?
CheersGrail

> Date: Mon, 15 Mar 2010 21:41:05 +0100
> From: christoph.tapler at gmx.net
> To: pycrypto at lists.dlitz.net
> Subject: Re: [pycrypto] Pycrypto working with python 3.0 or 3.1
> 
> Hi,
> 
> I could find the relevant change documented in 
> http://docs.python.org/py3k/whatsnew/3.0.html , "Removed Syntax" section.
> Using "from . import X"  instead of "import X" should fix the issue.
> I will try to adapt the Test Suite asap.
> 
> Cheers,
> Christoph
> 
> 
> On 15.03.2010 02:10, Dwayne C. Litzenberger wrote:
> > Are absolute imports standard in Python 3?
> >
> >       http://www.python.org/dev/peps/pep-0328/
> >
> > On Sun, Mar 14, 2010 at 04:11:58PM +0100, Christoph Tapler wrote:
> >> Hi Grail,
> >>
> >> I have tried to fix the test suite, but I came across a problem,
> >> which seems to be specific to Python 3. It seems to me that Python 3
> >> behaves differently in terms of hierarchical imports.
> >>
> >> To demonstrate this difference, I have attached a small example (just
> >> start level_test.py in Python 2 / 3). If you execute this example in
> >> Python 2, everything works fine. However, in Python 3, the second
> >> (nested) import fails. I don't understand why.
> >>
> >> Do you (or anybody else of course ;-) ) have an idea how this issue
> >> could be resolved? Btw, this pattern appears several times in the test
> >> suite.
> >>
> >> Kind Regards,
> >> Christoph
> >>
> >> On 04.03.2010 03:37, Grail Dane wrote:
> >>> Hi Christoph
> >>>
> >>> Good to see this is coming together for you, and as one of the users
> >>> mentions,
> >>> using the unified option is a general rule of thumb for patches / diffs.
> >>>
> >>> You are correct about the test suite as I have not had a chance to alter
> >>> the tests to Python 3 context.
> >>>
> >>> Cheers
> >>> Grail
> >>>
> >>> ------------------------------------------------------------------------
> >>> Date: Wed, 3 Mar 2010 21:58:09 +0100
> >>> From: christoph.tapler at gmx.net
> >>> To: pycrypto at lists.dlitz.net
> >>> Subject: Re: [pycrypto] Pycrypto working with python 3.0 or 3.1
> >>>
> >>> Hi Grail,
> >>>
> >>> I have applied your patch on my Windows machine. Your AES encryption /
> >>> decryption seems to work well - In case
> >>> AZCkZ1wU5d0psrwlaoS5R4tz1dRL6rBBNzjIvK9NHSo= is the result ;-)
> >>> Moreover, I have tried the diff tool. Not sure if the output is usable
> >>> for you. Just
> >>> let me know if this format is okay or not. The patch contains a few
> >>> rather trivial
> >>> fixes for the Windows environment. With those fixes the build is successful.
> >>> However, the test suite doesn't build, needs adaptions as well (but I
> >>> think only
> >>> in Python).
> >>>
> >>> Cheers,
> >>> Christoph
> >>>
> >>> On 03.03.2010 03:48, Grail Dane wrote:
> >>>
> >>>      OK ... OK ... OK - stop the presses
> >>>
> >>>      Well, maybe not just yet, anyhoo, the attached patch allows the
> >>>      source to compile
> >>>      and run the attached script<woohoo>
> >>>
> >>>      Cheers
> >>>      Grail
> >>>
> >>>      ------------------------------------------------------------------------
> >>>      Meet local singles online. Browse profiles for FREE!
> >>>      <http://clk.atdmt.com/NMN/go/150855801/direct/01/>
> >>>
> >>>
> >>>      _______________________________________________
> >>>      pycrypto mailing list
> >>>      pycrypto at lists.dlitz.net<mailto:pycrypto at lists.dlitz.net>
> >>>      http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
> >>>
> >>>
> >>>
> >>>
> >>> ------------------------------------------------------------------------
> >>> Find out now. Link all your email accounts and social updates with
> >>> Hotmail.<http://windowslive.ninemsn.com.au/oneinbox?ocid=T162MSN05A0710G>
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> pycrypto mailing list
> >>> pycrypto at lists.dlitz.net
> >>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
> >>
> >
> >
> >> _______________________________________________
> >> pycrypto mailing list
> >> pycrypto at lists.dlitz.net
> >> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
> >
> >
> 
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
 		 	   		  
_________________________________________________________________
Looking for a new home? With all the latest places, searching has never been easier.
http://clk.atdmt.com/NMN/go/157631292/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dlitz.net/pipermail/pycrypto/attachments/20100317/6a12b5a0/attachment.htm 


More information about the pycrypto mailing list