Page MenuHomePhabricator

'NoneType' object has no attribute '__getitem__'
Closed, ResolvedPublic

Description

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.

Details

Related Gerrit Patches:

Event Timeline

Wesalius created this task.Oct 26 2015, 2:14 PM
Wesalius raised the priority of this task from to Needs Triage.
Wesalius updated the task description. (Show Details)
Wesalius added a project: Pywikibot-replace.py.
Wesalius added a subscriber: Wesalius.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptOct 26 2015, 2:14 PM
XZise claimed this task.Oct 26 2015, 2:21 PM
XZise added a subscriber: XZise.

Oops sorry, I introduced it in 4e393d63.

Change 248875 had a related patch set uploaded (by XZise):
[FIX] cosmetic_changes: Allow missing HTTPS hostname

https://gerrit.wikimedia.org/r/248875

Change 248875 merged by jenkins-bot:
[FIX] cosmetic_changes: Allow missing HTTPS hostname

https://gerrit.wikimedia.org/r/248875

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptNov 23 2016, 4:38 PM

Isn't this solved already?

Wesalius closed this task as Resolved.Jun 23 2018, 11:56 AM

Probably is, I did not run into the error again since posting.