Fix crashes, logic errors, and lifecycle bugs#910
Open
sreckoskocilic wants to merge 7 commits intofman-users:mainfrom
Open
Fix crashes, logic errors, and lifecycle bugs#910sreckoskocilic wants to merge 7 commits intofman-users:mainfrom
sreckoskocilic wants to merge 7 commits intofman-users:mainfrom
Conversation
…paring two tuples, every equality check returns True - master -> main branch fix - prepare_trash now calls self.move_to_trash instead of self.delete, so plugin subclasses won't permanently delete files when the user expects trashing - NotImplementedError - unrecognized platforms fail fast with a clear message instead of a cryptic NameError - removed shadowing basename import - get_column_widths uses range so plugin-added columns get their widths saved/restored
…it__ always runs, even on exception. - util/qt/__init__.py — Added missing c_void_p import from ctypes, fixing a macOS runtime crash. - table.py — Fixed off-by-one: bounds check now rejects len + 1 correctly. - widgets.py — Added null guard on _main_window before accessing it in state change handler.
…ved, so a/b/c/../../d correctly becomes a/d. - session.py — Removed dead _get_startup_message method (duplicated by _show_startup_messages)
…cans Crashes: - application_context.py: model.shutdown() now called on close (was AttributeError on _widget) - widgets.py: saveState/restoreState crashed when state >= 256 bytes (bytes→struct.pack) - widgets.py: float division passed to QWidget.move() → integer division - widgets.py: findChild(QPushButton) null check, FilterBar sourceModel() null check - drag_and_drop.py: unguarded from_qurl in dropMimeData caused crash on invalid URLs - commands/__init__.py: tuple-unpack crash when zip has != 1 top-level directory - commands/__init__.py: OpenSelectedFiles passed None to _open_files - commands/__init__.py: HistoryListener KeyError on GoBack/GoForward - uniform_row_heights.py: max() on empty generator when model has 0 columns - quicksearch.py: guard negative sizeHintForRow return Logic fixes: - plugin.py: unload() catches per-action exceptions, reports all errors - plugin.py: guard spec=None, try/finally cleanup of sys.modules on failed load - plugin.py: deprecated load_module() → importlib.util spec-based loading - plugin.py: unbounded daemon threads → bounded ThreadPoolExecutor - plugin.py: validation break removed (was silently dropping subsequent errors) - command_registry.py: after_command no longer fired when command raised exception - commands/__init__.py: _from_human_readable used wrong scheme when src/dest differ - commands/__init__.py: _Delete used global show_alert instead of self.show_alert - zip.py: early return inside loop broke attribute lookup for non-first entries - zip.py: os.waitpid raw status → os.WEXITSTATUS for proper exit code - resize_cols_to_contents.py: pixel truncation in distribution + column shrink fix - key_bindings.py: if→elif preventing duplicate error messages - quicksearch_matchers.py: case-insensitive contains_chars and contains_substring - goto.py: dedup check was populated but never consulted - local/__init__.py: touch() and _rename() clear destination cache - onboarding/__init__.py: unclosed <ul> tag - session.py: redundant is_first_run diverged from instance attribute Lifecycle: - application_context.py: ListenerWrapper.shutdown_pool() and metrics.shutdown() on quit - model/__init__.py: SortedFileSystemModel memory leak (added shutdown + visited cap) - model/__init__.py: _on_file_removed recursion→iteration + null sourceModel guard - widgets.py: ProgressDialog state protected by Lock for thread safety - widgets.py: email URL encoding in SplashScreen login link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_on_file_removedcrash — null-guardsourceModel()before accessing location; iterative parent traversal replaces recursive call that could stack-overflow_MAX_VISITEDcap on_already_visitedset (512 entries) to prevent unbounded memory growthSortedFileSystemModel.shutdown()— proper cleanup: disconnect signals, remove callbacks, shut down source modelSourceFileLoader→importlib.util— deprecated loader replaced withspec_from_file_locationfor correct subpackage resolutionListenerWrapperthread pool — unboundedThread(daemon=True)replaced with boundedThreadPoolExecutor(max_workers=1)withshutdown_pool()for clean exitReportExceptionsas context manager — stores.exceptionattribute;command_registryuses it instead of bareexceptswallowing all errors_distribute_evenly/_distribute_exponentially— remainder pixels now distributed sosum(result) == width_resize_columnoverflow — shrink path clamped toavailable_widthso columns can't exceed viewportrestoreState/saveState— single-byte length encoding replaced withstruct.pack('<I', ...)to support state > 255 bytes;restoreStatewrapped in try/except for corrupted stateoverlay.move()float → int — explicitint()casts prevent Qt deprecation warnings_from_human_readable— relative vs absolute path detection fixed; absolute paths no longer incorrectly joined withsrc_dirGoBack/GoForward—.get()instead of[]to avoidKeyErrorwhen history listener is missing_Delete.show_alert— instance method call instead of module-level, respects subclass overridesOpenFilenull guard — early return when no file is under cursorzip.pyplugin install — validates exactly one top-level directory in zip before extractingdrophandler — catchesValueErrorfrom malformedQUrls instead of crashinguniform_row_heights—default=-1preventsValueErroronmax()of empty sequencekey_bindings—eliffixes unreachable branch for emptykeysvalidationquicksearch— guard againstrow_height <= 0before computing max heightonboarding— unclosed</ul>tag now properly closedapplication_contextcleanup — model shutdown on quit, metrics shutdown, LD_LIBRARY_PATH docstring condensed with updated URLsession.py—is_first_runproperty used instead of re-checking settings; save failure logged instead of silently swallowedgoto.py— duplicate inode check moved beforeto_visit.appendto avoid redundant work; stale TODO removedemailURL encoding —quote(email, safe='')in splash screen login linkProgressDialogthread safety —Lockguards_text,_progress,_size; null-check on cancel buttonFilterBar— null-guardsourceModel()before callingupdate()assert→raise— 5 bare asserts replaced with proper exceptionsquicksearch_matchers—contains_chars/contains_substringfixed: case-insensitive matching, proper index trackingfilesvariable removed from clipboard copy commandbasenameimport removed fromcore/commands/__init__.pyTest plan