import pywikibot

site = pywikibot.Site('test', 'wikipedia')
page = pywikibot.Page(site, 'test')

replace -page:test "Error" "Error1" -summary "typo: “州” but not “卅”"
page.save()
  File "<ipython-input-4-66c3cb69ca40>", line 6
    replace -page:test "Error" "Error1" -summary "typo: “州” but not “卅”"
                             ^
SyntaxError: invalid syntax