Hello,
There is a big issue with the removal of empty sections by cosmetic changes.
https://gerrit.wikimedia.org/r/#/c/433914/6/pywikibot/cosmetic_changes.py
It removes also non-empty sections, that starts and ends with HTML comments See : https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t%C3% A9l%C3%A9vis%C3%A9es_diffus%C3%A9es_sur_American_Broadcast ing_Company&diff=prev&oldid=148771218
This bug is, I think, critical because all changes with CC activated must be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do it.
Regard
Hi, It looks similar to T195075[1] which was marked was resolved almost two days ago.
[1]: https://phabricator.wikimedia.org/T195075
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
Hello,
There is a big issue with the removal of empty sections by cosmetic
changes.
https://gerrit.wikimedia.org/r/#/c/433914/6/pywikibot/cosmetic_changes.py
It removes also non-empty sections, that starts and ends with HTML
comments
See :
https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t%C3%A9l%C3%A9vis%C3%...
This bug is, I think, critical because all changes with CC activated must
be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do it.
Regard _______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
Hello,
It's possible, it's my third attempt to report this bug, on 3 different lists.
Thank you for the information.
Regards
Hercule
2018-05-29 15:54 GMT+02:00 Dalba dalba.wiki@gmail.com:
Hi, It looks similar to T195075[1] which was marked was resolved almost two days ago.
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
Hello,
There is a big issue with the removal of empty sections by cosmetic
changes.
cosmetic_changes.py
It removes also non-empty sections, that starts and ends with HTML
comments
See :
https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t% C3%A9l%C3%A9vis%C3%A9es_diffus%C3%A9es_sur_American_ Broadcasting_Company&diff=prev&oldid=148771218
This bug is, I think, critical because all changes with CC activated must
be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do it.
Regard _______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
I made an update of my pywikibot-core repository ( /usr/bin/git pullall) and now I have an error when editing my User page for tests :
Exception in thread Put-Thread: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/__init__.py", line 1409, in async_manager request(*args, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/page.py", line 109, in handle func(self, *args, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/page.py", line 1278, in _save summary = self._cosmetic_changes_hook(summary) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/page.py", line 1325, in _cosmetic_changes_hook self.text = ccToolkit.change(old) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/cosmetic_changes.py", line 301, in change new_text = self._change(text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/cosmetic_changes.py", line 295, in _change text = self.safe_execute(method, text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/cosmetic_changes.py", line 282, in safe_execute result = method(text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi kibot/cosmetic_changes.py", line 662, in removeEmptySections stripped_text = str(text) UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in position 78: ordinal not in range(128)
Do I need to make something else ?
2018-05-29 15:58 GMT+02:00 Hercule Antoine hercule.wikipedia@gmail.com:
Hello,
It's possible, it's my third attempt to report this bug, on 3 different lists.
Thank you for the information.
Regards
Hercule
2018-05-29 15:54 GMT+02:00 Dalba dalba.wiki@gmail.com:
Hi, It looks similar to T195075[1] which was marked was resolved almost two days ago.
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
Hello,
There is a big issue with the removal of empty sections by cosmetic
changes.
https://gerrit.wikimedia.org/r/#/c/433914/6/pywikibot/cosmet
ic_changes.py
It removes also non-empty sections, that starts and ends with HTML
comments
See :
https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t%C3% A9l%C3%A9vis%C3%A9es_diffus%C3%A9es_sur_American_Broadcast ing_Company&diff=prev&oldid=148771218
This bug is, I think, critical because all changes with CC activated
must be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do it.
Regard _______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
Seems like another bug. I'm not a python2 user and not sure why the code is trying to convert the text to byte-string there. Could you try applying the following change and see what happens?
--- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -659,7 +659,7 @@ class CosmeticChangesToolkit(object): for template in skip_templates[self.site.code]: skip_regexes.append( re.compile(r'{{\s*%s\s*}}' % template, re.I)) - stripped_text = str(text) + stripped_text = text for reg in skip_regexes: stripped_text = reg.sub(r'', stripped_text)
On Tue, May 29, 2018 at 6:40 PM Hercule Antoinehercule.wikipedia@gmail.com wrote:
I made an update of my pywikibot-core repository ( /usr/bin/git pullall)
and now I have an error when editing my User page for tests :
Exception in thread Put-Thread: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/__init__.py", line 1409, in async_manager
request(*args, **kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 109, in handle
func(self, *args, **kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 1278, in _save
summary = self._cosmetic_changes_hook(summary) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 1325, in _cosmetic_changes_hook
self.text = ccToolkit.change(old) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 301, in change
new_text = self._change(text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 295, in _change
text = self.safe_execute(method, text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 282, in safe_execute
result = method(text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 662, in removeEmptySections
stripped_text = str(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in
position 78: ordinal not in range(128)
Do I need to make something else ?
2018-05-29 15:58 GMT+02:00 Hercule Antoine hercule.wikipedia@gmail.com:
Hello,
It's possible, it's my third attempt to report this bug, on 3 different
lists.
Thank you for the information.
Regards
Hercule
2018-05-29 15:54 GMT+02:00 Dalba dalba.wiki@gmail.com:
Hi, It looks similar to T195075[1] which was marked was resolved almost two days ago.
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
Hello,
There is a big issue with the removal of empty sections by cosmetic
changes.
https://gerrit.wikimedia.org/r/#/c/433914/6/pywikibot/cosmetic_changes.py
It removes also non-empty sections, that starts and ends with HTML
comments
See :
https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t%C3%A9l%C3%A9vis%C3%...
This bug is, I think, critical because all changes with CC activated
must
be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do
it.
Regard _______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
I don't know how to edit the code. I'm a user of the existing scripts, with no changes.
I run my bot form WMFLabs.
Regards
Hercule
________________________________ De : pywikibot pywikibot-bounces@lists.wikimedia.org de la part de Dalba dalba.wiki@gmail.com Envoyé : mardi 29 mai 2018 16:42 À : Pywikibot discussion list Objet : Re: [pywikibot] Bug on cosmetic changes
Seems like another bug. I'm not a python2 user and not sure why the code is trying to convert the text to byte-string there. Could you try applying the following change and see what happens?
--- a/pywikibot/cosmetic_changes.py +++ b/pywikibot/cosmetic_changes.py @@ -659,7 +659,7 @@ class CosmeticChangesToolkit(object): for template in skip_templates[self.site.code]: skip_regexes.append( re.compile(r'{{\s*%s\s*}}' % template, re.I)) - stripped_text = str(text) + stripped_text = text for reg in skip_regexes: stripped_text = reg.sub(r'', stripped_text)
On Tue, May 29, 2018 at 6:40 PM Hercule Antoinehercule.wikipedia@gmail.com wrote:
I made an update of my pywikibot-core repository ( /usr/bin/git pullall)
and now I have an error when editing my User page for tests :
Exception in thread Put-Thread: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/__init__.py", line 1409, in async_manager
request(*args, **kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 109, in handle
func(self, *args, **kwargs) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 1278, in _save
summary = self._cosmetic_changes_hook(summary) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/page.py", line 1325, in _cosmetic_changes_hook
self.text = ccToolkit.change(old) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 301, in change
new_text = self._change(text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 295, in _change
text = self.safe_execute(method, text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 282, in safe_execute
result = method(text) File
"/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywi
kibot/cosmetic_changes.py", line 662, in removeEmptySections
stripped_text = str(text)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in
position 78: ordinal not in range(128)
Do I need to make something else ?
2018-05-29 15:58 GMT+02:00 Hercule Antoine hercule.wikipedia@gmail.com:
Hello,
It's possible, it's my third attempt to report this bug, on 3 different
lists.
Thank you for the information.
Regards
Hercule
2018-05-29 15:54 GMT+02:00 Dalba dalba.wiki@gmail.com:
Hi, It looks similar to T195075[1] which was marked was resolved almost two days ago.
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
On Tue, May 29, 2018 at 6:12 PM Hercule Antoine hercule.wikipedia@gmail.com wrote:
Hello,
There is a big issue with the removal of empty sections by cosmetic
changes.
https://gerrit.wikimedia.org/r/#/c/433914/6/pywikibot/cosmetic_changes.py
It removes also non-empty sections, that starts and ends with HTML
comments
See :
https://fr.wikipedia.org/w/index.php?title=S%C3%A9ries_t%C3%A9l%C3%A9vis%C3%...
This bug is, I think, critical because all changes with CC activated
must
be verified.
I don't think that CC should remove comments added by editors.
I tried to open a bug on phabricator but don't understand how to do
it.
Regard _______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
_______________________________________________ pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot
That's OK. I've sent a patch for review at https://gerrit.wikimedia.org/r/#/c/436028/ .
On Tue, May 29, 2018 at 7:18 PM Antoine Delarue antoinedelarue@hotmail.com wrote:
I don't know how to edit the code. I'm a user of the existing scripts,
with no changes.
I run my bot form WMFLabs.
Regards
Hercule
Hello,
I don't understand why the removal of entire sections, even if empty, is considered as ''cosmetic change''. Before this evolutions the CC had no change on the render of the page.
There are still some bugs because of this evolution.
When a title of section is immediatly followed by an HTML comment the script crash
exemple : https://fr.wikipedia.org/w/index.php?title=Pr%C3%A9vost&diff=151365252&a...
log : ERROR: Fatal error: Traceback (most recent call last): File "/data/project/herculebot/pywikibot-core/scripts/template.py", line 382, in <module> main() File "/data/project/herculebot/pywikibot-core/scripts/template.py", line 377, in main bot.run() File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/scripts/replace.py", line 833, in run callback=self._replace_sync_callback, quiet=True) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/tools/__init__.py", line 1488, in wrapper return obj(*__args, **__kw) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/tools/__init__.py", line 1488, in wrapper return obj(*__args, **__kw) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/page.py", line 1275, in save cc=apply_cosmetic_changes, quiet=quiet, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/page.py", line 127, in wrapper handle(func, self, *args, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/page.py", line 109, in handle func(self, *args, **kwargs) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/page.py", line 1283, in _save summary = self._cosmetic_changes_hook(summary) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/page.py", line 1329, in _cosmetic_changes_hook self.text = cc_toolkit.change(old) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/cosmetic_changes.py", line 301, in change new_text = self._change(text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/cosmetic_changes.py", line 295, in _change text = self.safe_execute(method, text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/cosmetic_changes.py", line 282, in safe_execute result = method(text) File "/mnt/nfs/labstore-secondary-tools-project/herculebot/pywikibot-core/pywikibot/cosmetic_changes.py", line 696, in removeEmptySections current_heading = sections[i][0]
Regards
Hercule
2018-05-29 17:07 GMT+02:00 Dalba dalba.wiki@gmail.com:
That's OK. I've sent a patch for review at https://gerrit.wikimedia.org/r/#/c/436028/ .
On Tue, May 29, 2018 at 7:18 PM Antoine Delarue < antoinedelarue@hotmail.com> wrote:
I don't know how to edit the code. I'm a user of the existing scripts,
with no changes.
I run my bot form WMFLabs.
Regards
Hercule
pywikibot mailing list pywikibot@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikibot