Repository navigation
Conversation
… nothing
UnityPy.load('missing.unity3d') currently returns an empty Environment
with no error, hiding typos and wrong paths behind env.objects == [].
There is even a commented-out raise for this exact case in load_file.
This restores loud failures for top-level paths while keeping
load_file's silent-skip for missing dependencies (unshipped externals
are normal and are resolved through the same code path).
This branch has not been deployed
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.
Problem
UnityPy.load("missing.unity3d")currently returns an emptyEnvironmentwith no error. Typos and wrong paths hide behindenv.objects == []until much later in the script, where they surface as confusing "no objects found" behavior instead of the actual mistake.There is even a commented-out
raise FileNotFoundErrorfor this exact case inload_file.Why it is silent today
The silent skip is deliberate for internally resolved paths: #361 removed an over-eager
FileNotFoundErrorthat fired when dependency files were resolved from the current directory, and missing dependencies (packaging errors, references to Unity's global Library) are normal and must be skipped.Change
This only affects top-level string paths passed explicitly to
Environment/UnityPy.load: those are user intent, so resolving them to nothing now raisesFileNotFoundError.Environment.__init__raises whenload_filereturnsNonefor a top-level pathload_fileitself is unchanged: dependency, split-file and case-insensitive fallbacks keep the silent-skip behavior Fixed loading assets from current directory #361 establishedself.pathbefore raisingTests
FileNotFoundErrorFull test suite passes (52 tests).