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 7189695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:21:24+00:00 2026-05-28T19:21:24+00:00

I am observing a different output from a C++ compiled binary file, that calls

  • 0

I am observing a different output from a C++ compiled binary file, that calls some OpenCV libraries, executed via the python interpreter launched via manage.py ($ python2.7 manage.py shell) versus the standard python interpreter ($ python2.7). The output achieved from the bash shell is equivalent to that of the standard python interpreter.

It appears that something is different about the ‘environment’ of the python interpreter launched via manage.py as compared to the standard python shell. I’d like to know how to determine the difference between the two interpreters and ultimately how to have the result of the binary execution be the same.

Setup details:

  • connected to web server via ssh (putty)
  • Centos6-64bit
  • /bin/bash

From within my Django project directory I run the following and the processed image (result of executing the binary file) is as I expect:

$ python2.7
Python 2.7.1 (r271:86832, Sep 13 2011, 19:13:17)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> import os
>>> subprocess.call(['/home/username/engine/binary','/home/username/imagetmp/image.jpg'])
0
>>> 

From within my Django project directory I run the following and the processed image is NOT as I expect:

$ python2.7 manage.py shell
Python 2.7.1 (r271:86832, Sep 13 2011, 19:13:17)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import subprocess
>>> import os
>>> subprocess.call(['/home/username/engine/binary','/home/username/imagetmp/image.jpg'])
0
>>>

On the command line I run the following and the processed image is as I expect.

$ pwd
/home/username/engine/
$ ./binary /home/username/imagetmp/image.jpg
$

Within both python interpreters I’ve compared the following:

  • sys.path (the result obtained from the python interpreter launched via manage.py has the path to my django project while the result from the standard python interpreter does not)
  • os.environ (the result obtained from the python interpreter launched via manage.py includes the DJANGO_SETTINGS_MODULE and CELERY_LOADER enviroment variables while the result from the standard python interpreter does not)
  • os.stat for every file in /home/username/engine and /home/username/engine/libs .. with no differences observed
  • I’ve also tried modifying the subprocess call which had no impact:

    subprocess.call([‘/home/username/engine/binary’,’/home/username/imagetmp/image.jpg’], env=os.environ)

So the differences I’ve noted are:

  • the (InteractiveConsole) line when the python interpreter shell is started via $ python2.7 manage.py shell .. I’m unsure of what this extra line means or rather if and what it’s presence implies and if it’s the cause of the difference I observe in behavior.
  • the slight differences in results of sys.path and os.environ

My conclusion is that there is something fundamental that I’m unaware of regarding the differences between the python interpreter launched via manage.py versus the standard python interpreter. Any thoughts you have on how to debug this situation would be greatly appreciated.

  • 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-05-28T19:21:26+00:00Added an answer on May 28, 2026 at 7:21 pm

    The root cause of this observed issue was related to the way file paths were being handled in the binary. Once we realized this was the case and remedied the situation in the binary, we observed the correct behaviour i.e. execution in the python interpreter launched via manage.py led to the same result as execution in the standard python interpreter.

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

Sidebar

Related Questions

How can i check/inspect the performance of some network application via observing the port
Okay, so I'm observing some behavior that I would certainly call 'unexpected' and I'm
I am observing a different behavior when presentOpenInMenuFromRect is executed in iPhone4 and iPad2
I'm observing a file path for changes via file system events. Now I need
From observing source code for various Android applications (not written by me), I noticed
I have some data which my program discovers after observing a few things about
I am observing, on both Firefox and IE, that if I have a cookie
I'm observing NSWorkspaceDidDeactivateApplicationNotification notification to get the application that has just lost focus. I'm
I'm observing some strange behavior when using the F# interactive interpreter. Running the following
I'm observing some strange behavior with a local variable within a nested for loop

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.