Re: [openstack-dev] [Solum] Unicode strings in Python3
On Wed, Dec 04 2013, Georgy Okrokvertskhov wrote: Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Not that it's advised, but you can use u' ' back again with Python 3.3. -- Julien Danjou ;; Free Software hacker ; independent consultant ;; http://julien.danjou.info signature.asc Description: PGP signature ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
On Thu, Dec 5, 2013 at 3:26 AM, Julien Danjou jul...@danjou.info wrote: On Wed, Dec 04 2013, Georgy Okrokvertskhov wrote: Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Not that it's advised, but you can use u' ' back again with Python 3.3. And this is a very useful feature for projects that want to have a single codebase that runs on both python 2 and python 3, so it's worth taking advantage of. -- IRC: radix Christopher Armstrong Rackspace ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
On Thu, Dec 5, 2013 at 8:32 AM, Christopher Armstrong chris.armstr...@rackspace.com wrote: On Thu, Dec 5, 2013 at 3:26 AM, Julien Danjou jul...@danjou.info wrote: On Wed, Dec 04 2013, Georgy Okrokvertskhov wrote: Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Not that it's advised, but you can use u' ' back again with Python 3.3. And this is a very useful feature for projects that want to have a single codebase that runs on both python 2 and python 3, so it's worth taking advantage of. You are right. PEP 414 introduces u literals in Python3.3. Unicode() function still does not work and should be avoided in the code, though. -- IRC: radix Christopher Armstrong Rackspace -- Georgy Okrokvertskhov Technical Program Manager, Cloud and Infrastructure Services, Mirantis http://www.mirantis.com Tel. +1 650 963 9828 Mob. +1 650 996 3284 ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
On 05.12.2013 20:42, Georgy Okrokvertskhov wrote: On Thu, Dec 5, 2013 at 8:32 AM, Christopher Armstrong chris.armstr...@rackspace.com wrote: On Thu, Dec 5, 2013 at 3:26 AM, Julien Danjou jul...@danjou.info wrote: On Wed, Dec 04 2013, Georgy Okrokvertskhov wrote: Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Not that it's advised, but you can use u' ' back again with Python 3.3. And this is a very useful feature for projects that want to have a single codebase that runs on both python 2 and python 3, so it's worth taking advantage of. You are right. PEP 414 introduces u literals in Python3.3. Unicode() function still does not work and should be avoided in the code, though. Also let me remind that there is always six.text_type for those who really need it. -- WBR, Ivan A. Melnikov ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [Solum] Unicode strings in Python3
Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
Am I interpreting this to mean that WSME is calling unicode()? On Dec 4, 2013, at 1:32 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.commailto:gokrokvertsk...@mirantis.com wrote: Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
No, This is Solum code: https://github.com/stackforge/solum/blob/master/solum/api/controllers/v1/assembly.py#L59 Thanks Georgy On Wed, Dec 4, 2013 at 1:41 PM, Adrian Otto adrian.o...@rackspace.comwrote: Am I interpreting this to mean that WSME is calling unicode()? On Dec 4, 2013, at 1:32 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.com wrote: Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev -- Georgy Okrokvertskhov Technical Program Manager, Cloud and Infrastructure Services, Mirantis http://www.mirantis.com Tel. +1 650 963 9828 Mob. +1 650 996 3284 ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
I don't think so. It looks like ./solum/api/controllers/v1/assembly.py is calling unicode(). It will need to be changed to six.text_type() for Python 3 compat. -Ben On 2013-12-04 15:41, Adrian Otto wrote: Am I interpreting this to mean that WSME is calling unicode()? On Dec 4, 2013, at 1:32 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.com wrote: Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html [1] Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev [2] Links: -- [1] http://docs.python.org/3.0/whatsnew/3.0.html [2] http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
I opened a bug https://bugs.launchpad.net/solum/+bug/1257929 for that issue. Ben, thank you for a quick fix proposal. Thanks Georgy On Wed, Dec 4, 2013 at 1:41 PM, Ben Nemec openst...@nemebean.com wrote: I don't think so. It looks like ./solum/api/controllers/v1/assembly.py is calling unicode(). It will need to be changed to six.text_type() for Python 3 compat. -Ben On 2013-12-04 15:41, Adrian Otto wrote: Am I interpreting this to mean that WSME is calling unicode()? On Dec 4, 2013, at 1:32 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.com wrote: Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing listOpenStack-dev@lists.openstack.orghttp://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev -- Georgy Okrokvertskhov Technical Program Manager, Cloud and Infrastructure Services, Mirantis http://www.mirantis.com Tel. +1 650 963 9828 Mob. +1 650 996 3284 ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Solum] Unicode strings in Python3
Gregory and Ben, Awesome, thanks!! Adrian On Dec 4, 2013, at 2:01 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.commailto:gokrokvertsk...@mirantis.com wrote: I opened a bug https://bugs.launchpad.net/solum/+bug/1257929 for that issue. Ben, thank you for a quick fix proposal. Thanks Georgy On Wed, Dec 4, 2013 at 1:41 PM, Ben Nemec openst...@nemebean.commailto:openst...@nemebean.com wrote: I don't think so. It looks like ./solum/api/controllers/v1/assembly.py is calling unicode(). It will need to be changed to six.text_type() for Python 3 compat. -Ben On 2013-12-04 15:41, Adrian Otto wrote: Am I interpreting this to mean that WSME is calling unicode()? On Dec 4, 2013, at 1:32 PM, Georgy Okrokvertskhov gokrokvertsk...@mirantis.commailto:gokrokvertsk...@mirantis.com wrote: Hi, I am working on unit tests for Solum as a side effect of new unit tests I found that we use unicode strings in the way which is not compatible with python3. Here is an exception form python3 gate: Server-side error: global name 'unicode' is not defined. Detail: 2013-12-04 Traceback (most recent call last): File /home/jenkins/workspace/gate-solum-python33/.tox/py33/lib/python3.3/site-packages/wsmeext/pecan.py result = f(self, *args, **kwargs) File ./solum/api/controllers/v1/assembly.py, line 59, in get raise wsme.exc.ClientSideError(unicode(error)) NameError: global name 'unicode' is not defined Here is a documentation for python3: http://docs.python.org/3.0/whatsnew/3.0.html Quick summary: you can't use unicode() function and u' ' strings in Pyhton3. Thanks Georgy ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev -- Georgy Okrokvertskhov Technical Program Manager, Cloud and Infrastructure Services, Mirantis http://www.mirantis.comhttp://www.mirantis.com/ Tel. +1 650 963 9828 Mob. +1 650 996 3284 ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev