Open GoogleCodeExporter opened 9 years ago
Hi,
This error appears to be happening in Mercurial, my guess is an environment
issue.
Does Mercurial (hg) work fine if you run it from the terminal?
1) How did you install Mercurial? Mercurial is written in Python so you may
need to
install setuptools to the same python installation that you installed Mercurial
for
on your computer.
2) If Mercurial works fine from your command line it may be a PATH issue as if
your
using a Binary install of Editra (from the dmg file) it will not inherit any
custom
environment settings from your ~/.profile. In the config dialog you can add
additional environmental variables if necessary.
Cody
Original comment by CodyPrec...@gmail.com
on 19 Nov 2009 at 7:21
Hi Cody,
Mercurial is working just fine from terminal; I use it daily.
The error does happen in the Mercurial "hg" script. I verified that setuptools is
installed for both versions of Python on my system (2.5 and 2.6). I installed
Mercurial using easy_install. I tried a 1.3 and 1.4 version with the same
result.
I have also tried manually setting /usr/local/bin/hg to use python2.6 and
python2.5, in both cases I get the same error.
The other thing I have tried is writing a quick little bash wrapper around hg. I
did get a different error:
[16:53:50][projects][err] run error: [Errno 8] Exec format error
I am not sure where that error originates from in the code. My wrapper works
fine
from a terminal.
Any ideas?
Robert
Original comment by Robert.K...@gmail.com
on 19 Nov 2009 at 9:58
Hi,
I will have to try it on my machine to see if I can reproduce, but the error is
happening when the projects plugin is trying to run hg. All it does is simply
take
the command you gave it and do a shell execute of that command line using
subprocess.Popen.
The traceback shows that the error is happening in the execution of the hg
script not
from within the projects/editra's process. I think I saw this once when I was
testing
on windows.
You might want to check your environment from the terminal (env). To see if
there are
any Python or HG specific environmental variables that are set. If they are you
may
need to add them to your HG configuration in the Projects plugin.
Will chime in again when I get a chance to test this issue.
Thanks,
cody
Original comment by CodyPrec...@gmail.com
on 19 Nov 2009 at 10:41
Hi Cody,
Thank you for the prompt replies, I really appreciate it.
I did not see any environmental variables related to python or hg. I'll try doing
some more experiments with this too.
So far all of my testing of hg, it works properly. I will put together a simple
python script to call hg and let you know how that goes.
Robert
Original comment by Robert.K...@gmail.com
on 19 Nov 2009 at 11:19
I tested calling hg from python using both os.popen and subprocess.Popen, both
worked
just fine.
Original comment by Robert.K...@gmail.com
on 19 Nov 2009 at 11:31
Hi,
Yes because when you use a script it is getting the same environment as doing
it from
the terminal.
You are using Editra.app right? This is running in its own contained
environment. If
you download the Editra source package unzip it and run the Editra script in
there I
bet that hg will work fine in the projects plugin. The issue is that the built
app
has some odd affect on the calling environment.
Cody
Original comment by CodyPrec...@gmail.com
on 19 Nov 2009 at 11:40
I downloaded the source tarball, ran python2.5 Editra (it does not like my
python2.6, it complains with errors about wx and 64 bit). Editra itself runs
fine,
but I get exactly the same errors.
Original comment by Robert.K...@gmail.com
on 20 Nov 2009 at 12:03
I just tested on my machine (OSX 10.5). I am using the Framework builds from
python.org no sure it makes a difference compaired to the apple provided one.
Using Mercurial 1.1.2:
1) From the console HG works fine in the projects plugin for me.
2) Using Editra.app I get some errors like the following:
[18:18:07][projects][info]/Users/codyprecord/Desktop/devel/test_hg
/Library/Frameworks/Python.framework/Versions/Current/bin/hg status -A .
[18:18:07][projects][err] Traceback (most recent call last):
[18:18:07][projects][err] File
"/Library/Frameworks/Python.framework/Versions/Current/bin/hg", line 11, in
<module>
[18:18:07][projects][err] from mercurial import demandimport;
demandimport.enable()
[18:18:07][projects][err] ImportError: No module named mercurial
[18:18:42][projects][info]/Users/codyprecord/Desktop/devel/test_hg
/usr/local/bin/hg
status -A .
[18:18:42][projects][err] Traceback (most recent call last):
[18:18:42][projects][err] File "/usr/local/bin/hg", line 11, in <module>
[18:18:42][projects][err] from mercurial import demandimport;
demandimport.enable()
[18:18:42][projects][err] ImportError: No module named mercurial
Using the latest Mercurial 1.4: I see some different results
1) From the console again it works without issue on my machine
2) With Editra.app
[18:22:13][projects][info]/Users/codyprecord/Desktop/devel/test_hg
/Library/Frameworks/Python.framework/Versions/2.5/bin/hg status -A .
[18:22:16][projects][err] Traceback (most recent call last):
[18:22:16][projects][err] File
"/Library/Frameworks/Python.framework/Versions/2.5/bin/hg", line 4, in <module>
[18:22:16][projects][err] import pkg_resources
[18:22:16][projects][err] File "pkg_resources.pyo", line 2485, in <module>
[18:22:16][projects][err] File "pkg_resources.pyo", line 591, in require
[18:22:16][projects][err] File "pkg_resources.pyo", line 489, in resolve
[18:22:16][projects][err] pkg_resources.DistributionNotFound: mercurial==1.4
I am not sure if something else on 10.6 could be at issue, I am planning to
start
updating to 10.6 so Editra can officially support it. There are some issues in
the
current version of wxPython/wxWidgets with 10.6 due to some changes apple (i.e
the
font dialog will not work in Editra on 10.6 currently and there are some errors
with
some of the drawing api's used.) but after the next release of wx is out I will
upgrade.
Cody
Original comment by CodyPrec...@gmail.com
on 20 Nov 2009 at 12:29
When I use 2.5 for Mercurial instead of 2.6, I get similar errors to those.
When I was trying to run Editra with the Apple bundled 2.6 I was getting errors
from
wx. The errors seemed to indicate that the issue had to do with python running
in 64
bit mode by default. I have not tried to see if simply running python in 32
bit mode
let that run yet.
I wrote a shell script that wrapped the default hg python script. I was
curious if
somehow calling the hg script from within a python environment could be causing
this?
I am not familiar enough with how Editra sets up its environment to know.
Please let me know if there is anything I can do to help with this. If you
have some
ideas I would be happy to help investigate them.
Robert
Original comment by Robert.K...@gmail.com
on 20 Nov 2009 at 5:00
Original issue reported on code.google.com by
Robert.K...@gmail.com
on 19 Nov 2009 at 6:00