ourresearch / total-impact-core

An api and backend code to gather the impacts of diverse scholarly products online.
http://impactstory.org
Other
55 stars 7 forks source link

unicode exceptions in unicode when in doi #124

Closed hpiwowar closed 11 years ago

hpiwowar commented 11 years ago

see tiid c32owulx8douh9qi4lce7l1y has doi "10.1300/j123v48n01\u033119" doi spec DOES allow unicode characters

impacts many providers: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread facebook-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread topsy-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread wikipedia-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread scopus-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread citeulike-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread scienceseeker-METRICS-c32o: Jun 18 07:16:34 ti-core app/worker.1: Exception in thread delicious-METRICS-c32o:

Jun 18 07:16:34 ti-core app/worker.1:  Exception in thread facebook-METRICS-c32o: 
Jun 18 07:16:34 ti-core app/worker.1:  Traceback (most recent call last): 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/.heroku/python/lib/python2.7/threading.py", line 810, in __bootstrap_inner 
Jun 18 07:16:34 ti-core app/worker.1:      self.run() 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/.heroku/python/lib/python2.7/threading.py", line 763, in run 
Jun 18 07:16:34 ti-core app/worker.1:      self.__target(*self.__args, **self.__kwargs) 
Jun 18 07:16:34 ti-core app/worker.1:    File "totalimpact/backend.py", line 120, in wrapper 
Jun 18 07:16:34 ti-core app/worker.1:      method_response = method(input_alias_tuples) 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/totalimpact/providers/provider.py", line 387, in metrics 
Jun 18 07:16:34 ti-core app/worker.1:      id = self.get_best_id(aliases) 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/totalimpact/providers/facebook.py", line 59, in get_best_id 
Jun 18 07:16:34 ti-core app/worker.1:      return self.get_relevant_alias_with_most_metrics("facebook:likes", aliases) 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/totalimpact/providers/provider.py", line 446, in get_relevant_alias_with_most_metrics 
Jun 18 07:16:34 ti-core app/worker.1:      metrics = self.get_metrics_for_id(url) 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/totalimpact/providers/provider.py", line 419, in get_metrics_for_id 
Jun 18 07:16:34 ti-core app/worker.1:      url = self._get_templated_url(provider_url_template, id, "metrics") 
Jun 18 07:16:34 ti-core app/worker.1:    File "/app/totalimpact/providers/provider.py", line 148, in _get_templated_url 
Jun 18 07:16:34 ti-core app/worker.1:      provider=self.provider_name, id=id)) 
Jun 18 07:16:34 ti-core app/worker.1:  UnicodeEncodeError: 'ascii' codec can't encode character u'\u0331' in position 36: ordinal not in range(128) ```
hpiwowar commented 11 years ago

This is not a valid doi. that said, we no longer break when someone passes it to us.