While running replace.py on non-WMF wiki I got this error.
```
Pywikibot: [https] r-pywikibot-core.git (a3bb536, g6745, 2015/10/25, 23:17:55, ok)
Release version: 2.0b3
requests version: 2.7.0
cacerts: C:\Python27\lib\site-packages\requests\cacert.pem
certificate test: ok
Python: 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)])
```
File "pwb.py", line 248, in <module>
if not main():
File "pwb.py", line 242, in main
run_python_file(filename, [filename] + args, argvu, file_package)
File "pwb.py", line 120, in run_python_file
main_mod.__dict__)
File ".\scripts\replace.py", line 1101, in <module>
main()
File ".\scripts\replace.py", line 1092, in main
bot.run()
File ".\scripts\replace.py", line 752, in run
page.put(new_text, self.generate_summary(applied), callback=self.count_changes)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\tools\__init__.py", line 1327, in wrapper
return obj(*__args, **__kw)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\page.py", line 1188, in put
**kwargs)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\tools\__init__.py", line 1327, in wrapper
return obj(*__args, **__kw)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\page.py", line 1107, in save
cc=apply_cosmetic_changes, **kwargs)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\page.py", line 1115, in _save
summary = self._cosmetic_changes_hook(summary) or summary
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\page.py", line 1164, in _cosmetic_changes_hook
self.text = ccToolkit.change(old)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\cosmetic_changes.py", line 269, in change
new_text = self._change(text)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\cosmetic_changes.py", line 263, in _change
text = self.safe_execute(method, text)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\cosmetic_changes.py", line 250, in safe_execute
result = method(text)
File "C:\Users\Jony\Dropbox\ws\BOT\core\pywikibot\cosmetic_changes.py", line 715, in fixSyntaxSave
if http_url[4:] == https_url[5:]:
TypeError: 'NoneType' object has no attribute '__getitem__'
<type 'exceptions.TypeError'>
CRITICAL: Closing network session.