New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode in page title #4

Open
framawiki opened this Issue Sep 2, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@framawiki
Contributor

framawiki commented Sep 2, 2016

Hi, I can't use special chars like "Pages oubliées" in page title for frwiki. It works on other fields.

Traceback (most recent call last):
  File "main.py", line 63, in <module>
    main(sys.argv)
  File "main.py", line 17, in main
    method()
  File "main.py", line 27, in forgotten_articles
    self.rep.forgotten_articles()
  File "/data/project/framabot/test/database-reports/reports.py", line 80, in forgotten_articles
    self.publish_report( 'forgotten-articles-page-title', text )
  File "/data/project/framabot/test/database-reports/reports.py", line 414, in publish_report
    page = self.site.Pages[ reports_base_url + report_title ]
  File "/usr/lib/python2.7/dist-packages/mwclient/listing.py", line 197, in __getitem__
    return self.get(name, None)
  File "/usr/lib/python2.7/dist-packages/mwclient/listing.py", line 209, in get
    namespace = self.guess_namespace(name)
  File "/usr/lib/python2.7/dist-packages/mwclient/listing.py", line 220, in guess_namespace
    if name.startswith(u'%s:' % self.site.namespaces[ns].replace(' ', '_')):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 50: ordinal not in range(128)

Thanks

Niharika29 pushed a commit that referenced this issue Sep 7, 2016

@Niharika29

This comment has been minimized.

Collaborator

Niharika29 commented Sep 8, 2016

Did your commit fix this issue or can you still reproduce it?

@framawiki

This comment has been minimized.

Contributor

framawiki commented Sep 8, 2016

No, I tried unsuccessfully. On page content it do it correctly, but it don't work only on page title. I have voluntarily used bad titles in 07489bc.

framawiki added a commit to framawiki/database-reports that referenced this issue Sep 20, 2016

framawiki added a commit to framawiki/database-reports that referenced this issue Sep 20, 2016

@framawiki

This comment has been minimized.

Contributor

framawiki commented Sep 20, 2016

Temporary fix in #12 , by use HTML chars.

@framawiki framawiki changed the title from Unicode i18n dict to Unicode in page title Feb 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment