181 questions
0 votes
1 answer
31 views
Why will node include annotation when i use 2to3/lib2to3/fix_print.py
python file # -*- coding: utf-8 -*- print 'original python file' fix_print.py class FixPrint(fixer_base.BaseFix): BM_compatible = True PATTERN = """ ...
0 votes
1 answer
3k views
this thing i'm doing wants python 2to3. i already have that. what do i do?
I'm trying to install the package pyminifier at the command prompt, this happens: C:\Users\[my name]\Downloads\JKLMBombpartyHelper-master\JKLMBombpartyHelper-master>python -m pip install pyminifier ...
0 votes
0 answers
139 views
python 2 to 3 conversion, type instancemethod now a class method? Method no longer gets called
I am converting a large project I didn't write from python2 to python3. Most the conversion is working but some parts of our UI that applies configs does nothing. I think it is the way the method ...
0 votes
1 answer
88 views
Settings file reference is not found
I'm working on migrating an exsting Python 2.7 project to Python 3.9. I'm facing a directory structure-related issue in Python 3. My current project directory structure is: ├───project │ ├───core | ...
2 votes
2 answers
5k views
Maya script won't run in Maya 2022. `reload` is not defined
Trying to run a script that works fine in maya 2018 but wont in 2022 import gw_anim_clip reload(gw_anim_clip) gw_anim_clip.anim_clip_ui() I'm getting this error: Error: name 'reload' is not defined ...
0 votes
1 answer
33 views
File Inside Python Module Not Included (Django, Py2 to Py3 Conversion)
I am migrating a Django project from 2 to 3 and am running into an import(?) error. One of the apps/modules contains an __init__.py, admin.py, forms.py, models.py, urls.py, and view.py, but when the ...
0 votes
0 answers
72 views
Python 2 to 3, error converting a list(zip(*aList)[1])
I have a small chunk of code which not being a python guru I am not sure what it is really 'doing', but it fails under python3: if indSoundsToPlay: indSoundsToPlay = list(indSoundsToPlay) ...
1 vote
1 answer
156 views
Automatically remove leading u'...' in Python strings
I am working on migrating an old Python code base to Python3. There are many strings which have the "u" prefix. Example u'Umlaut üöö' Is there an automated way to remove the leading "u&...
0 votes
0 answers
93 views
python2 to python3 conversion cannot find imports now. Namespacing issue?
While I am able to fix this and it is not a huge issue. I am curious if I am doing something wrong or went about something wrong. I inherited a codebase that is python2 to upgrade it to python3. So ...
0 votes
0 answers
37 views
Best Practices for migrating python2 to python3 in django
It will be more helpful if you answer the following questions as well. Dealing with models.CharField. In python2, how the CharField value is stored in the database and how it is different from the ...
0 votes
0 answers
94 views
Retain Python2 dictionary iteration order in Python3
I am porting some code from python 2 to 3. data = {'direction': '->', 'src_port': 'any', 'src_ip': 'any', 'dst_port': 'any', 'dst_ip': 'any', 'action': 'alert', 'protocol': 'http'} Iterating the ...
2 votes
0 answers
314 views
Python 2 to Python 3 Conversion: Can't find __main__ module in pyz [closed]
I am working on porting a python2 project to python3 while keeping the compatibility with python2. I started fixing small things: indentation, print calls, some imports using six etc. The Makefile ...
0 votes
1 answer
157 views
2to3.6: python conversion hanging
hi I have some python code which is generated dynamically which produces python2 code and this python generated code is executed and it's output is then used by downstream application, the problem I ...
0 votes
0 answers
63 views
Can I use the 2to3 package or something similar from the python code itself to check if code works in Python 3 and upgrade it if not?
I want to be able to check if a function is compatible with Python 3 from the python code (not through a terminal). A string containing the function would be passed into the check. As far as I know I ...
0 votes
1 answer
111 views
py2 vs py3 addition output difference in float format
a = 310.97 b = 233.33 sum= 0.0 for i in [a,b]: sum += i print(sum) py2 o/p: 544.3 py3 o/p: 544.3000000000001 Any way to report py3 output as same as py2 with futurizing? without using round-off ?