Page MenuHomePhabricator

generate_family_file.py: WARNING: Api does not seem to be enabled
Closed, DuplicatePublic

Description

$ python generate_family_file.py http://translatewiki.net/w/api.php twn
Generating family file from https://translatewiki.net/w/api.php
*** WARNING: Api does not seem to be enabled on https://translatewiki.net/w/api.php
Traceback (most recent call last):
  File "generate_family_file.py", line 339, in <module>
    FamilyFileGenerator(*sys.argv[1:]).run()
  File "generate_family_file.py", line 73, in run
    w = Wiki(self.base_url)
  File "generate_family_file.py", line 284, in __init__
    self._parse_pre_117(data)
  File "generate_family_file.py", line 296, in _parse_pre_117
    self.server = self.REwgServer.search(data).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'

$ python --version
Python 2.7.3
$ python version.py
Pywikibot [https] r/pywikibot/compat (r10331, 445623d, 2013/10/01, 18:00:37, ok)
Release version: 1.0b1
Python: 2.7.3 (default, Aug 9 2012, 17:23:58)
[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok

It's the same with Pywikipedia trunk/pywikipedia/ (r11781, 2013/07/20, 11:39:29, ok)


Version: core-(2.0)
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=70795
https://bugzilla.wikimedia.org/show_bug.cgi?id=72845

Details

Reference
bz54963

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:11 AM
bzimport set Reference to bz54963.
bzimport added a subscriber: Unknown Object (????).
Nemo_bis created this task.Oct 4 2013, 9:47 AM

Note that I gave http as input and it used https, despite no redirect being in place.

Use the link http://translatewiki.net/wiki/Main_Page the generate_family_file.py is designed to use the main url of the wiki to generate the family file not the api url.

It would also be useful to understand direct api urls. Re-opening as feature request.

In core, the logic in FamilyFileGenerator can be migrated into AutoFamily and APISite, which already understands /api.php URLs, and can access the API.

jayvdb updated the task description. (Show Details)Dec 23 2014, 12:58 PM
jayvdb set Security to None.
jayvdb removed a subscriber: Unknown Object (????).