Page MenuHomePhabricator

harvest template syntax error
Closed, ResolvedPublic

Description

Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1634/
Reported by: masti01
Created on: 2013-05-24 22:33:04
Subject: harvest template syntax error
Original description:
$python harvest\_template.py -cat:"Miasta Polski"
File "harvest\_template.py", line 116
item.editclaim\(str\(claim\), linkedItem.getID\(\) ,refs=\{self.setSource\(self.site\(\).language\(\)\)\}\)
^
SyntaxError: invalid syntax

$ python version.py
unicode test: triggers problem \#3081100
Pywikipedia \[http\] trunk/pywikipedia \(r11578, 2013/05/24, 17:03:42, ok\)
Python 2.6.6 \(r266:84292, Oct 12 2012, 14:23:48\)
\[GCC 4.4.6 20120305 \(Red Hat 4.4.6-4\)\]
config-settings:
use\_api = True
use\_api\_login = True
unicode test: triggers problem \#3081100


Version: compat-(1.0)
Severity: normal
See Also:
https://sourceforge.net/p/pywikipediabot/bugs/1634

Details

Related Objects

StatusSubtypeAssignedTask
InvalidNone
ResolvedXqt

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:22 AM
bzimport set Reference to bz55138.

I think you should update your code and run it again. beside what are you commanding is not correct. you should give more details in your command \(see help of code for detail\)

There is no syntax error in the actual (r11579) code:

import harvest_template

  • status: open --> closed-works-for-me
  • Group: --> confirmed
  • status: closed-works-for-me --> open-accepted

{self.setSource(self.site().language())} is allowed in python 2.7 but not in python 2.6. I think we want to keep python 2.6 compatibility, right?

What are you saying about the version of python is not correct because this is trunk branch not rewrite branch and in this branch we don't have setSource as a method of claim class, It's just a function in this code

It should be set(self.setSource(self.site().language())), shouldn't it?

Ladsgroup set Security to None.
Aklapper lowered the priority of this task from Medium to Lowest.Jun 5 2015, 1:41 PM
Aklapper added a subscriber: Aklapper.

Pywikibot has two versions: Compat and Core. This task was filed about the older version, called Pywikibot-compat, which is not under active development anymore. Hence I'm lowering the priority of this task to reflect the reality. Unfortunately, the Pywikibot team does not have the manpower to retest every single bug report / feature request against the (maintained) Pywikibot code base. Furthermore, the code base of Pywikibot-Compat has changed a lot compared to the code base of Pywikibot-Core so there is a chance that the problem described in this task might not exist anymore. Please help: Unfortunately manpower is limited and does not allow testing every single reported task again. If you have time and interest in Pywikibot, please upgrade to Pywikibot-Core and add a comment to this task if the problem in this task still happens in Pywikibot-Core (or directly edit the task by removing the Pywikibot-compat project and adding the Pywikibot project to this task). To learn more about Pywikibot and to get involved in its development, please check out https://www.mediawiki.org/wiki/Manual:Pywikibot/Development Thank you for your understanding.

Change 277284 had a related patch set uploaded (by Xqt):
[bugfix] fix syntax error vor py 2.6

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

Change 277284 merged by jenkins-bot:
[bugfix] fix syntax error for py 2.6

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