Bug 71822 - TypeError: <_sre.SRE_Pattern object at 0x10326d530> is not JSON serializable
Summary: TypeError: <_sre.SRE_Pattern object at 0x10326d530> is not JSON serializable
Status: RESOLVED FIXED
Alias: None
Product: piglit
Classification: Unclassified
Component: infrastructure (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) All
: medium blocker
Assignee: Eric Anholt
QA Contact: Eric Anholt
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-11-20 06:53 UTC by Vinson Lee
Modified: 2013-11-21 21:48 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-11-20 06:53:57 UTC
$ ./piglit-run.py tests/quick.tests summary/quick -x foo
Traceback (most recent call last):
  File "./piglit-run.py", line 148, in <module>
    main()
  File "./piglit-run.py", line 118, in main
    json_writer.write_dict_item(key, value)
  File "framework/threads.py", line 36, in wrapper
    return function(self, *args, **kwargs)
  File "framework/core.py", line 177, in write_dict_item
    self.__write(value)
  File "framework/threads.py", line 36, in wrapper
    return function(self, *args, **kwargs)
  File "framework/core.py", line 146, in __write
    lines = list(self.__encoder.encode(obj).split('\n'))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 203, in encode
    chunks = list(chunks)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 425, in _iterencode
    for chunk in _iterencode_list(o, _current_indent_level):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 326, in _iterencode_list
    for chunk in chunks:
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 436, in _iterencode
    o = _default(o)
  File "framework/core.py", line 67, in default
    return json.JSONEncoder.default(self, o)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py", line 178, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <_sre.SRE_Pattern object at 0x10326d530> is not JSON serializable


0618aa38d4a8a7c82994fb28a41576da9a2cc414 is the first bad commit
commit 0618aa38d4a8a7c82994fb28a41576da9a2cc414
Author: Dylan Baker <baker.dylan.c@gmail.com>
Date:   Fri Nov 15 10:00:49 2013 -0800

    piglit-run.py: Record all attributes of Environment and restore them
    
    This causes all attributes in the Environment instance env to be dumped
    into the json and reloaded on a resume. It adds an __iter__ magic method
    to core.Environment to allow this.
    
    Reviewed by: Kenney Phillis <Kkphillisjr@gmail.com>
    Signed-off-by: Dylan Baker <baker.dylan.c@gmail.com>

:040000 040000 5c9deb08559ff50e1559f4e52d3fdcac5334c5ee 1f08411723d508c3f674a89ac666978fd6f3e3b3 M	framework
:100755 100755 b676c42b29f92ab4200051299ae67143703a48c6 75d33cebcc78de04a6714dcd83004631f20786d8 M	piglit-run.py
Comment 1 Dylan Baker 2013-11-21 00:13:49 UTC
I have sent a patch to the mailing list to address this problem.

You can get the same patch from my github here:
git@github.com:crymson/piglit.git bugfix-71822
Comment 2 Dylan Baker 2013-11-21 21:48:23 UTC
fixed in commit 8e2180a2fca

f3fd8d5 -> 8e2180a  master -> master


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.