Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:59:52+00:00 2026-06-02T20:59:52+00:00

I have an issue, where a function returns a number. When I then try

  • 0

I have an issue, where a function returns a number. When I then try to assemble a URL that includes that number I am met with failure.

Specifically the error I get is

TypeError: cannot concatenate ‘str’ and ‘NoneType’ objects

Not sure where to go from here.

Here is the relevant piece of code:

# Get the raw ID number of the current configuration
configurationID = generate_configurationID()

# Update config name at in Cloud
updateConfigLog = open(logBase+'change_config_name_log.xml', 'w')
# Redirect stdout to file
sys.stdout = updateConfigLog
rest.rest(('put', baseURL+'configurations/'+configurationID+'?name=this_is_a_test_', user, token))
sys.stdout = sys.__stdout__

It works perfectly if I manually type the following into rest.rest()

rest.rest(('put', http://myurl.com/configurations/123456?name=this_is_a_test_, myusername, mypassword))

I have tried str(configurationID) and it spits back a number, but I no longer get the rest of the URL…

Ideas? Help?

OK… In an attempt to show my baseURL and my configurationID here is what I did.

print 'baseURL: '+baseURL
print 'configurationID: '+configurationID

and here is what I got back

it-tone:trunk USER$ ./skynet.py fresh
baseURL: https://myurl.com/
369596
Traceback (most recent call last):
  File "./skynet.py", line 173, in <module>
    main()
  File "./skynet.py", line 30, in main
    fresh()
  File "./skynet.py", line 162, in fresh
    updateConfiguration()
  File "./skynet.py", line 78, in updateConfiguration
    print 'configurationID: '+configurationID
TypeError: cannot concatenate 'str' and 'NoneType' objects
it-tone:trunk USER$ 

What is interesting to me is that the 369596 is the config ID, but like before it seems to clobber everything called up around it.

As kindall pointed out below, my generate_configurationID was not returning the value, but rather it was printing it.

# from generate_configurationID
def generate_configurationID():
  dom = parse(logBase+'provision_template_log.xml')
  name = dom.getElementsByTagName('id')
  p = name[0].firstChild.nodeValue
  print p
  return p
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:59:54+00:00Added an answer on June 2, 2026 at 8:59 pm

    Your configurationID is None. This likely means that generate_configurationID() is not returning a value. There is no way in Python for a variable name to “lose” its value. The only way, in the code you posted, for configurationID to be None is for generate_configurationID() to return None which is what will happen if you don’t explicitly return any value.

    “But it prints the configurationID right on the screen!” you may object. Sure, but that’s probably in generate_configurationID() where you are printing it to make sure it’s right but forgetting to return it.

    You may prove me wrong by posting generate_configurationID() in its entirety, and I will admit that your program is magic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having some issue with my function call please. I have a situation that I
I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have got the following issue, my function appends code to a string $string
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue that is driving me a bit nuts: Using a UserProfileManager
When have a issue at work where the value returned by the SUM() function
I have a function that reads a text file containing two lines, it reads
We are new to ROR, We have issue in creating Login/Logout process in ROR
Share your ideas please! I have issue to check the folder and convert a
We have an issue using the PEAR libraries on Windows from PHP . Pear

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.