Search Results

Search found 634 results on 26 pages for 'python2 5'.

Page 11/26 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • cx_Oracle makes subprocess give OSError

    - by Shrikant Sharat
    I am trying to use the cx_Oracle module with python 2.6.6 on ubuntu Maverick, with Oracle 11gR2 Enterprise edition. I am able to connect to my oracle db just fine, but once I do that, the subprocess module does not work anymore. Here is an iPython session that reproduces the problem... In [1]: import subprocess as sp, cx_Oracle as dbh In [2]: sp.call(['whoami']) sharat Out[2]: 0 In [3]: con = dbh.connect('system', 'password') In [4]: con.close() In [5]: sp.call(['whomai']) --------------------------------------------------------------------------- OSError Traceback (most recent call last) /home/sharat/desk/calypso-launcher/<ipython console> in <module>() /usr/lib/python2.6/subprocess.pyc in call(*popenargs, **kwargs) 468 retcode = call(["ls", "-l"]) 469 """ --> 470 return Popen(*popenargs, **kwargs).wait() 471 472 /usr/lib/python2.6/subprocess.pyc in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags) 621 p2cread, p2cwrite, 622 c2pread, c2pwrite, --> 623 errread, errwrite) 624 625 if mswindows: /usr/lib/python2.6/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) 1134 1135 if data != "": -> 1136 _eintr_retry_call(os.waitpid, self.pid, 0) 1137 child_exception = pickle.loads(data) 1138 for fd in (p2cwrite, c2pread, errread): /usr/lib/python2.6/subprocess.pyc in _eintr_retry_call(func, *args) 453 while True: 454 try: --> 455 return func(*args) 456 except OSError, e: 457 if e.errno == errno.EINTR: OSError: [Errno 10] No child processes So, the call to sp.call works fine before connecting to oracle, but breaks after that. Even if I have closed the connection to the database. Looking around, I found http://bugs.python.org/issue1731717 as somewhat related to this issue, but I am not dealing with threads here. I don't know if cx_Oracle is. Moreover, the above issue mentions that adding a time.sleep(1) fixes it, but it didn't help me. Any help appreciated. Thanks.

    Read the article

  • SQLAlchemy DetachedInstanceError with regular attribute (not a relation)

    - by haridsv
    I just started using SQLAlchemy and get a DetachedInstanceError and can't find much information on this anywhere. I am using the instance outside a session, so it is natural that SQLAlchemy is unable to load any relations if they are not already loaded, however, the attribute I am accessing is not a relation, in fact this object has no relations at all. I found solutions such as eager loading, but I can't apply to this because this is not a relation. I even tried "touching" this attribute before closing the session, but it still doesn't prevent the exception. What could be causing this exception for a non-relational property even after it has been successfully accessed once before? Any help in debugging this issue is appreciated. I will meanwhile try to get a reproducible stand-alone scenario and update here. Update: This is the actual exception message with a few stacks: File "/home/hari/bin/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/orm/attributes.py", line 159, in __get__ return self.impl.get(instance_state(instance), instance_dict(instance)) File "/home/hari/bin/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/orm/attributes.py", line 377, in get value = callable_(passive=passive) File "/home/hari/bin/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/orm/state.py", line 280, in __call__ self.manager.deferred_scalar_loader(self, toload) File "/home/hari/bin/lib/python2.6/site-packages/SQLAlchemy-0.6.1-py2.6.egg/sqlalchemy/orm/mapper.py", line 2323, in _load_scalar_attributes (state_str(state))) DetachedInstanceError: Instance <ReportingJob at 0xa41cd8c> is not bound to a Session; attribute refresh operation cannot proceed The partial model looks like this: metadata = MetaData() ModelBase = declarative_base(metadata=metadata) class ReportingJob(ModelBase): __tablename__ = 'reporting_job' job_id = Column(BigInteger, Sequence('job_id_sequence'), primary_key=True) client_id = Column(BigInteger, nullable=True) And the field client_id is what is causing this exception with a usage like the below: Query: jobs = session \ .query(ReportingJob) \ .filter(ReportingJob.job_id == job_id) \ .all() if jobs: # FIXME(Hari): Workaround for the attribute getting lazy-loaded. jobs[0].client_id return jobs[0] This is what triggers the exception later out of the session scope: msg = msg + ", client_id: %s" % job.client_id

    Read the article

  • "Exception: No extension found at None" when trying on use Selenium Firefox WebDriver on a Mac

    - by Gj
    Any ideas? In [1]: from selenium.firefox.webdriver import WebDriver In [2]: d=WebDriver() --------------------------------------------------------------------------- Exception Traceback (most recent call last) /usr/local/selenium-read-only/<ipython console> in <module>() /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/selenium-2.0_dev-py2.6.egg/selenium/firefox/webdriver.pyc in __init__(self, profile, timeout) 48 profile = FirefoxProfile(name=profile) 49 if not profile: ---> 50 profile = FirefoxProfile() 51 self.browser.launch_browser(profile) 52 RemoteWebDriver.__init__(self, /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/selenium-2.0_dev-py2.6.egg/selenium/firefox/firefox_profile.pyc in __init__(self, name, port, template_profile, extension_path) 72 73 if name == ANONYMOUS_PROFILE_NAME: ---> 74 self._create_anonymous_profile(template_profile) 75 self._refresh_ini() 76 else: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/selenium-2.0_dev-py2.6.egg/selenium/firefox/firefox_profile.pyc in _create_anonymous_profile(self, template_profile) 82 self._copy_profile_source(template_profile) 83 self._update_user_preference() ---> 84 self.add_extension(extension_zip_path=self.extension_path) 85 self._launch_in_silent() 86 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/selenium-2.0_dev-py2.6.egg/selenium/firefox/firefox_profile.pyc in add_extension(self, force_create, extension_zip_path) 152 not os.path.exists(extension_source_path)): 153 raise Exception( --> 154 "No extension found at %s" % extension_source_path) 155 156 logging.debug("extension_source_path : %s" % extension_source_path) Exception: No extension found at None

    Read the article

  • Emailing smtp with Python error

    - by jakecar
    I can't figure out why this isn't working. I'm trying to send an email from my school email address with this code I got online. The same code works for sending from my GMail address. Does anyone know what this error means? The error occurs after waiting for about one and a half minutes. import smtplib FROMADDR = "FROM_EMAIL" LOGIN = "USERNAME" PASSWORD = "PASSWORD" TOADDRS = ["TO_EMAIL"] SUBJECT = "Test" msg = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (FROMADDR, ", ".join(TOADDRS), SUBJECT) ) msg += "some text\r\n" server = smtplib.SMTP('OUTGOING_SMTP', 587) server.set_debuglevel(1) server.ehlo() server.starttls() server.login(LOGIN, PASSWORD) server.sendmail(FROMADDR, TOADDRS, msg) server.quit() And here's the error I get: Traceback (most recent call last): File "emailer.py", line 13, in server = smtplib.SMTP('OUTGOING_SMTP', 587) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 239, in init (code, msg) = self.connect(host, port) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 295, in connect self.sock = self._get_socket(host, port, self.timeout) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/smtplib.py", line 273, in _get_socket return socket.create_connection((port, host), timeout) File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 514, in create_connection raise error, msg socket.error: [Errno 60] Operation timed out

    Read the article

  • HTTPSConnection module missing in Python 2.6 on CentOS 5.2

    - by d2kagw
    Hi guys, I'm playing around with a Python application on CentOS 5.2. It uses the Boto module to communicate with Amazon Web Services, which requires communication through a HTTPS connection. When I try running my application I get an error regarding HTTPSConnection being missing: "AttributeError: 'module' object has no attribute 'HTTPSConnection'" Google doesn't really return anything relevant, I've tried most of the solutions but none of them solve the problem. Has anyone come across anything like it? Here's the traceback: Traceback (most recent call last): File "./chatter.py", line 114, in <module> sys.exit(main()) File "./chatter.py", line 92, in main chatter.status( ) File "/mnt/application/chatter/__init__.py", line 161, in status cQueue.connect() File "/mnt/application/chatter/tools.py", line 42, in connect self.connection = SQSConnection(cConfig.get("AWS", "KeyId"), cConfig.get("AWS", "AccessKey")); File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/sqs/connection.py", line 54, in __init__ self.region.endpoint, debug, https_connection_factory) File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 418, in __init__ debug, https_connection_factory) File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 189, in __init__ self.refresh_http_connection(self.server, self.is_secure) File "/usr/local/lib/python2.6/site-packages/boto-1.7a-py2.6.egg/boto/connection.py", line 247, in refresh_http_connection connection = httplib.HTTPSConnection(host) AttributeError: 'module' object has no attribute 'HTTPSConnection'

    Read the article

  • Cocoa App with Python extension which use Scipy -> ImportError: No module named scipy

    - by Snej
    Hi: I have installed Scipy (via macports) for Python on my Mac and it runs fine when running Python scripts. But now I'm using Scipy (via PyObjc) for calculations embedded in a Cocoa App frontend. The following error occurs: ImportError: No module named scipy I am using the "Python.framework" in XCode. Does anybody know why Scipy module is not found? I even added it manually to the module search path via sys.path.append("/opt/local/var/macports/software/py26-scipy/0.7.1_0+gcc43/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/") EDIT: I found the problem myself. The path should be without "/scipy" at the end. But now I got an architecture problem: ImportError: dlopen(/opt/local/var/macports/software/py26-scipy/0.7.1_0+gcc43/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/fftpack/_fftpack.so, 2): no suitable image found. Did find: /opt/local/var/macports/software/py26-scipy/0.7.1_0+gcc43/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/fftpack/_fftpack.so: mach-o, but wrong architecture EDIT 2: I checked the architectures: Yes, sure it is an architecture problem. But when I run: file /opt/local/var/macports/software/py26-scipy/0.7.1_0+gcc43/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/fftpack/_fftpack.so I get a result Mach-O 64-bit bundle x86_64. And the Mac OS 10.6 PYTHON is: Mach-O universal binary with 3 architectures /usr/bin/python (for architecture x86_64): Mach-O 64-bit executable x86_64 /usr/bin/python (for architecture i386): Mach-O executable i386 /usr/bin/python (for architecture ppc7400): Mach-O executable ppc I build the XCode project as x86_64.

    Read the article

  • can the python wave module accept StringIO object

    - by user368005
    i'm trying to use the wave module to read wav files in python. whats not typical of my applications is that I'm NOT using a file or a filename to read the wav file, but instead i have the wav file in a buffer. And here's what i'm doing import StringIO buffer = StringIO.StringIO() buffer.output(wav_buffer) file = wave.open(buffer, 'r') but i'm getting a EOFError when i run it... File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 493, in open return Wave_read(f) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 163, in __init__ self.initfp(f) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 128, in initfp self._file = Chunk(file, bigendian = 0) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/chunk.py", line 63, in __init__ raise EOFError i know the StringIO stuff works for creation of wav file and i tried the following and it works import StringIO buffer = StringIO.StringIO() audio_out = wave.open(buffer, 'w') audio_out.setframerate(m.getRate()) audio_out.setsampwidth(2) audio_out.setcomptype('NONE', 'not compressed') audio_out.setnchannels(1) audio_out.writeframes(raw_audio) audio_out.close() buffer.flush() # these lines do not work... # buffer.output(wav_buffer) # file = wave.open(buffer, 'r') # this file plays out fine in VLC file = open(FILE_NAME + ".wav", 'w') file.write(buffer.getvalue()) file.close() buffer.close()

    Read the article

  • How do I configure multiple Ubuntu Python installations to avoid App Engine's SSL error?

    - by Linc
    I have Karmic Koala which has Python 2.6 installed by default. However I can't run any Python App Engine projects because they require Python 2.5 and python ssl. To install ssl I installed python2.5-dev first while following some instructions I found elsewhere. sudo apt-get install libssl-dev sudo apt-get install python-setuptools sudo apt-get install python2.5-dev sudo easy_install-2.5 pyopenssl However, I am afraid this is not good for my Ubuntu installation since Ubuntu expects to see version 2.6 of Python when you type 'python' on the command line. Instead, it says '2.5.5'. I tried to revert to the original default version of Python by doing this: sudo apt-get remove python2.5-dev But that didn't seem to do anything either - when I type 'python' on the command line it still say 2.5.5. And App Engine still doesn't work after all this. I continue to get an SSL-related error whenever I try to run my Python app: AttributeError: 'module' object has no attribute 'HTTPSHandler' UPDATE: Just checked whether SSL actually installed as a result of those commands by typing this: $ python2.5 Python 2.5.5 (r255:77872, Apr 29 2010, 23:59:20) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import ssl Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named ssl >>> As you can see, SSL is still not installed, which explains the continuing App Engine error. If anyone knows how I can dig myself out of this hole, I would appreciate it.

    Read the article

  • Django Interrupted system call when sending email

    - by mhost
    Hi, Sometimes, when submitting a form (pretty much any form on my site that sends me an email), I get the following error: File "/usr/lib/python2.5/smtplib.py", line 603, in starttls (resp, reply) = self.docmd("STARTTLS") File "/usr/lib/python2.5/smtplib.py", line 378, in docmd return self.getreply() File "/usr/lib/python2.5/smtplib.py", line 352, in getreply line = self.file.readline() File "/usr/lib/python2.5/socket.py", line 381, in readline data = self._sock.recv(self._rbufsize) error: (4, 'Interrupted system call') My code is sending email via gmail. I am also using django contact-form which does the same thing. The problem doesn't always happen. It seems very random. At one point today it got so bad that it displayed the error every time I submitted a form. Restarting apache fixes the problem for one submission and then it does it again. I have checked the RAM and there is plenty available (about 350MB available). Can someone lead me in the right direction? What does this error mean? What can I do to prevent this. Thanks.

    Read the article

  • How to debug python del self.callbacks[s][cid] keyError when the error message does not indicate where in my code the error is

    - by lkloh
    In a python program I am writing, I get an error saying Traceback (most recent call last): File "/Applications/Canopy.app/appdata/canopy-1.4.0.1938.macosx- x86_64/Canopy.app/Contents/lib/python2.7/lib-tk/Tkinter.py", line 1470, in __call__ return self.func(*args) File "/Users/lkloh/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 413, in button_release_event FigureCanvasBase.button_release_event(self, x, y, num, guiEvent=event) File "/Users/lkloh/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1808, in button_release_event self.callbacks.process(s, event) File "/Users/lkloh/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/cbook.py", line 525, in process del self.callbacks[s][cid] KeyError: 103 Do you have any idea how I can debug this/ what could be wrong? The error message does not point to anywhere in code I have personally written. I get the error message only after I close my GUI window, but I want to fix it even though it does not break the functionality of my code. The error is part of a very big program I am writing, so I cannot post all my code, but below is code I think is relevant: def save(self, event): self.getSaveAxes() self.save_connect() def getSaveAxes(self): saveFigure = figure(figsize=(8,1)) saveFigure.clf() # size of save buttons rect_saveHeaders = [0.04,0.2,0.2,0.6] rect_saveHeadersFilterParams = [0.28,0.2,0.2,0.6] rect_saveHeadersOverride = [0.52,0.2,0.2,0.6] rect_saveQuit = [0.76,0.2,0.2,0.6] #initalize axes saveAxs = {} saveAxs['saveHeaders'] = saveFigure.add_axes(rect_saveHeaders) saveAxs['saveHeadersFilterParams'] = saveFigure.add_axes(rect_saveHeadersFilterParams) saveAxs['saveHeadersOverride'] = saveFigure.add_axes(rect_saveHeadersOverride) saveAxs['saveQuit'] = saveFigure.add_axes(rect_saveQuit) self.saveAxs = saveAxs self.save_connect() self.saveFigure = saveFigure show() def save_connect(self): #set buttons self.bn_saveHeaders = Button(self.saveAxs['saveHeaders'], 'Save\nHeaders\nOnly') self.bn_saveHeadersFilterParams = Button(self.saveAxs['saveHeadersFilterParams'], 'Save Headers &\n Filter Parameters') self.bn_saveHeadersOverride = Button(self.saveAxs['saveHeadersOverride'], 'Save Headers &\nOverride Data') self.bn_saveQuit = Button(self.saveAxs['saveQuit'], 'Quit') #connect buttons to functions they trigger self.cid_saveHeaders = self.bn_saveHeaders.on_clicked(self.save_headers) self.cid_savedHeadersFilterParams = self.bn_saveHeadersFilterParams.on_clicked(self.save_headers_filterParams) self.cid_saveHeadersOverride = self.bn_saveHeadersOverride.on_clicked(self.save_headers_override) self.cid_saveQuit = self.bn_saveQuit.on_clicked(self.save_quit) def save_quit(self, event): self.save_disconnect() close()

    Read the article

  • how do i install mod_wsgi2.6 in ubuntu

    - by subhransu
    I am getting problem while installing mod_wsgi 2.6 which supports python2.5 but i have python 2.6 as default in ubuntu. can you plz tell me whether i have to find a mod_wsgi V supporting python2.6 or i have to install python 2.5 and set the path.

    Read the article

  • Problem with installing sqlite3 module for python 2.6 in ubuntu system

    - by Hoang
    Hi, I need to run sqlite3 module on python 2.6 in ubuntu system. How do I install this module for Python 2.6? Somehow I don't have this module, it raises the error: import sqlite3 Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.6/sqlite3/init.py", line 24, in from dbapi2 import * File "/usr/local/lib/python2.6/sqlite3/dbapi2.py", line 27, in from _sqlite3 import * ImportError: No module named _sqlite3

    Read the article

  • Ganeti Web Manager ImportError: cannot import name lcd

    - by Lihnjo
    I have problem with installation Ganeti Web Manager on Debian 6.0.6 fab prod deploy Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/fabric/main.py", line 378, in main docstring, callables = load_fabfile(fabfile) File "/usr/lib/pymodules/python2.6/fabric/main.py", line 112, in load_fabfile imported = __import__(os.path.splitext(fabfile)[0]) File "/root/ganeti_webmgr/fabfile.py", line 6, in <module> from fabric.context_managers import settings, hide, lcd ImportError: cannot import name lcd Any solution? Thanks

    Read the article

  • Run serveral daemon using python

    - by ylc
    I noticed that serveral daemon invoked python seperately. For example, I have both wicd and ibus daemon running on my machine. Instead of launching a single instance of python, the daemons run with two python instance at the same time in htop: /usr/bin/python2 -O /usr/share/wicd/daemon/monitor.py python2 /usr/share/ibus/ui/gtk/main.py Is it a waste of doing that? If yes, how can I improve this? If no, why avoid putting all daemons run on a single python instance?

    Read the article

  • "device-mapper resume ioctl failed" when run a instance

    - by user1490377
    I install ubuntu-12.04 server and openstack on two computer. When Launch an image, the instance can't run and show error state! nova-compute.log details: 2012-06-24 12:02:00 DEBUG nova.utils [req-71fdca27-5f93-438e-a4be-ddc54f698171 c737b66b2102415f817ca50b9649fd8f 5b1da4eaee3643919a230efc06473720] Unexpected error while running command. Command: sudo nova-rootwrap kpartx -a /dev/nbd15 Exit code: 1 Stdout: '' Stderr: 'device-mapper: resume ioctl failed: Invalid argument\ncreate/reload failed on nbd15p1\n' from (pid=1267) trycmd /usr/lib/python2.7/dist-packages/nova/utils.py:277 2012-06-24 12:02:00 DEBUG nova.utils [req-71fdca27-5f93-438e-a4be-ddc54f698171 c737b66b2102415f817ca50b9649fd8f 5b1da4eaee3643919a230efc06473720] Running cmd (subprocess): sudo nova-rootwrap qemu-nbd -d /dev/nbd15 from (pid=1267) execute /usr/lib/python2.7/dist-packages/nova/utils.py:219 2012-06-24 12:02:02 DEBUG nova.virt.disk.api [req-71fdca27-5f93-438e-a4be-ddc54f698171 c737b66b2102415f817ca50b9649fd8f 5b1da4eaee3643919a230efc06473720] Failed to map partitions: Unexpected error while running command. Command: sudo nova-rootwrap kpartx -a /dev/nbd15 Exit code: 1 Stdout: '' Stderr: 'device-mapper: resume ioctl failed: Invalid argument\ncreate/reload failed on nbd15p1\n' from (pid=1267) mount /usr/lib/python2.7/dist-packages/nova/virt/disk/api.py:205

    Read the article

  • Python urllib.urlopen IOError

    - by Michael
    So I have the following lines of code in a function sock = urllib.urlopen(url) html = sock.read() sock.close() and they work fine when I call the function by hand. However, when I call the function in a loop (using the same urls as earlier) I get the following error: > Traceback (most recent call last): File "./headlines.py", line 256, in <module> main(argv[1:]) File "./headlines.py", line 37, in main write_articles(headline, output_folder + "articles_" + term +"/") File "./headlines.py", line 232, in write_articles print get_blogs(headline, 5) File "/Users/michaelnussbaum08/Documents/College/Sophmore_Year/Quarter_2/Innovation/Headlines/_code/get_content.py", line 41, in get_blogs sock = urllib.urlopen(url) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 87, in urlopen return opener.open(url) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 203, in open return getattr(self, name)(url) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 314, in open_http if not host: raise IOError, ('http error', 'no host given') IOError: [Errno http error] no host given Any ideas?

    Read the article

  • Macports sudo expands ~ to /var/root in python

    - by calavera
    This might be a bit dev-heavy for the site... but here goes. I installed the macports version of sudo. All is well, except for one thing. Using python 2.6 to expand ~ to the user's home directory results in a different output than the version of sudo that comes with Snow Leopard. For example consider the following python code: #expand_home_dir.py import os os.path.expanduser('~') Below are 3 different calls of the code listed above. The first call using sudo is using the Macports version because my $PATH begins with /opt/local/bin: robert$ python2.6 expand_home_dir.py /Users/robert robert$ sudo python2.6 expand_home_dir.py /var/root robert$ /usr/bin/sudo python2.6 expand_home_dir.py /Users/robert Any idea why this is happening?

    Read the article

  • parallel-python error: RuntimeError("Socket connection is broken")

    - by user288558
    I am using a simple program to send a function: import pp nodes=('mosura02','mosura03','mosura04','mosura05','mosura06', 'mosura09','mosura10','mosura11','mosura12') nodes=('miner:60001',) def pptester(): js=pp.Server(ppservers=nodes) js.set_ncpus(0) tmp=[] for i in range(200): tmp.append(js.submit(ppworktest,(),(),('os',))) return tmp def ppworktest(): import os return os.system("uname -a") the result is: wkerzend@mosura:/home/wkerzend/tmp/ppython_test>ssh miner "source ~/coala_python_setup.sh;ppserver.py -d -p 60001" 2010-04-12 00:50:48,162 - pp - INFO - Creating server instance (pp-1.6.0) 2010-04-12 00:50:52,732 - pp - INFO - pp local server started with 32 workers 2010-04-12 00:50:52,732 - pp - DEBUG - Strarting network server interface=0.0.0.0 port=60001 Exception in thread client_socket: Traceback (most recent call last): File "/usr/lib64/python2.6/threading.py", line 525, in __bootstrap_inner self.run() File "/usr/lib64/python2.6/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/wkerzend/python_coala/bin/ppserver.py", line 161, in crun ctype = mysocket.receive() File "/home/wkerzend/python_coala/lib/python2.6/site-packages/pptransport.py", line 178, in receive raise RuntimeError("Socket connection is broken") RuntimeError: Socket connection is broken

    Read the article

  • socket.setdefaulttimeout interacting with M2Crypto connection

    - by Becky
    Hello - I'm making a secure SSL connection to a server using python and M2Crypto. See code below. from M2Crypto import SSL, m2,x509 from M2Crypto.m2xmlrpclib import Server, SSL_Tranport ctx = SSL.Context() m2.ssl_ctx_use_pkey_privkey(ctx.ctx,myKey.pkey) m2.ssl_ctx_use_x509(ctx.ctx,myCert.x509) server = Server(serverUrl, SSL_Transport(ctx)) server.ping() The above works fine. If I try to change the default socket timeout by adding the following two lines at the beginning of the code, I get a protocol error. import socket socket.setdefaulttimeout(40) This is the error I receive: File "/usr/local/lib/python2.4/xmlrpclib.py", line 1096, in call return self._send(self._name, args) File "/usr/local/lib/python2.4/xmlrpclib.py", line 1383, in _request verbose=self._verbose File "/usr/local/lib/python2.4/site-packages/M2Crypto/m2xmlrpclib.py", line 68, in request headers xmlrpclib.ProtocolError: Why is the default socket timeout causing problems?

    Read the article

  • Stackless installation and configuration with DJango

    - by crashekar
    I am trying to run a DJango Command Extension which uses stackless. I have installed Stackless Python (compiled with python 2.5) so whenever I type python2.5 at the console it fires up indicating that the version is Python 2.5.2 Stackless 3.1b3 060516 (python-2.52:72942, May 26 2009, 23:07:34) [GCC 4.3.3] on linux2 But in my eclipse I have configured my django application to run with python2.6. Specifically in the PyDev settings. So obviously when I mention import stackless it says that there is no such package. The problem is even if I add the '/usr/local/lib/python2.5/site-packages' directory it does not import stackless. What is the solution to this issue ?

    Read the article

  • DeprecationWarning when pushing to Mercurial repo

    - by Josh Nankin
    I'm trying to serve a merurial repository with apache, and when I try to push to the repo I see this in the apache error.log. On the client side I get a 500 error. How do I get this to go away???? [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] /var/lib/python-support/python2.6/mercurial/hgweb/common.py:24: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] self.message = message [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] /var/lib/python-support/python2.6/mercurial/hgweb/hgweb_mod.py:104: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] if not inst.message: [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] /var/lib/python-support/python2.6/mercurial/hgweb/hgweb_mod.py:106: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 [Sun Jun 06 14:43:25 2010] [error] [client 192.168.1.8] return '0\\n%s\\n' % inst.message,

    Read the article

  • mod_wsgi | linux installation error

    - by MMRUser
    I'm getting the following error when I try to install mod_wsgi ./configure checking for apxs2... no checking for apxs... /usr/sbin/apxs checking Apache version... 2.2.3 configure: creating ./config.status config.status: creating Makefile make /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG mod_wsgi.c -L/usr/local/lib -L/usr/local/lib/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm /apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/local/include/python2.6 -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo sh: /apr-1/build/libtool: No such file or directory apxs:Error: Command failed with rc=8323072 . make: *** [mod_wsgi.la] Error 1 libtool is installed on my system.. mod_wsgi 3.2 *Apache 2.2* *Python 2.6*

    Read the article

  • Error running celeryd

    - by Eric Palakovich Carr
    I'm posting this question (and answer) so if anybody else has this problem in the future, you'll be able to google it. If you are trying to run celeryd in Django like so: python manage.py celeryd You can receive the following error immediately after it has started: celery@eric-desktop-dev has started. Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) <... snip ...> File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 134, in __init__ self._x_start_ok(d, login_method, login_response, locale) File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/connection.py", line 704, in _x_start_ok args.write_longstr(response) File "/usr/local/lib/python2.6/dist-packages/amqplib-0.6.1-py2.6.egg/amqplib/client_0_8/serialization.py", line 352, in write_longstr self.write_long(len(s)) TypeError: object of type 'NoneType' has no len() A rather cryptic error message, with no real clue as to where to go to fix the problem. See below for the answer so you don't waste a bunch of time on this error like I did today :)

    Read the article

  • Handle mysql restart in SQLAlchemy

    - by wRAR
    My Pylons app uses local MySQL server via SQLAlchemy and python-MySQLdb. When the server is restarted, open pooled connections are apparently closed, but the application doesn't know about this and apparently when it tries to use such connection it receives "MySQL server has gone away": File '/usr/lib/pymodules/python2.6/sqlalchemy/engine/default.py', line 277 in do_execute cursor.execute(statement, parameters) File '/usr/lib/pymodules/python2.6/MySQLdb/cursors.py', line 166 in execute self.errorhandler(self, exc, value) File '/usr/lib/pymodules/python2.6/MySQLdb/connections.py', line 35 in defaulterrorhandler raise errorclass, errorvalue OperationalError: (OperationalError) (2006, 'MySQL server has gone away') This exception is not caught anywhere so it bubbles up to the user. If I should handle this exception somewhere in my code, please show the place for such code in a Pylons WSGI app. Or maybe there is a solution in SA itself?

    Read the article

  • DEADLOCK_WRAP error when using Berkeley Db in python (bsddb)

    - by JiminyCricket
    I am using a berkdb to store a huge list of key-value pairs but for some reason when i try to access some of the data later i get this error: try: key = 'scrape011201-590652' contenttext = contentdict[key] except: print the error <type 'exceptions.KeyError'> 'scrape011201-590652' in contenttext = contentdict[key]\n', ' File "/usr/lib64/python2.5/bsddb/__init__.py", line 223, in __getitem__\n return _DeadlockWrap(lambda: self.db[key]) # self.db[key]\n', 'File "/usr/lib64/python2.5/bsddb/dbutils.py", line 62, in DeadlockWrap\n return function(*_args, **_kwargs)\n', ' File "/usr/lib64/python2.5/bsddb/__init__.py", line 223, in <lambda>\n return _DeadlockWrap(lambda: self.db[key]) # self.db[key]\n'] I am not sure what DeadlockWrap is but there isnt any other program or process accessing the berkdb or writing to it (as far as i know,) so not sure how we could get a deadlock, if its referring to that. Is it possible that I am trying to access the data to rapidly? I have this function call in a loop, so something like for i in hugelist: #try to get a value from the berkdb #do something with it I am running this with multiple datasets and this error only occurs with one of them, the largest one, not the others.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >