neutron.tests.unit.test_wsgi.JSONDictSerializerTest.test_json_with_utf8

Bug #1491824 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Cedric Brandily

Bug Description

neutron.tests.unit.test_wsgi.JSONDictSerializerTest.test_json_with_utf8 is not py3K compliant

Changed in neutron:
assignee: nobody → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/219389
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ef409d9da2ecbf12f9916a9a933231146538cf04
Submitter: Jenkins
Branch: master

commit ef409d9da2ecbf12f9916a9a933231146538cf04
Author: Ihar Hrachyshka <email address hidden>
Date: Tue Sep 1 21:45:55 2015 +0200

    Enable most unit tests for py34 job

    * Skip TestWSGIServerWithSSL[1] for Python 3 since it seems wsgi + ssl +
      eventlet setup does not behave correctly now,
    * Skip test_json_with_utf8[2] until we solve unicode/utf8 encode/decode,
    * Fix some more tests to pass for py3,
    * Replace print by print() in docs/docstrings.

    [1] neutron.tests.unit.test_wsgi (bug 1482633)
    [2] neutron.tests.unit.test_wsgi.JSONDictSerializerTest (bug 1491824)

    Related-Bug: #1482633
    Related-Bug: #1491824
    Blueprint: neutron-python3
    Co-Authored-By: Cyril Roelandt <email address hidden>
    Co-Authored-By: Cedric Brandily <email address hidden>
    Co-Authored-By: sonu.kumar <email address hidden>
    Change-Id: I26e513d4dcf473f4cd79728382fc94af3d901b5d

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (feature/pecan)

Related fix proposed to branch: feature/pecan
Review: https://review.openstack.org/224334

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: feature/pecan
Review: https://review.openstack.org/224357

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (feature/pecan)
Download full text (73.6 KiB)

Reviewed: https://review.openstack.org/224357
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fdc3431ccd219accf6a795079d9b67b8656eed8e
Submitter: Jenkins
Branch: feature/pecan

commit fe236bdaadb949661a0bfb9b62ddbe432b4cf5f1
Author: Miguel Angel Ajo <email address hidden>
Date: Thu Sep 3 15:40:12 2015 +0200

    No network devices on network attached qos policies

    Network devices, like internal router legs, or dhcp ports
    should not be affected by bandwidth limiting rules.

    This patch disables application of network attached policies
    to network/neutron owned ports.

    Closes-bug: #1486039
    DocImpact

    Change-Id: I75d80227f1e6c4b3f5fa7762b8dc3b0c0f1abd46

commit db4a06f7caa20a4c7879b58b20e95b223ed8eeaf
Author: Ken'ichi Ohmichi <email address hidden>
Date: Wed Sep 16 10:04:32 2015 +0000

    Use tempest-lib's token_client

    Now tempest-lib provides token_client modules as library and the
    interface is stable. So neutron repogitory doesn't need to contain
    these modules.
    This patch makes neutron use tempest-lib's token_client and removes
    the own modules for the maintenance.

    Change-Id: Ieff7eb003f6e8257d83368dbc80e332aa66a156c

commit 78aed58edbe6eb8a71339c7add491fe9de9a0546
Author: Jakub Libosvar <email address hidden>
Date: Thu Aug 13 09:08:20 2015 +0000

    Fix establishing UDP connection

    Previously, in establish_connection() for UDP protocol data were sent
    but never read on peer socket. That lead to successful read on peer side
    if this connection was filtered. Having constant testing string masked
    this issue as we can't distinguish to which test of connectivity data
    belong.

    This patch makes unique data string per test_connectivity() and
    also makes establish_connection() to create an ASSURED entry in
    conntrack table. Finally, in last test after firewall filter was
    removed, connection is re-established in order to avoid troubles with
    terminated processes or TCP continuing sending packets which weren't
    successfully delivered.

    Closes-Bug: 1478847
    Change-Id: I2920d587d8df8d96dc1c752c28f48ba495f3cf0f

commit e6292fcdd6262434a7b713ad8802db6bc8a6d3dc
Author: YAMAMOTO Takashi <email address hidden>
Date: Wed Sep 16 13:20:51 2015 +0900

    ovsdb: Fix a few docstring

    Change-Id: I53e1e21655b28fe5da60e58aeeb7cbbd103ae014

commit c22949a4449d96a67caa616290cf76b67b182917
Author: fumihiko kakuma <email address hidden>
Date: Wed Sep 16 11:52:59 2015 +0900

    Remove requirements.txt for the ofagent mechanism driver

    It is no longer used.

    Related-Blueprint: core-vendor-decomposition
    https://blueprints.launchpad.net/neutron/+spec/core-vendor-decomposition

    Change-Id: Ib31fb3febf8968e50d86dd66e1e6e1ea2313f8ac

commit d1d4de19d85f961d388c91e70f31b3bafec418c5
Author: Kevin Benton <email address hidden>
Date: Thu Sep 3 20:25:57 2015 -0700

    Always return iterables in L3 get_candidates

    The caller of this function expects iterables.

    Closes-Bug: #1494996
    Change-Id: I3d103e63f4e127a77268502415c0ddb0d804b54a

commit 1ad6ac448067306...

tags: added: in-feature-pecan
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (feature/pecan)

Change abandoned by Doug Wiegley (<email address hidden>) on branch: feature/pecan
Review: https://review.openstack.org/224334

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

So, Victor Stinner (haypo) and I took a look at this bug, and maybe it is invalid, and the test should just be skipped in Python 3.

Writing '\xe7\xbd\x91\xe7\xbb\x9c' without the 'b' prefix does not really make sense in Python 3, so maybe this test should only validate the behaviour on Python 3.

WDYT?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/233652

Changed in neutron:
assignee: Cedric Brandily (cbrandily) → Cyril Roelandt (cyril-roelandt)
status: New → In Progress
Changed in neutron:
assignee: Cyril Roelandt (cyril-roelandt) → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/233652
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cfc87662cc87e51e96251383a9776343f99a5b3a
Submitter: Jenkins
Branch: master

commit cfc87662cc87e51e96251383a9776343f99a5b3a
Author: Cyril Roelandt <email address hidden>
Date: Mon Oct 12 16:07:54 2015 +0200

    Python 3: skip test_json_with_utf8 on Py3

    The last skipped unit test should indeed be skipped: it does not make
    sense to run it with Python 3.

    $ python 2
    >>> import json; json.dumps({'a': u'\xe9'.encode('utf-8')})
    '{"a": "\\u00e9"}'

    $ python3
    >>> import json; json.dumps({'a': u'\xe9'.encode('utf-8')})
    Traceback (most recent call last):
      ...
      File "/usr/lib64/python3.4/json/encoder.py", line 173, in default
        raise TypeError(repr(o) + " is not JSON serializable")
    TypeError: b'\xc3\xa9' is not JSON serializable

    In Python 2, the JSON encoder function to encode a string begins with
    a magic test to convert UTF-8 encoded string to Unicode:

        if isinstance(s, str) and HAS_UTF8.search(s) is not None:
            s = s.decode('utf-8')

    https://hg.python.org/cpython/file/4188cd5dc0c5/Lib/json/encoder.py#l42

    This trick is gone in Python 3:

    https://hg.python.org/cpython/file/288953a787ce/Lib/json/encoder.py#l49

    Change-Id: Iddaaea4ebedf04c87f1ff9f9098163a15ffa78f7
    Blueprint: neutron-python3
    Closes-Bug: #1491824

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0b1

This issue was fixed in the openstack/neutron 8.0.0.0b1 development milestone.

Changed in neutron:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.