Bugs item #3066934, was opened at 2010-09-15 11:12
Message generated for change (Comment added) made by djbarrett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
>Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: AttributeError: type object 'Timestamp' has no attribute 'st
Initial Comment:
category.py is throwing the error in the Summary. MediaWiki 1.15.4,
$ sudo python category.py move -from:"AABBCC" -to:"DD"
Traceback (most recent call last):
File "/usr/local/pywikipedia/pagegenerators.py", line 1238, in __iter__
for loaded_page in self.preload(somePages):
File "/usr/local/pywikipedia/pagegenerators.py", line 1257, in preload
pywikibot.getall(site, pagesThisSite)
File "/usr/local/pywikipedia/wikipedia.py", line 4208, in getall
_GetAll(site, pages, throttle, force).run()
File "/usr/local/pywikipedia/wikipedia.py", line 3887, in run
xml.sax.parseString(data, handler)
File "/usr/lib64/python2.4/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib64/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 303, in end_element
self._cont_handler.endElement(name)
File "/usr/local/pywikipedia/xmlreader.py", line 202, in endElement
self.callback(entry)
File "/usr/local/pywikipedia/wikipedia.py", line 3923, in oneDone
page2._versionhistory = [(revisionId, str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
type object 'Timestamp' has no attribute 'strptime'
Getting [[Category:AABBCC]]...
Getting [[Category:AABBCC]]...
Couldn't delete Category:AABBCC - not empty.
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8562, 2010/09/15, 12:54:46)
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-16 11:15
Message:
Thanks, it's fixed!
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-16 07:21
Message:
done in r8566
I change this line with direct time class methods. It should work now.
Well I should declare py 2.4 as deprecated ;)
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 15:08
Message:
I'm sorry, our systems run CentOS Linux which comes with a specific Python
version that I do not have access to change.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 14:10
Message:
I am not shure but maybe py 2.4 isn't able to handle such class construct.
I'll revert this changes for now.
Could you try it with a newer python?
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:46
Message:
One more:
>>> wp.Timestamp.fromtimestampformat(t)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in
fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:45
Message:
OK trying again:
import time
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
Produces:
'20100915174350'
Then:
wp.Timestamp
still produces:
<class 'pywikibot.Timestamp'>
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:42
Message:
I don't know Python, so I am just repeating what you wrote. First I did:
$ python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I did:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
Produces:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'time' is not defined
wp.Timestamp.
Produces:
<class 'pywikibot.Timestamp'>
Then I did:
import sys
sys.path
Produces:
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages',
'/usr/local/pywikipedia/userinterfaces',
'/usr/local/pywikipedia/families']
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 13:34
Message:
I haven't found this error. Could you verify some things via idle:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
this should print sth like
'20100915172517'
wp.Timestamp.
Please hold this dot and you'll see availlable methods
wp.Timestamp.fromtimestampformat(t)
produces
Timestamp(2010, 9, 15, 17, 31, 53)
str(wp.Timestamp.fromtimestampformat(t))
produces
'2010-09-15T17:31:53Z'
Please also give me your sys.path()
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 11:22
Message:
The bug was introduced in revision 8562:
svn diff -c8562
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8561)
+++ wikipedia.py (revision 8562)
@@ -2559,8 +2559,11 @@
dataQuery = self._versionhistoryearliest
else:
thisHistoryDone = True
- elif not hasattr(self, '_versionhistory') or forceReload:
+ elif not hasattr(self, '_versionhistory') or forceReload or \
+ len(self._versionhistory) < revCount:
self._versionhistory = []
+ # ?? does not load if len(self._versionhistory) > revCount
+ # shouldn't it
elif getAll and len(self._versionhistory) == revCount:
# Cause a reload, or at least make the loop run
thisHistoryDone = False
@@ -3907,7 +3910,7 @@
successful = False
for page2 in self.pages:
if page2.sectionFreeTitle() == page.sectionFreeTitle():
- if not (hasattr(page2,'_contents') or
hasattr(page2,'_getexception')) or self.force:
+ if not (hasattr(page2,'_contents') or hasattr(page2,
'_getexception')) or self.force:
page2.editRestriction = entry.editRestriction
page2.moveRestriction = entry.moveRestriction
if editRestriction == 'autoconfirmed':
@@ -3917,6 +3920,7 @@
page2._ipedit = ipedit
page2._revisionId = revisionId
page2._editTime = timestamp
+ page2._versionhistory = [(revisionId,
str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
section = page2.section()
# Store the content
page2._contents = text
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 11:16
Message:
Note: the example did create category "DD" but did not recategorize the
page in the AABBCC category. (There is only one page in the category.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Bugs item #2968140, was opened at 2010-03-10 18:48
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
Status: Open
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: JAn (jandudik)
Assigned to: xqt (xqt)
Summary: unrecognized dismbiguation templates
Initial Comment:
In http://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage there are some templates which are not as links. bot cannot recognize it and removes links to some disambiguations with templates like {{shiplist}} or {{surname}}.
But these articles are in some languages as disambigs, in some not. Maybe do something for recognize these as semi-disambiguations?
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-09-16 13:34
Message:
ok this seems more resticted but with new -cleanup option this doesn't
matter. Fix coming (soon)?
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-15 23:45
Message:
Example of incorrect work:
http://en.wikipedia.org/w/index.php?title=Gari%2C_Russia&action=historysubm…
. Page en:Gari,_Russia has {{SIA}} and it should be linked with
ru:Гари_(Россия) that is "true" disambiguation. But the bot
changed link into another, non-disambiguation page. And It wasn't in
"force" mode.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 20:24
Message:
on other sites these pages aren't marked as disambigs and this would lead
in removing interwiki links there.
There is a ways to not remove these links: do not use -force in
-autonomous mode!
Please be free to use the new -cleanup option instead I implemented this
week (and read the mail list). This does not touch disambig mismatches.
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-15 18:19
Message:
I join to the request of JAn. In en.wiki there is a special type of
disambigiations - {{SIA}}. When Script work automatically it concerns pages
with {{SIA}} as non-disambig and can remove correct interwikis.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Bugs item #3066934, was opened at 2010-09-15 17:12
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
>Status: Pending
Resolution: None
Priority: 7
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: AttributeError: type object 'Timestamp' has no attribute 'st
Initial Comment:
category.py is throwing the error in the Summary. MediaWiki 1.15.4,
$ sudo python category.py move -from:"AABBCC" -to:"DD"
Traceback (most recent call last):
File "/usr/local/pywikipedia/pagegenerators.py", line 1238, in __iter__
for loaded_page in self.preload(somePages):
File "/usr/local/pywikipedia/pagegenerators.py", line 1257, in preload
pywikibot.getall(site, pagesThisSite)
File "/usr/local/pywikipedia/wikipedia.py", line 4208, in getall
_GetAll(site, pages, throttle, force).run()
File "/usr/local/pywikipedia/wikipedia.py", line 3887, in run
xml.sax.parseString(data, handler)
File "/usr/lib64/python2.4/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib64/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 303, in end_element
self._cont_handler.endElement(name)
File "/usr/local/pywikipedia/xmlreader.py", line 202, in endElement
self.callback(entry)
File "/usr/local/pywikipedia/wikipedia.py", line 3923, in oneDone
page2._versionhistory = [(revisionId, str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
type object 'Timestamp' has no attribute 'strptime'
Getting [[Category:AABBCC]]...
Getting [[Category:AABBCC]]...
Couldn't delete Category:AABBCC - not empty.
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8562, 2010/09/15, 12:54:46)
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-09-16 13:21
Message:
done in r8566
I change this line with direct time class methods. It should work now.
Well I should declare py 2.4 as deprecated ;)
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 21:08
Message:
I'm sorry, our systems run CentOS Linux which comes with a specific Python
version that I do not have access to change.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 20:10
Message:
I am not shure but maybe py 2.4 isn't able to handle such class construct.
I'll revert this changes for now.
Could you try it with a newer python?
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:46
Message:
One more:
>>> wp.Timestamp.fromtimestampformat(t)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in
fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:45
Message:
OK trying again:
import time
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
Produces:
'20100915174350'
Then:
wp.Timestamp
still produces:
<class 'pywikibot.Timestamp'>
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:42
Message:
I don't know Python, so I am just repeating what you wrote. First I did:
$ python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I did:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
Produces:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'time' is not defined
wp.Timestamp.
Produces:
<class 'pywikibot.Timestamp'>
Then I did:
import sys
sys.path
Produces:
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages',
'/usr/local/pywikipedia/userinterfaces',
'/usr/local/pywikipedia/families']
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 19:34
Message:
I haven't found this error. Could you verify some things via idle:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
this should print sth like
'20100915172517'
wp.Timestamp.
Please hold this dot and you'll see availlable methods
wp.Timestamp.fromtimestampformat(t)
produces
Timestamp(2010, 9, 15, 17, 31, 53)
str(wp.Timestamp.fromtimestampformat(t))
produces
'2010-09-15T17:31:53Z'
Please also give me your sys.path()
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:22
Message:
The bug was introduced in revision 8562:
svn diff -c8562
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8561)
+++ wikipedia.py (revision 8562)
@@ -2559,8 +2559,11 @@
dataQuery = self._versionhistoryearliest
else:
thisHistoryDone = True
- elif not hasattr(self, '_versionhistory') or forceReload:
+ elif not hasattr(self, '_versionhistory') or forceReload or \
+ len(self._versionhistory) < revCount:
self._versionhistory = []
+ # ?? does not load if len(self._versionhistory) > revCount
+ # shouldn't it
elif getAll and len(self._versionhistory) == revCount:
# Cause a reload, or at least make the loop run
thisHistoryDone = False
@@ -3907,7 +3910,7 @@
successful = False
for page2 in self.pages:
if page2.sectionFreeTitle() == page.sectionFreeTitle():
- if not (hasattr(page2,'_contents') or
hasattr(page2,'_getexception')) or self.force:
+ if not (hasattr(page2,'_contents') or hasattr(page2,
'_getexception')) or self.force:
page2.editRestriction = entry.editRestriction
page2.moveRestriction = entry.moveRestriction
if editRestriction == 'autoconfirmed':
@@ -3917,6 +3920,7 @@
page2._ipedit = ipedit
page2._revisionId = revisionId
page2._editTime = timestamp
+ page2._versionhistory = [(revisionId,
str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
section = page2.section()
# Store the content
page2._contents = text
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:16
Message:
Note: the example did create category "DD" but did not recategorize the
page in the AABBCC category. (There is only one page in the category.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Bugs item #3066765, was opened at 2010-09-15 11:02
Message generated for change (Comment added) made by dmitrynikitin
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066765&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
>Status: Closed
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: Dmitry Nikitin (dmitrynikitin)
Assigned to: xqt (xqt)
Summary: clean_sandbox.py: TypeError: 'int' object is unsubscriptable
Initial Comment:
>>python clean_sandbox.py
Traceback (most recent call last):
File "clean_sandbox.py", line 212, in <module>
main()
File "clean_sandbox.py", line 206, in main
bot.run()
File "clean_sandbox.py", line 170, in run
diff = minutesDiff(sandboxPage.editTime(), time.strftime("%Y%m%d%H%M%S", time.gmtime()))
File "clean_sandbox.py", line 138, in minutesDiff
t1 = (((int(time1[0:4]) * 12 + int(time1[4:6])) * 30 +
TypeError: 'int' object is unsubscriptable
-------------------------------------------------------
Pywikipedia [http] trunk/pywikipedia (r8560, 2010/09/15, 10:11:05)
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: Dmitry Nikitin (dmitrynikitin)
Date: 2010-09-16 08:01
Message:
I've closed the bug. All work in r8564
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 17:44
Message:
hm, there is nothing left to do and the editTime() has gone. Please come
back if this bug occures again
----------------------------------------------------------------------
Comment By: Dmitry Nikitin (dmitrynikitin)
Date: 2010-09-15 17:32
Message:
>>python clean_sandbox.py -verbose -lang:ru
Pywikipediabot [http] trunk/pywikipedia (r8564, 2010/09/15, 17:16:53)
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3]
Sleeping for 1.0 seconds, 2010-09-15 21:31:10
==== API action:query ====
inprop: protection|talkid|subjectid|url|readable
rvprop: content|ids|flags|timestamp|user|comment|size
prop: revisions|info
titles: Википедия:Песочница
rvlimit: 1
----------------
Requesting API query from wikipedia:ru
getting huge siprop magicwords...
==== API action:query ====
meta: siteinfo
siprop: magicwords
----------------
Requesting API query from wikipedia:ru
The sandbox is still clean, no change necessary.
Done.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 17:18
Message:
It seem sandboxPage.editTime() is not valid. Please try 8564 and tell me
the -verbose result (and your sandbox you are working on)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066765&group_…
Bugs item #2968140, was opened at 2010-03-10 20:48
Message generated for change (Comment added) made by ganz-ru
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
Status: Open
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: JAn (jandudik)
Assigned to: xqt (xqt)
Summary: unrecognized dismbiguation templates
Initial Comment:
In http://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage there are some templates which are not as links. bot cannot recognize it and removes links to some disambiguations with templates like {{shiplist}} or {{surname}}.
But these articles are in some languages as disambigs, in some not. Maybe do something for recognize these as semi-disambiguations?
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-16 01:45
Message:
Example of incorrect work:
http://en.wikipedia.org/w/index.php?title=Gari%2C_Russia&action=historysubm…
. Page en:Gari,_Russia has {{SIA}} and it should be linked with
ru:Гари_(Россия) that is "true" disambiguation. But the bot
changed link into another, non-disambiguation page. And It wasn't in
"force" mode.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 22:24
Message:
on other sites these pages aren't marked as disambigs and this would lead
in removing interwiki links there.
There is a ways to not remove these links: do not use -force in
-autonomous mode!
Please be free to use the new -cleanup option instead I implemented this
week (and read the mail list). This does not touch disambig mismatches.
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-15 20:19
Message:
I join to the request of JAn. In en.wiki there is a special type of
disambigiations - {{SIA}}. When Script work automatically it concerns pages
with {{SIA}} as non-disambig and can remove correct interwikis.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Bugs item #3066934, was opened at 2010-09-15 11:12
Message generated for change (Comment added) made by djbarrett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: AttributeError: type object 'Timestamp' has no attribute 'st
Initial Comment:
category.py is throwing the error in the Summary. MediaWiki 1.15.4,
$ sudo python category.py move -from:"AABBCC" -to:"DD"
Traceback (most recent call last):
File "/usr/local/pywikipedia/pagegenerators.py", line 1238, in __iter__
for loaded_page in self.preload(somePages):
File "/usr/local/pywikipedia/pagegenerators.py", line 1257, in preload
pywikibot.getall(site, pagesThisSite)
File "/usr/local/pywikipedia/wikipedia.py", line 4208, in getall
_GetAll(site, pages, throttle, force).run()
File "/usr/local/pywikipedia/wikipedia.py", line 3887, in run
xml.sax.parseString(data, handler)
File "/usr/lib64/python2.4/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib64/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 303, in end_element
self._cont_handler.endElement(name)
File "/usr/local/pywikipedia/xmlreader.py", line 202, in endElement
self.callback(entry)
File "/usr/local/pywikipedia/wikipedia.py", line 3923, in oneDone
page2._versionhistory = [(revisionId, str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
type object 'Timestamp' has no attribute 'strptime'
Getting [[Category:AABBCC]]...
Getting [[Category:AABBCC]]...
Couldn't delete Category:AABBCC - not empty.
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8562, 2010/09/15, 12:54:46)
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
>Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 15:08
Message:
I'm sorry, our systems run CentOS Linux which comes with a specific Python
version that I do not have access to change.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 14:10
Message:
I am not shure but maybe py 2.4 isn't able to handle such class construct.
I'll revert this changes for now.
Could you try it with a newer python?
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:46
Message:
One more:
>>> wp.Timestamp.fromtimestampformat(t)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in
fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:45
Message:
OK trying again:
import time
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
Produces:
'20100915174350'
Then:
wp.Timestamp
still produces:
<class 'pywikibot.Timestamp'>
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 13:42
Message:
I don't know Python, so I am just repeating what you wrote. First I did:
$ python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I did:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
Produces:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'time' is not defined
wp.Timestamp.
Produces:
<class 'pywikibot.Timestamp'>
Then I did:
import sys
sys.path
Produces:
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages',
'/usr/local/pywikipedia/userinterfaces',
'/usr/local/pywikipedia/families']
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 13:34
Message:
I haven't found this error. Could you verify some things via idle:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
this should print sth like
'20100915172517'
wp.Timestamp.
Please hold this dot and you'll see availlable methods
wp.Timestamp.fromtimestampformat(t)
produces
Timestamp(2010, 9, 15, 17, 31, 53)
str(wp.Timestamp.fromtimestampformat(t))
produces
'2010-09-15T17:31:53Z'
Please also give me your sys.path()
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 11:22
Message:
The bug was introduced in revision 8562:
svn diff -c8562
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8561)
+++ wikipedia.py (revision 8562)
@@ -2559,8 +2559,11 @@
dataQuery = self._versionhistoryearliest
else:
thisHistoryDone = True
- elif not hasattr(self, '_versionhistory') or forceReload:
+ elif not hasattr(self, '_versionhistory') or forceReload or \
+ len(self._versionhistory) < revCount:
self._versionhistory = []
+ # ?? does not load if len(self._versionhistory) > revCount
+ # shouldn't it
elif getAll and len(self._versionhistory) == revCount:
# Cause a reload, or at least make the loop run
thisHistoryDone = False
@@ -3907,7 +3910,7 @@
successful = False
for page2 in self.pages:
if page2.sectionFreeTitle() == page.sectionFreeTitle():
- if not (hasattr(page2,'_contents') or
hasattr(page2,'_getexception')) or self.force:
+ if not (hasattr(page2,'_contents') or hasattr(page2,
'_getexception')) or self.force:
page2.editRestriction = entry.editRestriction
page2.moveRestriction = entry.moveRestriction
if editRestriction == 'autoconfirmed':
@@ -3917,6 +3920,7 @@
page2._ipedit = ipedit
page2._revisionId = revisionId
page2._editTime = timestamp
+ page2._versionhistory = [(revisionId,
str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
section = page2.section()
# Store the content
page2._contents = text
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 11:16
Message:
Note: the example did create category "DD" but did not recategorize the
page in the AABBCC category. (There is only one page in the category.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Bugs item #2968140, was opened at 2010-03-10 18:48
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
>Status: Open
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: JAn (jandudik)
Assigned to: xqt (xqt)
Summary: unrecognized dismbiguation templates
Initial Comment:
In http://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage there are some templates which are not as links. bot cannot recognize it and removes links to some disambiguations with templates like {{shiplist}} or {{surname}}.
But these articles are in some languages as disambigs, in some not. Maybe do something for recognize these as semi-disambiguations?
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 20:24
Message:
on other sites these pages aren't marked as disambigs and this would lead
in removing interwiki links there.
There is a ways to not remove these links: do not use -force in
-autonomous mode!
Please be free to use the new -cleanup option instead I implemented this
week (and read the mail list). This does not touch disambig mismatches.
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-15 18:19
Message:
I join to the request of JAn. In en.wiki there is a special type of
disambigiations - {{SIA}}. When Script work automatically it concerns pages
with {{SIA}} as non-disambig and can remove correct interwikis.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Bugs item #2968140, was opened at 2010-03-10 18:48
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: interwiki
Group: None
>Status: Pending
>Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: JAn (jandudik)
>Assigned to: xqt (xqt)
Summary: unrecognized dismbiguation templates
Initial Comment:
In http://en.wikipedia.org/wiki/MediaWiki:Disambiguationspage there are some templates which are not as links. bot cannot recognize it and removes links to some disambiguations with templates like {{shiplist}} or {{surname}}.
But these articles are in some languages as disambigs, in some not. Maybe do something for recognize these as semi-disambiguations?
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2010-09-15 20:24
Message:
on other sites these pages aren't marked as disambigs and this would lead
in removing interwiki links there.
There is a ways to not remove these links: do not use -force in
-autonomous mode!
Please be free to use the new -cleanup option instead I implemented this
week (and read the mail list). This does not touch disambig mismatches.
----------------------------------------------------------------------
Comment By: GanZ (ganz-ru)
Date: 2010-09-15 18:19
Message:
I join to the request of JAn. In en.wiki there is a special type of
disambigiations - {{SIA}}. When Script work automatically it concerns pages
with {{SIA}} as non-disambig and can remove correct interwikis.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=2968140&group_…
Bugs item #3066934, was opened at 2010-09-15 17:12
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: General
Group: None
Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: AttributeError: type object 'Timestamp' has no attribute 'st
Initial Comment:
category.py is throwing the error in the Summary. MediaWiki 1.15.4,
$ sudo python category.py move -from:"AABBCC" -to:"DD"
Traceback (most recent call last):
File "/usr/local/pywikipedia/pagegenerators.py", line 1238, in __iter__
for loaded_page in self.preload(somePages):
File "/usr/local/pywikipedia/pagegenerators.py", line 1257, in preload
pywikibot.getall(site, pagesThisSite)
File "/usr/local/pywikipedia/wikipedia.py", line 4208, in getall
_GetAll(site, pages, throttle, force).run()
File "/usr/local/pywikipedia/wikipedia.py", line 3887, in run
xml.sax.parseString(data, handler)
File "/usr/lib64/python2.4/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib64/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 303, in end_element
self._cont_handler.endElement(name)
File "/usr/local/pywikipedia/xmlreader.py", line 202, in endElement
self.callback(entry)
File "/usr/local/pywikipedia/wikipedia.py", line 3923, in oneDone
page2._versionhistory = [(revisionId, str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
type object 'Timestamp' has no attribute 'strptime'
Getting [[Category:AABBCC]]...
Getting [[Category:AABBCC]]...
Couldn't delete Category:AABBCC - not empty.
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8562, 2010/09/15, 12:54:46)
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 20:10
Message:
I am not shure but maybe py 2.4 isn't able to handle such class construct.
I'll revert this changes for now.
Could you try it with a newer python?
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:46
Message:
One more:
>>> wp.Timestamp.fromtimestampformat(t)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in
fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:45
Message:
OK trying again:
import time
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
Produces:
'20100915174350'
Then:
wp.Timestamp
still produces:
<class 'pywikibot.Timestamp'>
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:42
Message:
I don't know Python, so I am just repeating what you wrote. First I did:
$ python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I did:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
Produces:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'time' is not defined
wp.Timestamp.
Produces:
<class 'pywikibot.Timestamp'>
Then I did:
import sys
sys.path
Produces:
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages',
'/usr/local/pywikipedia/userinterfaces',
'/usr/local/pywikipedia/families']
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 19:34
Message:
I haven't found this error. Could you verify some things via idle:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
this should print sth like
'20100915172517'
wp.Timestamp.
Please hold this dot and you'll see availlable methods
wp.Timestamp.fromtimestampformat(t)
produces
Timestamp(2010, 9, 15, 17, 31, 53)
str(wp.Timestamp.fromtimestampformat(t))
produces
'2010-09-15T17:31:53Z'
Please also give me your sys.path()
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:22
Message:
The bug was introduced in revision 8562:
svn diff -c8562
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8561)
+++ wikipedia.py (revision 8562)
@@ -2559,8 +2559,11 @@
dataQuery = self._versionhistoryearliest
else:
thisHistoryDone = True
- elif not hasattr(self, '_versionhistory') or forceReload:
+ elif not hasattr(self, '_versionhistory') or forceReload or \
+ len(self._versionhistory) < revCount:
self._versionhistory = []
+ # ?? does not load if len(self._versionhistory) > revCount
+ # shouldn't it
elif getAll and len(self._versionhistory) == revCount:
# Cause a reload, or at least make the loop run
thisHistoryDone = False
@@ -3907,7 +3910,7 @@
successful = False
for page2 in self.pages:
if page2.sectionFreeTitle() == page.sectionFreeTitle():
- if not (hasattr(page2,'_contents') or
hasattr(page2,'_getexception')) or self.force:
+ if not (hasattr(page2,'_contents') or hasattr(page2,
'_getexception')) or self.force:
page2.editRestriction = entry.editRestriction
page2.moveRestriction = entry.moveRestriction
if editRestriction == 'autoconfirmed':
@@ -3917,6 +3920,7 @@
page2._ipedit = ipedit
page2._revisionId = revisionId
page2._editTime = timestamp
+ page2._versionhistory = [(revisionId,
str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
section = page2.section()
# Store the content
page2._contents = text
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:16
Message:
Note: the example did create category "DD" but did not recategorize the
page in the AABBCC category. (There is only one page in the category.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Bugs item #3066934, was opened at 2010-09-15 17:12
Message generated for change (Settings changed) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: category
Group: None
>Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: AttributeError: type object 'Timestamp' has no attribute 'st
Initial Comment:
category.py is throwing the error in the Summary. MediaWiki 1.15.4,
$ sudo python category.py move -from:"AABBCC" -to:"DD"
Traceback (most recent call last):
File "/usr/local/pywikipedia/pagegenerators.py", line 1238, in __iter__
for loaded_page in self.preload(somePages):
File "/usr/local/pywikipedia/pagegenerators.py", line 1257, in preload
pywikibot.getall(site, pagesThisSite)
File "/usr/local/pywikipedia/wikipedia.py", line 4208, in getall
_GetAll(site, pages, throttle, force).run()
File "/usr/local/pywikipedia/wikipedia.py", line 3887, in run
xml.sax.parseString(data, handler)
File "/usr/lib64/python2.4/xml/sax/__init__.py", line 49, in parseString
parser.parse(inpsrc)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib64/python2.4/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib64/python2.4/xml/sax/expatreader.py", line 303, in end_element
self._cont_handler.endElement(name)
File "/usr/local/pywikipedia/xmlreader.py", line 202, in endElement
self.callback(entry)
File "/usr/local/pywikipedia/wikipedia.py", line 3923, in oneDone
page2._versionhistory = [(revisionId, str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
type object 'Timestamp' has no attribute 'strptime'
Getting [[Category:AABBCC]]...
Getting [[Category:AABBCC]]...
Couldn't delete Category:AABBCC - not empty.
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8562, 2010/09/15, 12:54:46)
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
config-settings:
use_api = True
use_api_login = True
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 20:10
Message:
I am not shure but maybe py 2.4 isn't able to handle such class construct.
I'll revert this changes for now.
Could you try it with a newer python?
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:46
Message:
One more:
>>> wp.Timestamp.fromtimestampformat(t)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 47, in
fromtimestampformat
return cls.strptime(ts, cls.mediawikiTSFormat)
AttributeError: type object 'Timestamp' has no attribute 'strptime'
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:45
Message:
OK trying again:
import time
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
Produces:
'20100915174350'
Then:
wp.Timestamp
still produces:
<class 'pywikibot.Timestamp'>
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 19:42
Message:
I don't know Python, so I am just repeating what you wrote. First I did:
$ python
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Then I did:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
Produces:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'time' is not defined
wp.Timestamp.
Produces:
<class 'pywikibot.Timestamp'>
Then I did:
import sys
sys.path
Produces:
['', '/usr/lib64/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages',
'/usr/lib64/python2.4/site-packages/gtk-2.0',
'/usr/lib/python2.4/site-packages',
'/usr/local/pywikipedia/userinterfaces',
'/usr/local/pywikipedia/families']
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2010-09-15 19:34
Message:
I haven't found this error. Could you verify some things via idle:
import wikipedia as wp
t = time.strftime("%Y%m%d%H%M%S",time.gmtime())
t
this should print sth like
'20100915172517'
wp.Timestamp.
Please hold this dot and you'll see availlable methods
wp.Timestamp.fromtimestampformat(t)
produces
Timestamp(2010, 9, 15, 17, 31, 53)
str(wp.Timestamp.fromtimestampformat(t))
produces
'2010-09-15T17:31:53Z'
Please also give me your sys.path()
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:22
Message:
The bug was introduced in revision 8562:
svn diff -c8562
Index: wikipedia.py
===================================================================
--- wikipedia.py (revision 8561)
+++ wikipedia.py (revision 8562)
@@ -2559,8 +2559,11 @@
dataQuery = self._versionhistoryearliest
else:
thisHistoryDone = True
- elif not hasattr(self, '_versionhistory') or forceReload:
+ elif not hasattr(self, '_versionhistory') or forceReload or \
+ len(self._versionhistory) < revCount:
self._versionhistory = []
+ # ?? does not load if len(self._versionhistory) > revCount
+ # shouldn't it
elif getAll and len(self._versionhistory) == revCount:
# Cause a reload, or at least make the loop run
thisHistoryDone = False
@@ -3907,7 +3910,7 @@
successful = False
for page2 in self.pages:
if page2.sectionFreeTitle() == page.sectionFreeTitle():
- if not (hasattr(page2,'_contents') or
hasattr(page2,'_getexception')) or self.force:
+ if not (hasattr(page2,'_contents') or hasattr(page2,
'_getexception')) or self.force:
page2.editRestriction = entry.editRestriction
page2.moveRestriction = entry.moveRestriction
if editRestriction == 'autoconfirmed':
@@ -3917,6 +3920,7 @@
page2._ipedit = ipedit
page2._revisionId = revisionId
page2._editTime = timestamp
+ page2._versionhistory = [(revisionId,
str(Timestamp.fromtimestampformat(timestamp)), username, entry.comment)]
section = page2.section()
# Store the content
page2._contents = text
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date: 2010-09-15 17:16
Message:
Note: the example did create category "DD" but did not recategorize the
page in the AABBCC category. (There is only one page in the category.)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3066934&group_…