Problems with GAM INFO DOMAIN and UnicodeEncodeError 3.61

49 views
Skip to first unread message

Marcelo Iturbe

unread,
Oct 26, 2015, 4:25:39 PM10/26/15
to Google Apps Manager
Hello,
I am running:
GAM 3.61 - http://git.io/gam
Python 2.7.3 64-bit final
google-api-python-client 1.4.1
Linux-3.2.0-4-amd64-x86_64-with-debian-7.8 x86_64

When I execute "gam info domain" I get the following error:

Customer ID: SomeCodeID
Default Language: es
Traceback (most recent call last):
  File "gam.py", line 8764, in <module>
    doGetDomainInfo()
  File "gam.py", line 1232, in doGetDomainInfo
    doGetInstanceInfo()
  File "gam.py", line 6769, in doGetInstanceInfo
    print u'Organization Name: %s' % org_name[u'entry'][u'apps$property'][0][u'value']
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 21: ordinal not in range(128)


Can I debug this somehow? see what is the raw data being returned by the APIs?

Thanks

Marcelo Iturbe

unread,
Oct 26, 2015, 4:35:24 PM10/26/15
to Google Apps Manager
I discovered the debug.gam file and implemented.

The reason why it crashed is because there is a ñ in the Organization name in the company profile.

This was not an issue before, something recently changed to break GAM

{
 
"entry": {
   
"updated": {
     
"$t": "2015-10-26T20:33:10.833Z"
   
},
   
"xmlns": "http://www.w3.org/2005/Atom",
   
"xmlns$apps": "http://schemas.google.com/apps/2006",
   
"apps$property": [
     
{
       
"name": "organizationName",
       
"value": "Vi\u00f1a "
     
}
   
],

Ross Scroggs

unread,
Oct 26, 2015, 5:07:40 PM10/26/15
to google-ap...@googlegroups.com
Marcelo,

Make a backup copy of gam.py.
Edit gam.py and make the following change:
Line 6769:
Old:   print u'Organization Name: %s' % org_name[u'entry'][u'apps$property'][0][u'value']
New:  print convertUTF8(u'Organization Name: %s' % org_name[u'entry'][u'apps$property'][0][u'value'])

Let me know if that fixes it.

Ross

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/ec8f72f7-9c71-4a4f-beec-6852c097cd95%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Marcelo Iturbe

unread,
Oct 26, 2015, 5:15:44 PM10/26/15
to Google Apps Manager

worked ferpectly!

Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.



--
Reply all
Reply to author
Forward
0 new messages