Bugs item #3536561, was opened at 2012-06-20 04:10
Message generated for change (Comment added) made by jandudik
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536561&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: None
Group: None
Status: Closed
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: JAn (jandudik)
Assigned to: xqt (xqt)
Summary: -movelog
Initial Comment:
Option -movelog behaviors incorrectly. When I give interwiki.py -movelog bot works with titles *before* moving, which are in most cases deleted. It should work with *new* titles...
----------------------------------------------------------------------
Comment By: JAn (jandudik)
Date: 2012-06-21 00:00
Message:
-initialredirect does not work for deleted source pages
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 04:46
Message:
just use -movelog -initialredirect
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536561&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 23:20
Message:
Thanks for testing. The lenght calculation was wrong. I've corrected it
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 22:04
Message:
Line 787 doesnt return the title, it returns the whole page (self) when you
print the object and not the title it gets converted there. I used a log to
confirm that the title was UTF-8 before filling this bug,
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 21:48
Message:
I do not see a conversion by the exception. I converted the title from html
entities to unicode in my last commit
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 20:55
Message:
those are the thai parts of the page title that are being converted when
the exception is being thrown
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 20:53
Message:
Where are the html entities from? Are they part of the flickr page?
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by betacommand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: betacommand (betacommand)
Date: 2012-06-20 22:04
Message:
Line 787 doesnt return the title, it returns the whole page (self) when you
print the object and not the title it gets converted there. I used a log to
confirm that the title was UTF-8 before filling this bug,
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 21:48
Message:
I do not see a conversion by the exception. I converted the title from html
entities to unicode in my last commit
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 20:55
Message:
those are the thai parts of the page title that are being converted when
the exception is being thrown
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 20:53
Message:
Where are the html entities from? Are they part of the flickr page?
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 21:48
Message:
I do not see a conversion by the exception. I converted the title from html
entities to unicode in my last commit
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 20:55
Message:
those are the thai parts of the page title that are being converted when
the exception is being thrown
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 20:53
Message:
Where are the html entities from? Are they part of the flickr page?
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by betacommand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: betacommand (betacommand)
Date: 2012-06-20 20:55
Message:
those are the thai parts of the page title that are being converted when
the exception is being thrown
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 20:53
Message:
Where are the html entities from? Are they part of the flickr page?
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 20:53
Message:
Where are the html entities from? Are they part of the flickr page?
----------------------------------------------------------------------
Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3536400, was opened at 2012-06-19 12:52
Message generated for change (Comment added) made by betacommand
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&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: None
Group: None
>Status: Open
>Resolution: None
Priority: 5
Private: No
Submitted By: betacommand (betacommand)
Assigned to: xqt (xqt)
Summary: Invalid Title in flickrripper
Initial Comment:
Betacommand multichill: I know you wrote flickrripper.py and Im trying to fix an issue with it, and thought it might be easier for you to fix
Betacommand lines 157-161 where it grabs the description and uses it for the file name
Betacommand when you start working with non-latin descriptions it doesnt handle multi-byte characters well, it ended up with a title over 320 bytes
Betacommand the max mediawiki lets you have is 255
multichill Lol
Betacommand multichill: really rather a pain
multichill So the check shoul probably encode it and than see how long it is?
Betacommand correct
multichill Or just lower the limit a bit?
Betacommand thai letters for example are 3 bytes
Betacommand notes it was discovered with flickrripper.py -autonomous -user_id:40561337@N07 -addcategory:"Files from Abhisit Vejjajiva Flickr stream"
multichill Betacommand: Could you file a bug for this?
Betacommand multichill: you would need to cut it down to 85 to be safe
----------------------------------------------------------------------
>Comment By: betacommand (betacommand)
Date: 2012-06-20 16:45
Message:
Issue still not fixed, actually its worse
C:\Dev\SVN\pywikipedia>flickrripper.py -autonomous -user_id:40561337@N07
-addcat
egory:"Files from Abhisit Vejjajiva Flickr stream"
5703017392
Traceback (most recent call last):
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 609, in <module>
main()
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 599, in main
removeCategories, autonomous)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 257, in
processPhoto
filename = getFilename(photoInfo)
File "C:\Dev\SVN\pywikipedia\flickrripper.py", line 172, in
getFilename
% (title, project, username)).exists():
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 1284, in exists
self.get()
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 705, in get
expandtemplates = expandtemplates)
File "C:\Dev\SVN\pywikipedia\wikipedia.py", line 787, in
_getEditPage
raise BadTitle('BadTitle: %s' % self)
pywikibot.exceptions.BadTitle: BadTitle:
[[commons:File:นาย
585;รัฐมนตรี
แลū
2;คณะเดินทางอ&
#3629;กจากกรุงจา#
85;าร์ตา
สาธารณ
;รัฐอินโดนีเ&#
3595;ียกลับยังปũ
9;ะเทศไทย
วันอ
าทิตย์ที่ 8
พฤ
ษภาคม พ.ศ.2554 (Photographer
attached
to the Prime Minister of the Kingdom of Thailand (H.E.Mr.Abhisit
Vejjajiva) , Pe
erapat Wimolrungkarat -
พีรพัฒน์
วิมลรังครัต&#
3609;์) @is50mm - Flickr - Abhisit Vejjajiva.jpg]]
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 07:17
Message:
fix committed in r10387, please check
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 00:08
Message:
an idea for getFilename (could anybody test it whether it works)
if not title:
#find the max length for a mw title
maxBytes = 240 - len(project.encode('utf-8')) \
- len(username.encode('utf-8'))
description = photoInfo.find('photo').find('description').text
if description:
descBytes = len(description.encode('utf-8'))
if descBytes > maxBytes:
# maybe we cut more than needed, anyway we do it
items = max(0, len(description) - maxBytes + descBytes)
description = description[:items]
title = cleanUpTitle(description)
else:
title = u''
# Should probably have the id of the photo as last resort.
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-19 23:03
Message:
I guess the title is cutted by mw and not the slice operator since it works
correct for unicode strings. len() also gives the number of characters not
the number bytes. Do we have any size(object) method?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3536400&group_…
Bugs item #3535184, was opened at 2012-06-14 05:11
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&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: rewrite
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: xqt (xqt)
>Assigned to: xqt (xqt)
Summary: WARNING: Logged in as IP insead of Bot
Initial Comment:
checking out the rewrite branch and copying the user files I runned touch.py and got an error as follows:
C:\pwb\rewrite>pwb.py touch user:xqt/Test -v -debug
Pywikipediabot r10326 2012-06-08 12:08:53Z
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
Retrieving 1 pages from wikipedia:de.
Starting 1 threads...
Found 1 wikipedia:de processes running, including this one.
WARNING: Logged in as 199.199.199.199 instead of Xqbot
Dropped throttle(s).
Traceback (most recent call last):
File "C:\pwb\rewrite\pwb.py", line 42, in <module>
execfile(sys.argv[0])
File "C:\pwb\rewrite\scripts\touch.py", line 99, in <module>
main()
File "C:\pwb\rewrite\scripts\touch.py", line 94, in main
bot.run()
File "C:\pwb\rewrite\scripts\touch.py", line 47, in run
page.save("Pywikibot touch script")
File "C:\pwb\rewrite\pywikibot\page.py", line 735, in save
if not force and not self.botMayEdit():
File "C:\pwb\rewrite\pywikibot\page.py", line 670, in botMayEdit
username = self.site.user()
File "C:\pwb\rewrite\pywikibot\site.py", line 177, in user
elif self.logged_in(False):
File "C:\pwb\rewrite\pywikibot\site.py", line 692, in logged_in
raise
TypeError: exceptions must be old-style classes or derived from BaseException, n
ot NoneType
Waiting for threads to finish...
All threads finished.
Dropped throttle(s).
C:\pwb\rewrite>
I've added the raise to get the traceback of the statement.
version.py:
Pywikibot branches/rewrite/ (r10359, 2012/06/12, 16:46:30)
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
unicode test: ok
C:\pwb\rewrite>
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 15:48
Message:
enable explicit login with r10395
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 14:03
Message:
Another try I do not understand:
>>> import pwb
>>> import pywikibot as wp
>>> s = wp.getSite()
>>> s.logged_in()
False
>>> s._loginstatus
-3
>>> p = wp.Page(s, 'user:xqt/Test')
>>> from pywikibot import config2 as cf
>>> cf.cosmetic_changes = False
>>> p.text += '\n Test'
>>> s._loginstatus
-3
>>> s.logged_in()
True
>>>
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 13:56
Message:
The next strangeness about login:
running
pwb.py login
gives
Not logged in on wikipedia:de
But changing a page with
basic.py user:xqt/Test
shows the bor was logged in:
http://de.wikipedia.org/w/index.php?title=Benutzer%3AXqt%2FTest&diff=104620…
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2012-06-14 09:29
Message:
This appears to be a result of
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10284, which removed
code that automatically logged you in when you accessed the API. A
work-around is to add an explicit "site.login()" call to every script.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&group_…
Bugs item #3535184, was opened at 2012-06-14 05:11
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&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: rewrite
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: xqt (xqt)
Assigned to: Merlijn S. van Deen (valhallasw)
Summary: WARNING: Logged in as IP insead of Bot
Initial Comment:
checking out the rewrite branch and copying the user files I runned touch.py and got an error as follows:
C:\pwb\rewrite>pwb.py touch user:xqt/Test -v -debug
Pywikipediabot r10326 2012-06-08 12:08:53Z
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
Retrieving 1 pages from wikipedia:de.
Starting 1 threads...
Found 1 wikipedia:de processes running, including this one.
WARNING: Logged in as 199.199.199.199 instead of Xqbot
Dropped throttle(s).
Traceback (most recent call last):
File "C:\pwb\rewrite\pwb.py", line 42, in <module>
execfile(sys.argv[0])
File "C:\pwb\rewrite\scripts\touch.py", line 99, in <module>
main()
File "C:\pwb\rewrite\scripts\touch.py", line 94, in main
bot.run()
File "C:\pwb\rewrite\scripts\touch.py", line 47, in run
page.save("Pywikibot touch script")
File "C:\pwb\rewrite\pywikibot\page.py", line 735, in save
if not force and not self.botMayEdit():
File "C:\pwb\rewrite\pywikibot\page.py", line 670, in botMayEdit
username = self.site.user()
File "C:\pwb\rewrite\pywikibot\site.py", line 177, in user
elif self.logged_in(False):
File "C:\pwb\rewrite\pywikibot\site.py", line 692, in logged_in
raise
TypeError: exceptions must be old-style classes or derived from BaseException, n
ot NoneType
Waiting for threads to finish...
All threads finished.
Dropped throttle(s).
C:\pwb\rewrite>
I've added the raise to get the traceback of the statement.
version.py:
Pywikibot branches/rewrite/ (r10359, 2012/06/12, 16:46:30)
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
unicode test: ok
C:\pwb\rewrite>
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 14:03
Message:
Another try I do not understand:
>>> import pwb
>>> import pywikibot as wp
>>> s = wp.getSite()
>>> s.logged_in()
False
>>> s._loginstatus
-3
>>> p = wp.Page(s, 'user:xqt/Test')
>>> from pywikibot import config2 as cf
>>> cf.cosmetic_changes = False
>>> p.text += '\n Test'
>>> s._loginstatus
-3
>>> s.logged_in()
True
>>>
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2012-06-20 13:56
Message:
The next strangeness about login:
running
pwb.py login
gives
Not logged in on wikipedia:de
But changing a page with
basic.py user:xqt/Test
shows the bor was logged in:
http://de.wikipedia.org/w/index.php?title=Benutzer%3AXqt%2FTest&diff=104620…
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2012-06-14 09:29
Message:
This appears to be a result of
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10284, which removed
code that automatically logged you in when you accessed the API. A
work-around is to add an explicit "site.login()" call to every script.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&group_…
Bugs item #3535184, was opened at 2012-06-14 05:11
Message generated for change (Comment added) made by xqt
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&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: rewrite
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: xqt (xqt)
Assigned to: Merlijn S. van Deen (valhallasw)
Summary: WARNING: Logged in as IP insead of Bot
Initial Comment:
checking out the rewrite branch and copying the user files I runned touch.py and got an error as follows:
C:\pwb\rewrite>pwb.py touch user:xqt/Test -v -debug
Pywikipediabot r10326 2012-06-08 12:08:53Z
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
Retrieving 1 pages from wikipedia:de.
Starting 1 threads...
Found 1 wikipedia:de processes running, including this one.
WARNING: Logged in as 199.199.199.199 instead of Xqbot
Dropped throttle(s).
Traceback (most recent call last):
File "C:\pwb\rewrite\pwb.py", line 42, in <module>
execfile(sys.argv[0])
File "C:\pwb\rewrite\scripts\touch.py", line 99, in <module>
main()
File "C:\pwb\rewrite\scripts\touch.py", line 94, in main
bot.run()
File "C:\pwb\rewrite\scripts\touch.py", line 47, in run
page.save("Pywikibot touch script")
File "C:\pwb\rewrite\pywikibot\page.py", line 735, in save
if not force and not self.botMayEdit():
File "C:\pwb\rewrite\pywikibot\page.py", line 670, in botMayEdit
username = self.site.user()
File "C:\pwb\rewrite\pywikibot\site.py", line 177, in user
elif self.logged_in(False):
File "C:\pwb\rewrite\pywikibot\site.py", line 692, in logged_in
raise
TypeError: exceptions must be old-style classes or derived from BaseException, n
ot NoneType
Waiting for threads to finish...
All threads finished.
Dropped throttle(s).
C:\pwb\rewrite>
I've added the raise to get the traceback of the statement.
version.py:
Pywikibot branches/rewrite/ (r10359, 2012/06/12, 16:46:30)
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
unicode test: ok
C:\pwb\rewrite>
----------------------------------------------------------------------
>Comment By: xqt (xqt)
Date: 2012-06-20 13:56
Message:
The next strangeness about login:
running
pwb.py login
gives
Not logged in on wikipedia:de
But changing a page with
basic.py user:xqt/Test
shows the bor was logged in:
http://de.wikipedia.org/w/index.php?title=Benutzer%3AXqt%2FTest&diff=104620…
----------------------------------------------------------------------
Comment By: Russell Blau (russblau)
Date: 2012-06-14 09:29
Message:
This appears to be a result of
http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10284, which removed
code that automatically logged you in when you accessed the API. A
work-around is to add an explicit "site.login()" call to every script.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3535184&group_…