473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

urlsafe_b64decoding of xml node text

Hi All,

I am running Apache with mod_python. A post message to my server
contains an xml of the form
<a>
<b>(some base64 ur-safe-encoded data)</b>
</a>

I use minidom to parse the xml posted, and now try to decode the data
using the following

import minidom
import base64

decData = base64.urlsafe_b64decode(data) #data is the above mentioned
url-safe-encoded data

This line fails with the following error

Error : <type 'exceptions.TypeError'>
Error : character mapping must return integer, None or unicode
Error : <traceback object at 0x1b38e40>

If i run the same data through a script on the terminal, I am able to
successfully decode the data.

What could be the reason for this error? Can it be because of some
encoding introduced by minidom?

I think urlsafe_b64decode takes ascii string.

Thanks,
Kaushik
Mar 3 '08 #1
0 748

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ralf Wahner | last post by:
Dear Masters of XSLT Could I ask you for a clue on the following question? I'd like to use XSLT to transform an XML source file to LaTeX. In the following small example the <para> Element...
1
by: Eric | last post by:
I am trying to figure out a good way to implement a XSLT transformation. Basically my goal is that I want to be able to ouput the following XML in a document: <chart type="pie" width="100"...
4
by: n_o_s_p_a__m | last post by:
My xml doc has many <title></title> and <title> in it, meaning the nodes have no content (although some do). How can I test for this? I tried title (doesn't work) I tried //title (doesn't work)...
2
by: fremenusul | last post by:
I orginally asked this question on friday, and made some progress, but now I am getting an error. What is the type of xmlProductName (check the runtime type in the debugger)? The debug output...
8
by: Ryan Stewart | last post by:
Putting the following code in a page seems to make it go into an infinite loop unless you give it a very simple node to work with. Either that or it's very very slow. I'm somewhat new to this,...
6
by: Ron Brennan | last post by:
I want if possible to use something like: element.getElementsByTagName('text') but that doesn't work. Is there another value for the parameter, or is it not possible with getElementsByTagName?...
6
by: SHC | last post by:
Hi all, I created an application from the Console Application (.NET) of VC++ .NET 2003, and I did "Build" the application of the attached .cpp file, volcanoes.xml and geology.dtd on my VC++ .NET...
0
by: pavlaras | last post by:
hi all its been a while since i've worked on a VB program and im currently facing difficulties with the following code.I'm trying to create a diagram with nodes which you can manipulate and enter...
8
by: Dylan Parry | last post by:
Hi folks, I have an XML node called "myNode" and it contains: "This is some text" Now I can use the myNode.nodeValue property to get the string of text above. But say myNode contains: ...
0
by: jiing | last post by:
Hi all, I want to use sting(the same as Node.Text) to judge if a node exists in TreeView. I've tried several ways, but seems all failed. could anybody help me? Thanks in advance. //My...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.