python-2to3 Questions

1

Solved

I have a script that can re-write a Python module so that all occurrences of func(a) are transfored to func2(a is None). I now want to support also func(a, msg) becoming func2(a is None, msg), but ...
Strait asked 3/2, 2016 at 5:27

2

Solved

I'm trying to write some code to put data into a pipe, and I'd like the solution to be python 2.6+ and 3.x compatible. Example: from __future__ import print_function import subprocess import sys ...
Cahill asked 11/5, 2011 at 14:26

5

Solved

I'm using Python 3. I've just installed a Python IDE and I am curious about the following code warning: features = { ... } for k, v in features.items(): print("%s=%s" % (k, v)) Warning is: "For...
Jeffreyjeffreys asked 17/7, 2013 at 9:0

4

Solved

I'm looking at an output from 2to3 that includes this change: - for file_prefix in output.keys(): + for file_prefix in list(output.keys()): where output is a dictionary. What is the significanc...
Secretary asked 15/12, 2014 at 1:13

1

2to3 is a Python program that reads Python 2.x source code and applies a series of fixers to transform it into valid Python 3.x code Consider the forty fixers listed at https://docs.python.org/3/...
Wintertide asked 6/10, 2014 at 19:49

1

I'm writing python2 code that will be be portable for python3 as well (by running 2to3 during user installation). But 2to3 sometimes makes multiple imports: -import urlparse -import urllib -impor...
Twink asked 1/2, 2014 at 13:42

1

Solved

I have a bunch of modules written in python 2.x and I need them to be in 3.x for them to work. I ran 2to3 on the entire folder, and it seemed to work fine, but when I looked at the files again they...
Ogata asked 15/1, 2013 at 17:29

7

Solved

I'm sure this is a subject that's on most python developers' minds considering that Python 3 is coming out soon. Some questions to get us going in the right direction: Will you have a python 2 an...
Brinn asked 5/10, 2008 at 17:8

1

Solved

I have a setup.py that needs to support both Python 2 and 3. The code currently works and is installable in Python 2.x If I add the use_2to3 = True clause to my setup.py, then the module can be i...
Moeller asked 1/6, 2012 at 16:2

1

Solved

After converting to Python 3.x using 2to3 (see my previous question), I get this error during the build: File "setup.py", line 28, in <module> from . import mof_compiler ValueError: Attemp...
Driftage asked 31/3, 2011 at 9:46

© 2022 - 2024 — McMap. All rights reserved.