-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
"Directory must be opened before use" errors while using some for the Directory
methods
#40234
Comments
I'm not sure whether that's a regression or the fix provided in #40151 simply revealed the wrong usage of this method. Should the directory be opened explicitly now with Current documentation of
|
Directory.change_dir()
Directory
methods
Changed the title because it seems like other methods are affected as well. |
Yeah, this happens because #40151 "fixed" #24149, which is a "bug" that users tend to use as a feature unknowingly. But while the change is likely fine for 4.0, it's probably not for 3.2.x so we should likely revert the cherry-pick or improve the implementation to be non-breaking. CC @nathanfranke |
Alternatively, we could consider that Edit: But I think that would be a bad solution, as it's dangerous to have So actually maybe this is justified to change in 3.2.3+, even if it breaks compat. At most we could maybe add some code so that |
Given how it may be easy to delete stuff within |
But what about var dir = Directory.new()
dir.open("res://")
dir.dir_exists("res://") instead of just: var dir = Directory.new()
dir.dir_exists("res://") Related proposal: godotengine/godot-proposals#1101 (CC @KoBeWi). |
Upon grepping, I figured that I've got quite a bunch of plugins which do this, so that requires fixing some of them gradually by talking to respective authors first, or just fix them locally for now. https://github.com/bitwes/Gut A lot of occurrences are indeed in the form of: var fs = Directory.new()
var exists = fs.file_exists(path) |
The directory api seems very confusing to me. What is the difference between As for |
It seems like Lines 229 to 243 in 85220fe
I wouldn't really bother figuring the responsibility of those methods given that even reduz admits the current system is not great (from IRC #godotengine-devel):
As for #40146, this could've also been fixed for the |
Looking at #40151, it's simply a matter of reverting the |
Godot version:
3.2.3.beta 6fd712c, likely due to #40151.
OS/device including version:
Windows 10
Issue description:
Other methods are also affected:
dir_exists
,make_dir
,make_dir_recursive
,file_exists
.Steps to reproduce:
This piece of snippet works fine in
3.2.2-stable
.I stumbled upon this while running a project with the plugin refresher, the plugins are not listed in 3.2.3 now.
Minimal reproduction project:
dir_access_chdir.zip
The text was updated successfully, but these errors were encountered: