From rzepp at aclara.com  Wed Aug 16 18:41:17 2017
From: rzepp at aclara.com (Zepp, Robert)
Date: Wed, 16 Aug 2017 22:41:17 +0000
Subject: [Python-porting] Porting Problem
Message-ID: <MWHPR17MB1679B2E76FCCEAD220F29926C4820@MWHPR17MB1679.namprd17.prod.outlook.com>

Please,

How do I make the following line compile in 3.6 ?

batchfile = importlib.Loader.exec_module('batch_file', TestScript_fd, FullFilePath, ('.py', 'r', importlib.PY_SOURCE))

Thanks.

Robert Zepp
Senior Firmware Engineer

[https://aclara.wpengine.com/sigb/images/aclara_primary_logo.png]<http://aclara.com/>

[https://aclara.wpengine.com/sigb/images/index24_07.png]

[https://aclara.wpengine.com/sigb/images/index24_08.png]

[https://aclara.wpengine.com/sigb/images/aclara_connect_2018_logo.png]<http://go.aclara.com/aclaraconnect2018-save-the-date>

[https://aclara.wpengine.com/sigb/images/aclaraconnect_2018.png]<http://go.aclara.com/aclaraconnect2018-save-the-date>

[https://aclara.wpengine.com/sigb/images/linkedin.png]<https://www.linkedin.com/company-beta/372610/>

[https://aclara.wpengine.com/sigb/images/facebook.png]<https://www.facebook.com/aclarasolutions/?hc_ref=SEARCH&fref=nf>

[https://aclara.wpengine.com/sigb/images/twitter.png]<https://twitter.com/AclaraSolutions>

[https://aclara.wpengine.com/sigb/images/index24_14.png]



 P: 314 895 6543  C: 314 807 6600  E: rzepp at aclara.com<mailto:rzepp at aclara.com>  W: aclara.com<http://aclara.com/>   A: 945 Hornet Drive, Hazelwood MO 63042

This e-mail is intended for the addressee shown. Should you have received it in error, please delete this message and contact the sender. This e-mail and any attachments thereto may contain information that is privileged, confidential or proprietary. Any review, dissemination or use of this transmission or its contents by persons other than the addressee or authorized employees of the intended organizations is strictly prohibited.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3206 bytes
Desc: image001.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1087 bytes
Desc: image002.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1050 bytes
Desc: image003.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 4011 bytes
Desc: image004.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 4163 bytes
Desc: image005.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1758 bytes
Desc: image006.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1685 bytes
Desc: image007.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 1748 bytes
Desc: image008.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 1086 bytes
Desc: image009.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 1467 bytes
Desc: image010.png
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170816/ddd4fc89/attachment-0019.png>

From regebro at gmail.com  Wed Aug 23 09:20:31 2017
From: regebro at gmail.com (Lennart Regebro)
Date: Wed, 23 Aug 2017 15:20:31 +0200
Subject: [Python-porting] Porting Problem
In-Reply-To: <MWHPR17MB1679B2E76FCCEAD220F29926C4820@MWHPR17MB1679.namprd17.prod.outlook.com>
References: <MWHPR17MB1679B2E76FCCEAD220F29926C4820@MWHPR17MB1679.namprd17.prod.outlook.com>
Message-ID: <CAL0kPAUMScpZUcpop0Ymzz-v+AThBk00QVTR66aSp6AJo4n0uw@mail.gmail.com>

What is it supposed to do, and what is the error message you get?

On Thu, Aug 17, 2017 at 12:41 AM, Zepp, Robert <rzepp at aclara.com> wrote:

> Please,
>
>
>
> How do I make the following line compile in 3.6 ?
>
> batchfile = importlib.Loader.exec_module(*'batch_file'*, TestScript_fd,
> FullFilePath, (*'.py'*, *'r'*, importlib.PY_SOURCE))
>
>
>
> Thanks.
>
>
>
> Robert Zepp
>
> Senior Firmware Engineer
>
> [image: https://aclara.wpengine.com/sigb/images/aclara_primary_logo.png]
> <http://aclara.com/>
>
> [image: https://aclara.wpengine.com/sigb/images/index24_07.png]
>
> [image: https://aclara.wpengine.com/sigb/images/index24_08.png]
>
> [image:
> https://aclara.wpengine.com/sigb/images/aclara_connect_2018_logo.png]
> <http://go.aclara.com/aclaraconnect2018-save-the-date>
>
> [image: https://aclara.wpengine.com/sigb/images/aclaraconnect_2018.png]
> <http://go.aclara.com/aclaraconnect2018-save-the-date>
>
> [image: https://aclara.wpengine.com/sigb/images/linkedin.png]
> <https://www.linkedin.com/company-beta/372610/>
>
> [image: https://aclara.wpengine.com/sigb/images/facebook.png]
> <https://www.facebook.com/aclarasolutions/?hc_ref=SEARCH&fref=nf>
>
> [image: https://aclara.wpengine.com/sigb/images/twitter.png]
> <https://twitter.com/AclaraSolutions>
>
> [image: https://aclara.wpengine.com/sigb/images/index24_14.png]
>
> [image: https://aclara.wpengine.com/sigb/images/index24_15.png]
>
>  P: 314 895 6543  C: 314 807 6600  E: rzepp at aclara.com  W: aclara.com   A:
>  945 Hornet Drive, Hazelwood MO 63042
>
>
>
> This e-mail is intended for the addressee shown. Should you have received
> it in error, please delete this message and contact the sender. This e-mail
> and any attachments thereto may contain information that is
> privileged, confidential or proprietary. Any review, dissemination or use
> of this transmission or its contents by persons other than the addressee or
> authorized employees of the intended organizations is strictly prohibited.
>
>
>
>
>
> _______________________________________________
> Python-porting mailing list
> Python-porting at python.org
> https://mail.python.org/mailman/listinfo/python-porting
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 1467 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1050 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 1086 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3206 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1087 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1685 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 4163 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 1748 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 4011 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1758 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/be40c8a4/attachment-0019.png>

From brett at python.org  Wed Aug 23 11:00:42 2017
From: brett at python.org (Brett Cannon)
Date: Wed, 23 Aug 2017 15:00:42 +0000
Subject: [Python-porting] Porting Problem
In-Reply-To: <CAL0kPAUMScpZUcpop0Ymzz-v+AThBk00QVTR66aSp6AJo4n0uw@mail.gmail.com>
References: <MWHPR17MB1679B2E76FCCEAD220F29926C4820@MWHPR17MB1679.namprd17.prod.outlook.com>
 <CAL0kPAUMScpZUcpop0Ymzz-v+AThBk00QVTR66aSp6AJo4n0uw@mail.gmail.com>
Message-ID: <CAP1=2W4Na3n5Mb5QYP69pFN1QUbjQQcT24HASQ+1L6TNwnMXkA@mail.gmail.com>

I see two problems. One I don't know quite what this has to do with porting
code to Python 3 since loaders are not defined in importlib in Python 2.7.

Two, there is no importlib.Loader. There is
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.exec_module
and some implementations of it in importlib, but your call signature
doesn't match any of them.

On Wed, Aug 23, 2017, 07:01 Lennart Regebro <regebro at gmail.com> wrote:

> What is it supposed to do, and what is the error message you get?
>
> On Thu, Aug 17, 2017 at 12:41 AM, Zepp, Robert <rzepp at aclara.com> wrote:
>
>> Please,
>>
>>
>>
>> How do I make the following line compile in 3.6 ?
>>
>> batchfile = importlib.Loader.exec_module(*'batch_file'*, TestScript_fd,
>> FullFilePath, (*'.py'*, *'r'*, importlib.PY_SOURCE))
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Robert Zepp
>>
>> Senior Firmware Engineer
>>
>> [image: https://aclara.wpengine.com/sigb/images/aclara_primary_logo.png]
>> <http://aclara.com/>
>>
>> [image: https://aclara.wpengine.com/sigb/images/index24_07.png]
>>
>> [image: https://aclara.wpengine.com/sigb/images/index24_08.png]
>>
>> [image:
>> https://aclara.wpengine.com/sigb/images/aclara_connect_2018_logo.png]
>> <http://go.aclara.com/aclaraconnect2018-save-the-date>
>>
>> [image: https://aclara.wpengine.com/sigb/images/aclaraconnect_2018.png]
>> <http://go.aclara.com/aclaraconnect2018-save-the-date>
>>
>> [image: https://aclara.wpengine.com/sigb/images/linkedin.png]
>> <https://www.linkedin.com/company-beta/372610/>
>>
>> [image: https://aclara.wpengine.com/sigb/images/facebook.png]
>> <https://www.facebook.com/aclarasolutions/?hc_ref=SEARCH&fref=nf>
>>
>> [image: https://aclara.wpengine.com/sigb/images/twitter.png]
>> <https://twitter.com/AclaraSolutions>
>>
>> [image: https://aclara.wpengine.com/sigb/images/index24_14.png]
>>
>> [image: https://aclara.wpengine.com/sigb/images/index24_15.png]
>>
>>  P: 314 895 6543  C: 314 807 6600  E: rzepp at aclara.com  W: aclara.com
>> A: 945 Hornet Drive, Hazelwood MO 63042
>>
>>
>>
>> This e-mail is intended for the addressee shown. Should you have
>> received it in error, please delete this message and contact the sender.
>> This e-mail and any attachments thereto may contain information that is
>> privileged, confidential or proprietary. Any review, dissemination or use
>> of this transmission or its contents by persons other than the addressee or
>> authorized employees of the intended organizations is strictly prohibited.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Python-porting mailing list
>> Python-porting at python.org
>> https://mail.python.org/mailman/listinfo/python-porting
>>
>>
> _______________________________________________
> Python-porting mailing list
> Python-porting at python.org
> https://mail.python.org/mailman/listinfo/python-porting
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.png
Type: image/png
Size: 1748 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.png
Type: image/png
Size: 1086 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1087 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1758 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3206 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 4011 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1050 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1685 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 4163 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 1467 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-porting/attachments/20170823/68722c92/attachment-0019.png>