Sublime Forum

Package Control and local repository

#1

Hey All

I have a local repo with some specific packages which has url like “file:///sublimetext/repositories.json” and package control was validating it with no problem but at some point it stopped to work nicely due urlparse hostname conversion to lowercase.

To be specific this code fails in Package Control/package_control/package_manager.py

url="file:///sublimetext/repositories.json" hostname = urlparse.urlparse(url).hostname.lower()

… so I had to add some additional validation for file:/// cases like:

if re.search('^file:/', url) == None: etc

Not quite sure where to put this request (I do not have github account) but just wanted to check if the author would be able to fix this issue in an elegant way for the next package control versoin pretty plz. Im still on ST2 version.

Thanks,
Nick

0 Likes

#2

It is not really clear in your report that the conversion to lowercase is not the real problem but that the parsed hostname is None (so the attribute access to lower fails).

Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'NoneType' object has no attribute 'lower'

0 Likes

#3

Oh, yes - forgot to clarify this… thanks for the correction.

0 Likes