Title: [Possible Bug / Error] PythonScript 3.0.24.0 - "PluginsManager:runPluginCommand Exception" dialog with "Access Violation" with one of my scripts. · Issue #405 · bruderstein/PythonScript · GitHub
Open Graph Title: [Possible Bug / Error] PythonScript 3.0.24.0 - "PluginsManager:runPluginCommand Exception" dialog with "Access Violation" with one of my scripts. · Issue #405 · bruderstein/PythonScript
X Title: [Possible Bug / Error] PythonScript 3.0.24.0 - "PluginsManager:runPluginCommand Exception" dialog with "Access Violation" with one of my scripts. · Issue #405 · bruderstein/PythonScript
Description: Version Info and Config OS: Windows 11 Pro x64 Version 25H2 (0S Build 26200.7705) Npp: Notepad++ v8.9.1 (64-bit) PythonScript: v3.0.24 (https://github.com/bruderstein/PythonScript/releases/tag/v3.0.24) Overview of Issue I created two new...
Open Graph Description: Version Info and Config OS: Windows 11 Pro x64 Version 25H2 (0S Build 26200.7705) Npp: Notepad++ v8.9.1 (64-bit) PythonScript: v3.0.24 (https://github.com/bruderstein/PythonScript/releases/tag/v3.0...
X Description: Version Info and Config OS: Windows 11 Pro x64 Version 25H2 (0S Build 26200.7705) Npp: Notepad++ v8.9.1 (64-bit) PythonScript: v3.0.24 (https://github.com/bruderstein/PythonScript/releases/tag/v3.0...
Opengraph URL: https://github.com/bruderstein/PythonScript/issues/405
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Possible Bug / Error] PythonScript 3.0.24.0 - \"PluginsManager:runPluginCommand Exception\" dialog with \"Access Violation\" with one of my scripts.","articleBody":"## **Version Info and Config**\n\n```\nOS: Windows 11 Pro x64 Version 25H2 (0S Build 26200.7705)\nNpp: Notepad++ v8.9.1 (64-bit)\nPythonScript: v3.0.24 (https://github.com/bruderstein/PythonScript/releases/tag/v3.0.24)\n```\n\n\u003cimg width=\"500\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/1aa3ce01-a4a3-4432-bca2-30d9e7a9e591\" />\n\n\u003cimg width=\"500\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/1de450df-7729-4698-b932-7d211fd7e997\" />\n\n\n\n---\n\n# Overview of Issue\n\nI created two new scripts today (via Claude Opus 4.5) to transform a specific JSON format to another. In this case it's to replace RGB values to equivalent hex colors, and back. Claude has never failed me until today... but unfortunately my script is causing Npp to spit out an `PluginsManager::runPluginCommand Exception - Access Violation` popup:\n\n\u003cimg width=\"370\" height=\"186\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/461c4e59-0ee2-420a-ae68-fc1985528d3c\" />\n\n\n# How can I debug this?\n\nThis is really frustrating to diagnose because even though I have the \"**`Show Console`**\" enabled for PythonScript globally, it doesn't seem to show the error in the console at all, and I have no way of knowing what line or specific section of code is throwing this error.\n\nAll of my old scripts work completely fine, so I don't think this is an installation issue. Can someone possibly spot what's wrong with my script or at least provide me with a better way to debug this? I have no clue what to do in order to diagnose this bug.\n\n\u003cimg width=\"1200\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0d6ff608-cb3a-4356-b917-dc874510d768\" />\n\n\n\n# My Scripts\n\nHere are both scripts:\n\n- [FM TransformColorJsonHexToRgb.py](https://github.com/user-attachments/files/25087424/FM.TransformColorJsonHexToRgb.py)\n\n- [FM TransformColorJsonRgbToHex.py](https://github.com/user-attachments/files/25087425/FM.TransformColorJsonRgbToHex.py)\n\nThis is my input (I've tried running on selection as well as the whole file):\n\n```json\n{\n \"Name\": \"Some Name\",\n \"BackgroundColor\": \"22, 22, 24\",\n \"LightBackgroundColor\": \"19, 19, 21\",\n \"DarkBackgroundColor\": \"14, 14, 15\",\n \"TextColor\": \"227, 227, 239\",\n \"BorderColor\": \"39, 39, 42\",\n \"CheckerColor\": \"213, 188, 170\",\n \"CheckerColor2\": \"212, 146, 146\",\n \"CheckerSize\": 17,\n \"LinkColor\": \"95, 136, 255\",\n \"MenuHighlightColor\": \"44, 44, 52\",\n \"MenuHighlightBorderColor\": \"28, 28, 34\",\n \"MenuBorderColor\": \"28, 28, 34\",\n \"MenuCheckBackgroundColor\": \"186, 219, 130\",\n \"MenuFont\": \"Roboto, 14px\",\n \"ContextMenuFont\": \"Roboto, 14px\",\n \"ContextMenuOpacity\": 100,\n \"SeparatorLightColor\": \"255, 75, 238\",\n \"SeparatorDarkColor\": \"25, 25, 28\"\n}\n```\n\n## `FM TransformColorJsonRgbToHex.py`:\n\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\nRGB to Hex Color Converter for Notepad++ PythonScript\nConverts RGB color values like \"22, 22, 24\" to hex format \"#161618\"\nHandles selection or entire document with full undo support.\n\"\"\"\n\nimport re\n\ndef rgb_to_hex(match):\n \"\"\"\n Convert an RGB string match to hex format.\n \n Args:\n match: Regex match object containing RGB values\n \n Returns:\n Hex color string in format \"#RRGGBB\"\n \"\"\"\n try:\n r = int(match.group(1).strip())\n g = int(match.group(2).strip())\n b = int(match.group(3).strip())\n \n # Clamp values to valid RGB range\n r = max(0, min(255, r))\n g = max(0, min(255, g))\n b = max(0, min(255, b))\n \n return '\"#{:02X}{:02X}{:02X}\"'.format(r, g, b)\n except (ValueError, AttributeError):\n # Return original if conversion fails\n return match.group(0)\n\n\ndef convert_rgb_to_hex(text):\n \"\"\"\n Convert all RGB color values in text to hex format.\n \n Matches patterns like:\n \"22, 22, 24\"\n \"255, 128, 0\"\n \" 22 , 22 , 24 \" (with extra whitespace)\n \n Args:\n text: Input text containing RGB color values\n \n Returns:\n Text with RGB values converted to hex\n \"\"\"\n # Pattern matches quoted RGB values: \"R, G, B\"\n # Captures three groups of digits separated by commas\n # Allows flexible whitespace\n pattern = r'\"(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\"'\n \n return re.sub(pattern, rgb_to_hex, text)\n\n\ndef main():\n \"\"\"Main entry point for the script.\"\"\"\n \n # Check if there's a selection\n selection_start = editor.getSelectionStart()\n selection_end = editor.getSelectionEnd()\n has_selection = selection_start != selection_end\n \n # Begin undo action for single-step undo\n editor.beginUndoAction()\n \n try:\n if has_selection:\n # Process only selected text\n selected_text = editor.getSelText()\n converted_text = convert_rgb_to_hex(selected_text)\n \n if selected_text != converted_text:\n editor.replaceSel(converted_text)\n notepad.messageBox(\n \"RGB to Hex conversion complete (selection).\",\n \"Conversion Complete\",\n 0\n )\n else:\n notepad.messageBox(\n \"No RGB color values found in selection.\",\n \"No Changes\",\n 0\n )\n else:\n # Process entire document\n full_text = editor.getText()\n converted_text = convert_rgb_to_hex(full_text)\n \n if full_text != converted_text:\n # Preserve cursor position\n current_pos = editor.getCurrentPos()\n editor.setText(converted_text)\n \n # Restore cursor (adjust if position is now out of bounds)\n new_length = editor.getTextLength()\n editor.gotoPos(min(current_pos, new_length))\n \n notepad.messageBox(\n \"RGB to Hex conversion complete (entire document).\",\n \"Conversion Complete\",\n 0\n )\n else:\n notepad.messageBox(\n \"No RGB color values found in document.\",\n \"No Changes\",\n 0\n )\n finally:\n # Always end undo action, even if an error occurs\n editor.endUndoAction()\n\n\n# Execute the script\nmain()\n```\n\n## Conclusion\n\nCan someone possibly check my script to see what's causing this violation?\n\nI resorted to posting an issue because I have no idea how to debug this.\n\nThanks much.","author":{"url":"https://github.com/futuremotiondev","@type":"Person","name":"futuremotiondev"},"datePublished":"2026-02-05T06:01:17Z","url":"https://github.com/bruderstein/PythonScript/issues/405"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:827a1108-82fe-6765-1a81-5ee8874f062a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C41E:3166AC:2216011:2CBA350:6AF9824A |
| html-safe-nonce | 745908fddfd465150986f787d8160f8a64708523e794f3e79f147d6654ea2bb2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDFFOjMxNjZBQzoyMjE2MDExOjJDQkEzNTA6NkFGOTgyNEEiLCJ2aXNpdG9yX2lkIjoiNTE4OTk1MTQ2MTk0ODc1MjQ1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 91f3adebb225643e28042590dd16607c172384cb8d6356da13bebf9efb93b6d8 |
| hovercard-subject-tag | issue:3899852303 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bruderstein/PythonScript/405/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e81bb7a8c3bda9a04a7842d34436669a083351976cb56ed1033f0f80abd99a70/bruderstein/PythonScript/issues/405 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e81bb7a8c3bda9a04a7842d34436669a083351976cb56ed1033f0f80abd99a70/bruderstein/PythonScript/issues/405 |
| og:image:alt | Version Info and Config OS: Windows 11 Pro x64 Version 25H2 (0S Build 26200.7705) Npp: Notepad++ v8.9.1 (64-bit) PythonScript: v3.0.24 (https://github.com/bruderstein/PythonScript/releases/tag/v3.0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | futuremotiondev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/bruderstein/PythonScript git https://github.com/bruderstein/PythonScript.git |
| octolytics-dimension-user_id | 91716 |
| octolytics-dimension-user_login | bruderstein |
| octolytics-dimension-repository_id | 795778 |
| octolytics-dimension-repository_nwo | bruderstein/PythonScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 795778 |
| octolytics-dimension-repository_network_root_nwo | bruderstein/PythonScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width