Git Product home page Git Product logo

Comments (11)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 30 Mar 2007 at 12:15

  • Changed state: Accepted

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 24 Apr 2007 at 5:19

  • Changed state: New

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 29 Jun 2007 at 6:13

  • Added labels: Component-GData

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
This can be solved using <string>.encode('UTF-8'). Perhaps this should be added 
to
the XML parsing, I'll have to think about it.

Original comment by [email protected] on 6 Aug 2007 at 9:39

  • Changed state: Started

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I've added encode() calls to strings when they are converted from XML elements 
to
members in revision 230.

Original comment by [email protected] on 6 Dec 2007 at 8:55

  • Changed state: Fixed
  • Added labels: Component-ATOM, Milestone-Release1.0.10
  • Removed labels: Component-GData

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Hi, api.jscudder:
I am trying the "Hello World" example in the article 'Getting Started with the 
Google
Data Python Library ', this issue is still feezing me when i execute the 
statement
'documents_feed = client.GetDocumentListFeed()'. Could you investigate that 
please?

Original comment by [email protected] on 7 Jan 2008 at 11:43

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Could you try revision 273? I just checked in a change which I think should fix 
this.
Here is the diff for src/atom/__init__.py if you would rather apply a patch:

Index: __init__.py
===================================================================
--- __init__.py (revision 262)
+++ __init__.py (working copy)
@@ -44,7 +44,6 @@

 __author__ = 'api.jscudder (Jeffrey Scudder)'

-
 try:
   from xml.etree import cElementTree as ElementTree
 except ImportError:
@@ -90,7 +89,7 @@
   if string_encoding:
     tree = ElementTree.fromstring(xml_string.encode(string_encoding))
   else:
-    if XML_STRING_ENCODING:
+    if XML_STRING_ENCODING and isinstance(xml_string, unicode):
       tree = ElementTree.fromstring(xml_string.encode(XML_STRING_ENCODING))
     else:
       tree = ElementTree.fromstring(xml_string)

Original comment by [email protected] on 7 Jan 2008 at 6:43

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Thanks for your work! The 'UnicodeEncodeError' has gone! 
While the returned results are garbled code when i 'print 
document_entry.title.text'. There are some docs in Chinese of my google docs, 
you 
know.

Original comment by [email protected] on 8 Jan 2008 at 1:15

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
[deleted comment]

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
[deleted comment]

from gdata-python-client.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I researched the problem today and changed the following codes to solve it:
-----------------------------------------------------------------------
gdata/service.py
line 486: result_body = server_response.read().decode('utf-8')

atom/__init__.py
def CreateClassFromXMLString(target_class, xml_string):
  tree = ElementTree.fromstring(xml_string)
  return _CreateClassFromElementTree(target_class, tree)

def _HarvestElementTree(self, tree):
  for child in tree:
    self._ConvertElementTreeToMember(child)
  for attribute, value in tree.attrib.iteritems():
    self._ConvertElementAttributeToMember(attribute, value)
  if tree.text:
    self.text = tree.text

def _ConvertElementAttributeToMember(self, attribute, value):
  if value:
    self.extension_attributes[attribute] = value
----------------------------------------------------------------------
I modify the sources just to meet my purpose, hoping for some help to you.

Original comment by [email protected] on 9 Jan 2008 at 1:09

from gdata-python-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.