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

  • SEARCH
  • Home
  • 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 8154453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:21:25+00:00 2026-06-06T16:21:25+00:00

I am using CherryPy to generate and parse data for a php webpage, but

  • 0

I am using CherryPy to generate and parse data for a php webpage, but getting an error that I can’t replicate locally or via SSH (logging into the server and running the python script from the prompt works okay).

The current sticky error message is:

File "modules/flex.py", line 335, in convert
    ref_data = cPickle.load(f2)
AttributeError: 'module' object has no attribute 'Data'

Another pickle loads fine in a previous line, and both pickles represent class objects with a variety of dictionaries and lists of lists. But one of these works, and the other doesn’t.

In general with CherryPy, what’s the best way to isolate error messages? I can run the /cp/ function from it’s URL, and I can look at the webserver error log, but even these two don’t always give an error message (or the correct error).

On the other side, in php, I am using this code to retrieve a json object representing a python list of lists:

$obj = file_get_contents($senddata);
$sue = json_decode($obj);

Is that an acceptable method? What’s the best way to pass and generate php arrays from python data structures?

  • 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-06T16:21:28+00:00Added an answer on June 6, 2026 at 4:21 pm

    I think that you have different issues:

    1. Your code is not working because the PYTHONPATH (sys.path) are not the same
      in your python interpreter, when you are connected trough ssh and in the python
      that is running to serve the webapp. I say that because you are tying to deserialize
      the data from a module, which it does exists (otherwise will be ImportError)
      but do not have the class declaration of Data, probably a file with the same
      name as that module is in the same directory and trying to find the class Data
      in that file. When you serialize you don’t save the class declaration, just how to
      reconstruct that object.

    2. What do you mean with “the correct error”?, when the environment
      is “production”, CherryPy by default log the traceback of the last error,
      you can of course change the default behavior with custom error handling.

    3. You should stick with JSON for communication betweeen languages, is pretty standard
      and efficient to be parsed in both sides.

    I hope that helps.

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

Sidebar

Related Questions

Using PHP, I can convert MySQL data or static table data to csv, Excel,
I am using WTForms with cherrypy with a decimal field but I'm getting a
Let's say I have some code (using CherryPy) that looks like this: import cherrypy
Using top it's easy to identify processes that are hogging memory and cpu, but
I'm currently writing a small python app that embeds cherrypy and django using py2app.
I'm using cherrypy to mimic an existing RESTful interface. One requirement is that I
I'm evaluating and looking at using CherryPy for a project that's basically a JavaScript
I have a web application written using CherryPy, which is run locally on 127.0.0.1:4321
I'm using python and CherryPy to create a simple internal website that about 2
I build simple webpage using CherryPy and Jinja2 The webserver python file: import cherrypy

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.