-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dangerous default value [] as argument in enable/enable/savage/svg/backends/kiva/renderer.py #395
Labels
ETS Backlog
Good issue for ETS team members to look at
Comments
pbrod
added a commit
to pbrod/enable
that referenced
this issue
Mar 26, 2020
…ontext.draw_image method Fixes enthought#396 Made sure rows and columns are integers by replacing "/" with "//" in kiva/agg/freetype2/src/tools/docmaker/tohtml.py Fixes enthought#400 Made the test examples run on windows and using wx: * Replaced deprecated "wx.EVT_XXX(panel, handler)" with "panel.Bind(wx.EVT_XXX, handler)" in rgba_color_editor.py * Replaced faulty "slider.SetTickFreq( 10, 1 )" with "slider.SetTickFreq(10)" in rgba_color_editor.py * Fixed the failing ToolkitEditorFactory.all_facenames method in kiva_font_editor.py * Replaced deprecated wx.PyPanel with wx.Panel * Insulated the xxxtrait.configure_traits() call inside a "if __name__ == '__main__'" block * Added the "demo = XXXtrait()" to each demo-script so it can be discovered and run by the traitsui.extra.demo.demo. * Changed "from enable.wx_backend import Window" to "from enable.api import Window" and moved all imports to the top of the file. * Replaced call to wx.SystemSettings_GetMetric with wx.SystemSettings.GetMetric * Replaced call to deprecated wx.EVT_XXXX( control, self._on_XXXX) with control.Bind(wx.EVT_ERASE_BACKGROUND, self._on_XXXXX) * Fixed a bug in BaseWindow._create_control: If parent is None it is set to wx.Frame(None) in order to avoid crash in the unittests. * Replaced wx.WXK_PRIOR and wx.WXK_NEXT (which does not exist on wxpython4) with wx.WXK_PAGEUP and wx.WXK_PAGEDOWN Fixes enthought#399 replaced: * wx.GraphicsRenderer_GetDefaultRenderer with wx.GraphicsRenderer.GetDefaultRenderer * wx.GraphicsContext_Create with wx.GraphicsContext.Create Fixed failing examples: * examples/kiva/agg/benchmark.py (Float -> float, added missing import of zeros) * examples/kiva/agg/polygon_hit_test.py (point_in_polygon -> points_in_polygon) * examples/kiva/gradient.py (added missing import of tempfile) Moved code in 'if __name___ == "__main__"' block in benchmark.py to the run_all_benchmarks function. Removed unused stuff: * Removed unused import of "FILL_STROKE" in examples/kiva/agg/compiled_path.py * Removed unused import of "affine", "constants" in examples/kiva/agg/dummy.py * Removed unused ttfdict_to_fnames function in font_manager.py * Removed unused import of "sqrt" and "affine" in enable/savage/svr/backends/kiva/renderer.py Replaced call to deprecated time.clock with time.perf_counter on Python 3 in: * examples/kiva/agg/benchmark.py * examples/kiva/agg/dash.py * examples/kiva/agg/lion.py * examples/kiva/agg/pylygon_hit_test.py * examples/kiva/agg/simple_clip.py * examples/kiva/agg/text_ex.py * examples/kiva/simple.py * examples/kiva/test_image3.py Fixes enthought#395 * Replaced dangerous default value "transforms=[]" with "transforms=None" in __init__ methods. Python style fixes.
pbrod
added a commit
to pbrod/enable
that referenced
this issue
Mar 26, 2020
…d tests to expected failure. Also removed unused import of "allclose" and "nose". Made wx.VERSION comparison more robust in enable/savage/svg/backends/wx/renderer.py and enable/wx/base_window.py. Fixes enthought#393 Added self as first argument to AbstractGraphicsContext.draw_image method Fixes enthought#396 Made sure rows and columns are integers by replacing "/" with "//" in kiva/agg/freetype2/src/tools/docmaker/tohtml.py Fixes enthought#400 Made the test examples run on windows and using wx: * Replaced deprecated "wx.EVT_XXX(panel, handler)" with "panel.Bind(wx.EVT_XXX, handler)" in rgba_color_editor.py * Replaced faulty "slider.SetTickFreq( 10, 1 )" with "slider.SetTickFreq(10)" in rgba_color_editor.py * Fixed the failing ToolkitEditorFactory.all_facenames method in kiva_font_editor.py * Replaced deprecated wx.PyPanel with wx.Panel * Insulated the xxxtrait.configure_traits() call inside a "if __name__ == '__main__'" block * Added the "demo = XXXtrait()" to each demo-script so it can be discovered and run by the traitsui.extra.demo.demo. * Changed "from enable.wx_backend import Window" to "from enable.api import Window" and moved all imports to the top of the file. * Replaced call to wx.SystemSettings_GetMetric with wx.SystemSettings.GetMetric * Replaced call to deprecated wx.EVT_XXXX( control, self._on_XXXX) with control.Bind(wx.EVT_ERASE_BACKGROUND, self._on_XXXXX) * Fixed a bug in BaseWindow._create_control: If parent is None it is set to wx.Frame(None) in order to avoid crash in the unittests. * Replaced wx.WXK_PRIOR and wx.WXK_NEXT (which does not exist on wxpython4) with wx.WXK_PAGEUP and wx.WXK_PAGEDOWN Fixes enthought#399 replaced: * wx.GraphicsRenderer_GetDefaultRenderer with wx.GraphicsRenderer.GetDefaultRenderer * wx.GraphicsContext_Create with wx.GraphicsContext.Create Fixed failing examples: * examples/kiva/agg/benchmark.py (Float -> float, added missing import of zeros) * examples/kiva/agg/polygon_hit_test.py (point_in_polygon -> points_in_polygon) * examples/kiva/gradient.py (added missing import of tempfile) Moved code in 'if __name___ == "__main__"' block in benchmark.py to the run_all_benchmarks function. Removed unused stuff: * Removed unused import of "FILL_STROKE" in examples/kiva/agg/compiled_path.py * Removed unused import of "affine", "constants" in examples/kiva/agg/dummy.py * Removed unused ttfdict_to_fnames function in font_manager.py * Removed unused import of "sqrt" and "affine" in enable/savage/svr/backends/kiva/renderer.py Replaced call to deprecated time.clock with time.perf_counter on Python 3 in: * examples/kiva/agg/benchmark.py * examples/kiva/agg/dash.py * examples/kiva/agg/lion.py * examples/kiva/agg/pylygon_hit_test.py * examples/kiva/agg/simple_clip.py * examples/kiva/agg/text_ex.py * examples/kiva/simple.py * examples/kiva/test_image3.py Fixes enthought#395 * Replaced dangerous default value "transforms=[]" with "transforms=None" in __init__ methods. Python style fixes.
pbrod
added a commit
to pbrod/enable
that referenced
this issue
Mar 26, 2020
…d tests to expected failure. Also removed unused import of "allclose" and "nose". Made wx.VERSION comparison more robust in enable/savage/svg/backends/wx/renderer.py and enable/wx/base_window.py. Fixes enthought#393 Added self as first argument to AbstractGraphicsContext.draw_image method Fixes enthought#396 Made sure rows and columns are integers by replacing "/" with "//" in kiva/agg/freetype2/src/tools/docmaker/tohtml.py Fixes enthought#400 Made the test examples run on windows and using wx: * Replaced deprecated "wx.EVT_XXX(panel, handler)" with "panel.Bind(wx.EVT_XXX, handler)" in rgba_color_editor.py * Replaced faulty "slider.SetTickFreq( 10, 1 )" with "slider.SetTickFreq(10)" in rgba_color_editor.py * Fixed the failing ToolkitEditorFactory.all_facenames method in kiva_font_editor.py * Replaced deprecated wx.PyPanel with wx.Panel * Insulated the xxxtrait.configure_traits() call inside a "if __name__ == '__main__'" block * Added the "demo = XXXtrait()" to each demo-script so it can be discovered and run by the traitsui.extra.demo.demo. * Changed "from enable.wx_backend import Window" to "from enable.api import Window" and moved all imports to the top of the file. * Replaced call to wx.SystemSettings_GetMetric with wx.SystemSettings.GetMetric * Replaced call to deprecated wx.EVT_XXXX( control, self._on_XXXX) with control.Bind(wx.EVT_ERASE_BACKGROUND, self._on_XXXXX) * Fixed a bug in BaseWindow._create_control: If parent is None it is set to wx.Frame(None) in order to avoid crash in the unittests. * Replaced wx.WXK_PRIOR and wx.WXK_NEXT (which does not exist on wxpython4) with wx.WXK_PAGEUP and wx.WXK_PAGEDOWN Fixes enthought#399 replaced: * wx.GraphicsRenderer_GetDefaultRenderer with wx.GraphicsRenderer.GetDefaultRenderer * wx.GraphicsContext_Create with wx.GraphicsContext.Create Fixed failing examples: * examples/kiva/agg/benchmark.py (Float -> float, added missing import of zeros) * examples/kiva/agg/polygon_hit_test.py (point_in_polygon -> points_in_polygon) * examples/kiva/gradient.py (added missing import of tempfile) Moved code in 'if __name___ == "__main__"' block in benchmark.py to the run_all_benchmarks function. Removed unused stuff: * Removed unused import of "FILL_STROKE" in examples/kiva/agg/compiled_path.py * Removed unused import of "affine", "constants" in examples/kiva/agg/dummy.py * Removed unused ttfdict_to_fnames function in font_manager.py * Removed unused import of "sqrt" and "affine" in enable/savage/svr/backends/kiva/renderer.py Replaced call to deprecated time.clock with time.perf_counter on Python 3 in: * examples/kiva/agg/benchmark.py * examples/kiva/agg/dash.py * examples/kiva/agg/lion.py * examples/kiva/agg/pylygon_hit_test.py * examples/kiva/agg/simple_clip.py * examples/kiva/agg/text_ex.py * examples/kiva/simple.py * examples/kiva/test_image3.py Fixes enthought#395 * Replaced dangerous default value "transforms=[]" with "transforms=None" in __init__ methods. Python style fixes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The init method has a dangerous default value [] as argument for "transforms":
enable/enable/savage/svg/backends/kiva/renderer.py
Lines 172 to 173 in 6cf525c
Consider setting it to None and check for None explicitly.
The text was updated successfully, but these errors were encountered: