You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is a bug, but seems a funny fact, I spend some time trying to figure it out why the package was not loading. Just happened when I renamed the file, but add an extra .py extension.
reloading plugin Pack.pack.py
Traceback (most recent call last):
File "D:\SublimeText\sublime_plugin.py", line 109, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1512, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1529, in _find_and_load_unlocked
ImportError: No module named 'Pack.pack'
Steps to reproduce
Create the file pack.py.py on folder Pack at the Sublime Text Packages directory:
importsublimeimportsublime_pluginclassIndentSelectWholeFirstLineEventListener(sublime_plugin.EventListener):
""" Sublime Text 3: Keep entire lines selected when indenting with tab https://stackoverflow.com/questions/24688117 """defon_post_text_command(self, view, command_name, args):
ifcommand_name=='indent':
ifall(notsel.empty() forselinview.sel()):
ifall(view.line(sel.begin()) !=view.line(sel.end()) forselinview.sel()):
new_selections= []
forselinview.sel():
new_selections.append(sel.cover(view.line(sel.begin())))
view.sel().clear()
view.sel().add_all(new_selections)
Now you will see on the console the error message.
Environment
Operating system and version:
Windows 10 build 15063 (x64)
Mac OS ...
Linux ...
Monitor:
Resolution 1920x1080
dpi_scale used in ST 1.0
Sublime Text:
Build 3133
32 bit (x86)
The text was updated successfully, but these errors were encountered:
This is really more of an issue that Python treats . as a module separator. If you try to add a . to a Python file and import it using the . in the module name for that filename, I believe it is going to do the same thing.
I suggest a wontfix. Trying to work around this limitation of Python is just not feasible and the workaround is absolutely trivial: Just don't use dots in your file or module names.
I am not sure if this is a bug, but seems a funny fact, I spend some time trying to figure it out why the package was not loading. Just happened when I renamed the file, but add an extra
.py
extension.This other issue seems related:
Expected behavior
Correctly load the package names
pack.py.py
as:instead of:
Actual behavior
Steps to reproduce
pack.py.py
on folderPack
at the Sublime Text Packages directory:Now you will see on the console the error message.
Environment
dpi_scale
used in ST 1.0The text was updated successfully, but these errors were encountered: