camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Dudgeon (JIRA)" <>
Subject [jira] [Created] (CAMEL-7582) Python scripts with multiple statements return null
Date Sat, 05 Jul 2014 10:32:33 GMT
Tim Dudgeon created CAMEL-7582:

             Summary: Python scripts with multiple statements return null
                 Key: CAMEL-7582
             Project: Camel
          Issue Type: Bug
          Components: camel-language
    Affects Versions: 2.13.0
            Reporter: Tim Dudgeon
            Priority: Minor

As reported here:

It seems that when calling python script that has more than a single statement  the return
value from the script is null. Here is a simple example in groovy that  shows this:


import org.apache.camel.*
import org.apache.camel.impl.*
import org.apache.camel.builder.*

String script = URLEncoder.encode('"Hello world!"', "UTF-8") // this works - script returns
"Hello world!"
//String script = URLEncoder.encode('bar = "baz"; "Hello world!"', "UTF-8") // this fails
- script returns null

CamelContext camelContext = new DefaultCamelContext()
camelContext.addRoutes(new RouteBuilder() {
        def void configure() {
            .to("language:python:" + script)


ProducerTemplate t = camelContext.createProducerTemplate()
def result = t.requestBody('direct:python', 'foo')
println result


This message was sent by Atlassian JIRA

View raw message