[
https://issues.apache.org/jira/browse/BEAM-1251?focusedWorklogId=204958&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-204958
]
ASF GitHub Bot logged work on BEAM-1251:
----------------------------------------
Author: ASF GitHub Bot
Created on: 27/Feb/19 03:46
Start Date: 27/Feb/19 03:46
Worklog Time Spent: 10m
Work Description: udim commented on pull request #7953: [BEAM-1251] Fix
Python 3 compatibility bug in pickler.py
URL: https://github.com/apache/beam/pull/7953#discussion_r260583315
##########
File path: sdks/python/apache_beam/internal/pickler.py
##########
@@ -164,7 +164,7 @@ def new_save_module_dict(pickler, obj):
obj_id = id(obj)
if not known_module_dicts or '__file__' in obj or '__package__' in obj:
if obj_id not in known_module_dicts:
- for m in sys.modules.values():
+ for m in list(sys.modules.values()):
Review comment:
Probably, though I don't understand why it sys.modules changes in this loop
(assuming no background threads). I believe that accessing `m.__dict__`
triggers a lazy loading of the module.
I tested adding an additional for-loop before the original. The first loop
iterates on list(sys.modules.value()), while the second on sys.modules.value().
The first loop conditionally accesses m.__dict__ to see which modules change
sys.modules. If the second loop succeeds, the touched modules are culprits.
I've isolated this module as a culprit:
py._vendored_packages.apipkg.ApiModule
Maybe related:
pytest has a module import hook for rewriting assertions (no need for
self.assertEqual(), etc.):
https://github.com/pytest-dev/pytest/blob/7dcd9bf5add337686ec6f2ee81b24e8424319dba/src/_pytest/assertion/rewrite.py#L277-L301
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 204958)
Time Spent: 26h 50m (was: 26h 40m)
> Python 3 Support
> ----------------
>
> Key: BEAM-1251
> URL: https://issues.apache.org/jira/browse/BEAM-1251
> Project: Beam
> Issue Type: Improvement
> Components: sdk-py-core
> Reporter: Eyad Sibai
> Assignee: Robbe
> Priority: Major
> Labels: triaged
> Time Spent: 26h 50m
> Remaining Estimate: 0h
>
> I have been trying to use google datalab with python3. As I see there are
> several packages that does not support python3 yet which google datalab
> depends on. This is one of them.
> https://github.com/GoogleCloudPlatform/DataflowPythonSDK/issues/6
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)