Seems like it does not work anymore with keys without "umlaut"

Bug #326915 reported by espressodoppio
2
Affects Status Importance Assigned to Milestone
gedit-Zotero-Plugin
Fix Committed
Critical
Frederik Elwert

Bug Description

When inserting titles without "umlaut" in the key it does not work anymore:

SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <m:updateResponse xmlns:m="http://www.zotero.org/namespaces/SOAP">
      <output xmlns="http://purl.org/net/xbiblio/csl">!:!:0:{"sort"::true,"citationItems"::[{"itemID"::7163}]}:schwerdtfeger_1997</output>
    </m:updateResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:root:['!', '!', '0', {u'sort': True, u'citationItems': [{u'itemID': 7163}]}, 'schwerdtfeger_1997']
DEBUG:root:{u'sort': True, u'citationItems': [{u'itemID': 7163}]}
Traceback (most recent call last):
  File "/home/chbeer/.gnome2/gedit/plugins/Zotero/zotero_interface.py", line 274, in add_citation
    cite_key = process_cite_key(cite_key)
  File "/home/chbeer/.gnome2/gedit/plugins/Zotero/zotero_interface.py", line 320, in process_cite_key
    key = unicodedata.normalize('NFKD', key).encode('ascii', 'ignore')
TypeError: normalize() argument 2 must be unicode, not str
DEBUG:root:['X']
DEBUG:root:Update parameters: [u'3XTOz7RH', 'false', 'updated', '!', '0', 'X']
DEBUG:root:<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><ns0:Header /><ns0:Body><ns1:update xmlns:ns1="http://www.zotero.org/namespaces/SOAP"><input ns2:type="xsd:string" xmlns:ns2="http://www.w3.org/1999/XMLSchema-instance">3XTOz7RH:false:updated:!:0:X</input></ns1:update></ns0:Body></ns0:Envelope>
DEBUG:root:Response Status: 200
DEBUG:root:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <m:updateResponse xmlns:m="http://www.zotero.org/namespaces/SOAP">
      <output xmlns="http://purl.org/net/xbiblio/csl">!:!:0:{"sort"::true,"citationItems"::[{"itemID"::13815}]}:pekrun_elliot_maier_2006</output>
    </m:updateResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:root:['!', '!', '0', {u'sort': True, u'citationItems': [{u'itemID': 13815}]}, 'pekrun_elliot_maier_2006']
DEBUG:root:{u'sort': True, u'citationItems': [{u'itemID': 13815}]}
Traceback (most recent call last):
  File "/home/chbeer/.gnome2/gedit/plugins/Zotero/zotero_interface.py", line 274, in add_citation
    cite_key = process_cite_key(cite_key)
  File "/home/chbeer/.gnome2/gedit/plugins/Zotero/zotero_interface.py", line 320, in process_cite_key
    key = unicodedata.normalize('NFKD', key).encode('ascii', 'ignore')
TypeError: normalize() argument 2 must be unicode, not str

with "Umlaut":
DEBUG:root:Response Status: 200
DEBUG:root:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <m:updateResponse xmlns:m="http://www.zotero.org/namespaces/SOAP">
      <output xmlns="http://purl.org/net/xbiblio/csl">!:!:0:{"sort"::true,"citationItems"::[{"itemID"::5052}]}:götz_pekrun_hall_haag_2006</output>
    </m:updateResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
DEBUG:root:[u'!', u'!', u'0', {u'sort': True, u'citationItems': [{u'itemID': 5052}]}, u'g\xf6tz_pekrun_hall_haag_2006']
DEBUG:root:{u'sort': True, u'citationItems': [{u'itemID': 5052}]}

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Oh, that's not the way fixing non-ascii keys was meant... ;-)

Should now be fixed in trunk.

Changed in gedit-zotero:
assignee: nobody → frederik-elwert
importance: Undecided → Critical
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.