magnuma3 opened a new pull request, #1400:
URL: https://github.com/apache/bigtop/pull/1400

   
   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/BIGTOP/How+to+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 
'BIGTOP-3638: Your PR title ...'.
   -->
   
   ### Description of PR
   
   Running "distro-select set all <version>" fails on Python 3:
   
   ```
   $ sudo ./distro-select set all 3.6.0
   Traceback (most recent call last):
     File "/usr/lib/bigtop-select/./distro-select", line 364, in <module>
       createCommandSymlinks(pkgs, options.rpm_mode)
     File "/usr/lib/bigtop-select/./distro-select", line 260, in 
createCommandSymlinks
       work_packages = copy.copy(packages)
     File "/usr/lib64/python3.9/copy.py", line 92, in copy
       rv = reductor(4)
   TypeError: cannot pickle 'dict_keys' object
   ```
   
   The "packages" argument is a dict_keys view (from dict.keys()). On Python 2 
this was a list, so copy.copy() worked, but on Python 3 dict views are not 
copyable via copy.copy() and the fallback pickle path fails.
   
   Fix: convert the view to a list, e.g.
   
   ```
   work_packages = list(packages)
   ```
   
   Environment: Python 3.9 (EL9), Bigtop 3.7.0-SNAPSHOT.
   
   
   ### How was this patch tested?
   
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id 
(e.g. 'BIGTOP-3638. Your PR title ...')?
   - [ ] Make sure that newly added files do not have any licensing issues. 
When in doubt refer to https://www.apache.org/licenses/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to