Message ID | 20140917151302.08303544@grp-cvubrugier |
---|---|
State | Superseded |
Headers | show |
Dear Christophe Vu-Brugier, On Wed, 17 Sep 2014 15:13:02 +0200, Christophe Vu-Brugier wrote: > Thank you for the prompt review. You're welcome. Thanks for submitting those packages in the first place! > > Is it for this package that you had the Python 3 issue? Could you > > explain a bit more the 2to3 problems you have seen? > > It is for this package (and for configshell-fb and targetcli-fb) that I > thought I had an issue with `2to3`. > But I was wrong because it seems that `2to3` is correctly invoked by > setup.py when it is run under Python 3. > The installed python files are different from the source python files > and are modified by `2to3`: > > --- build/python-rtslib-fb-v2.1.fb49/rtslib/utils.py > +++ target/usr/lib/python3.4/site-packages/rtslib/utils.py > @@ -435,14 +435,14 @@ > raise > > def set_attributes(obj, attr_dict, err_func): > - for name, value in attr_dict.iteritems(): > + for name, value in attr_dict.items(): > > So if there is an issue, it is not caused by a broken `2to3`. Indeed, this modification looks like a Python 2 vs. Python 3 conversion, even though I'm not familiar enough with the Python language changes to be sure. What was the issue you had with Python 3 ? Thomas
Hi Thomas,
On Wed, 17 Sep 2014 15:15:52 +0200, Thomas Petazzoni wrote :
> What was the issue you had with Python 3 ?
The only "issue" I face at the moment is with pyparsing. I get an
ImportError when I try to import this module from Python 3. I think the
module is correctly installed: I compared the installation in Buildroot
and in a virtualenv and the only difference I see is that a
"pyparsing.py" file is installed in "site-packages/" in my virtualenv.
It is expected since BR2_PACKAGE_PYTHON3_PYC_ONLY is selected. If I
select BR2_PACKAGE_PYTHON3_PY_PYC instead, then importing the pyparsing
module works.
I don't know how to properly fix this. What would you suggest?
Best regards,
--
Christophe Vu-Brugier
Dear Christophe Vu-Brugier, On Wed, 17 Sep 2014 17:21:11 +0200, Christophe Vu-Brugier wrote: > The only "issue" I face at the moment is with pyparsing. I get an > ImportError when I try to import this module from Python 3. I think the > module is correctly installed: I compared the installation in Buildroot > and in a virtualenv and the only difference I see is that a > "pyparsing.py" file is installed in "site-packages/" in my virtualenv. > > It is expected since BR2_PACKAGE_PYTHON3_PYC_ONLY is selected. If I > select BR2_PACKAGE_PYTHON3_PY_PYC instead, then importing the pyparsing > module works. > > I don't know how to properly fix this. What would you suggest? Aah, yes, sorry, not your fault. There is an issue with Python 3 and external modules in the BR2_PACKAGE_PYTHON3_PYC_ONLY case, caused by PEP 3147. There is a patch pending at http://patchwork.ozlabs.org/patch/373082/ to solve this, but I'm not really happy with the proposed solution, and I wanted to investigate this a bit more. Which I've started to do, but of course didn't had enough time to come to a conclusion. For the time being, either apply the patch mentioned above, or use BR2_PACKAGE_PYTHON3_PY_PYC. Sorry again :/ Thomas
--- build/python-rtslib-fb-v2.1.fb49/rtslib/utils.py +++ target/usr/lib/python3.4/site-packages/rtslib/utils.py @@ -435,14 +435,14 @@ raise def set_attributes(obj, attr_dict, err_func): - for name, value in attr_dict.iteritems(): + for name, value in attr_dict.items(): So if there is an issue, it is not caused by a broken `2to3`. > > + help > > + rtslib-fb is an object-based Python library for configuring > > + the LIO generic SCSI target, present in 3.x Linux kernel > > + versions. > > + > > + https://github.com/agrover/rtslib-fb