#3565 closed task (fixed)
Porting Python Scripting Library to Python 3
Reported by: | annakrat | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.0 |
Component: | Python | Version: | svn-trunk |
Keywords: | gsoc2018, python3 | Cc: | |
CPU: | Unspecified | Platform: | All |
Description
This ticket is created to gather comments and patches to port this library to Python 3 as part of GSoC 2018.
Related pages:
Attachments (3)
Change History (7)
by , 7 years ago
Attachment: | patch_utils_sanjeet.diff added |
---|
by , 7 years ago
Attachment: | patch_utils_encode_decode_only_text.diff added |
---|
encode and decode functions changed to accept only text, otherwise throw error
comment:1 by , 7 years ago
I changed Sanjeet's patch to change the behavior of encode and decode functions in utils.py, so that they don't accept anything else than string or bytes with Python3. Before they could be used with int, floats and None, but it's supposed to do encoding/decoding not converting, that should be done explicitly. To not break existing code, new behavior is only with Python 3.
by , 7 years ago
Attachment: | patch_core_run_command_unicode.diff added |
---|
Hi, Here is a quick dirty patch to know if this is what you meant when you said we need to have 'encoding' parameter passed to our functions. For now, I have only added this conversion in the 'run_command()'. I am just using the encoding parameter directly from kwargs instead of passing it as a keyword argument in the functions definiton. It is being popped from the kwargs dictionary so as not to pass it to the next function in line. I thought, in the similar manner we could call the 'make_unicode()' in other functions (read_command, make_command, start_command,...) where they can make use of it if they are called directly from the scripts instead of other functions. Is this correct?
comment:2 by , 7 years ago
Actually what I meant is using the encoding parameter only for stdin, stderr and stdout, the same way as Python Popen class. The arguments are already being encoded in start_command function. BTW, if you submit a patch, it should somehow work, I can see just by looking at it that it can't work. Or call it pseudocode in that case.
comment:3 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Reported issue solved, see ongoing development in trunk.
comment:4 by , 6 years ago
Milestone: | 8.0.0 → 7.8.0 |
---|
patch for lib/python/script/utils.py and tests by Sanjeet