• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

manahl / PyBloqs
89%
master: 89%

Build:
Build:
LAST BUILD BRANCH: fix/pandas3-table-formatters
DEFAULT BRANCH: master
Repo Added 25 Apr 2017 04:59PM UTC
Files 38
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH fix/plot-format-restore
branch: fix/plot-format-restore
CHANGE BRANCH
x
Reset
  • fix/plot-format-restore
  • 1.1.9
  • Add-Collapsible-Block
  • DataFrameMapCompat
  • add_typing
  • blog-post-photos
  • bugfix_cfg
  • bugfix_foo
  • bugfix_server_tabs
  • bugfix_utf8
  • cherry-pick-1.1.9-changelog-and-version-bump
  • code_block
  • decompress
  • docs_folders
  • feature/common_table_formatter
  • feature/increase-frontend-coverage
  • feature/initial-release
  • fix/pandas3-table-formatters
  • fix_docs
  • htmx_fixes
  • increase_circleci_coverage
  • master
  • no_async
  • p_140
  • p_141
  • p_142
  • patch-1
  • permit_no_compression
  • pull/133
  • pybloqs_server
  • python-312-compat
  • readme_touchup
  • release
  • render_resources
  • replace_inner_html
  • rmorotti-pandas-applymap
  • rspencer01-docs-patch
  • rspencer01-patch-1
  • rspencer01-patch-2
  • rspencer01-v-1-4-3
  • set_server_id
  • unique_ids
  • update-contributors
  • use_old_compression

31 Aug 2026 12:53PM UTC coverage: 88.607% (-0.2%) from 88.791%
7a4aae92-f0aa-4775-91aa-8745174ad27d

Pull #176

circleci

WatchTree-19
fix: plot_format leaks its settings when the wrapped block raises

plot_format mutates module-level state and restores it after the yield with no
try/finally:

    old = get_plot_format()
    set_plot_format(plot_format, dpi)
    yield
    set_plot_format(*old)

If the wrapped code raises, which rendering readily does, the restore never
runs and _PLOT_FORMAT, _PLOT_MIME_TYPE and _PLOT_DPI stay overridden for the
rest of the process. Nothing warns; every later block silently renders at the
wrong format and DPI. Against released 1.4.3, a block that raises inside
plot_format("svg", 300) leaves the globals at ('svg', 300).

Wrap the yield in try/finally.

Separately, set_plot_format assigns _PLOT_FORMAT before looking up the mime
type, so an unsupported format raises KeyError with _PLOT_FORMAT already
changed and _PLOT_MIME_TYPE still holding the old value. On 1.4.3,
set_plot_format("jpeg") leaves format 'jpeg' paired with mime 'png'. Look the
mime type up first so a bad format changes nothing.

Adds two tests alongside the existing test_plot_format_ctx_manager, which only
covers the success path.

Signed-Off By Sandeep Singh Rai sandeeprai_dsp@hotmail.com
Pull Request #176: fix: plot_format leaks its settings when the wrapped block raises

5 of 5 new or added lines in 1 file covered. (100.0%)

2512 of 2835 relevant lines covered (88.61%)

1.77 hits per line

Relevant lines Covered
Build:
Build:
2835 RELEVANT LINES 2512 COVERED LINES
1.77 HITS PER LINE
Source Files on fix/plot-format-restore
  • Tree
  • List 38
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
7a4aae92... fix/plot-format-restore fix: plot_format leaks its settings when the wrapped block raises plot_format mutates module-level state and restores it after the yield with no try/finally: old = get_plot_format() set_plot_format(plot_format, dpi) yield set_plo... Pull #176 31 Aug 2026 12:56PM UTC WatchTree-19 circleci
88.61
See All Builds (522)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc