Search Results

Search found 721 results on 29 pages for 'stdout'.

Page 7/29 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Prob comparing pointers and integer in C

    - by Dimitri
    Hi I have a problem with this code. When i am using this function I have no warnings. : void handler(int sig){ switch(sig) { case SIGINT : { click++; fprintf(stdout,"SIGINT recu\n"); if( click == N){ exit(0); } } case SIGALRM : fprintf(stdout,"SIGALRM received\n"); exit(0); case SIGTERM: fprintf(stdout,"SIGTERM received\n"); exit(0); } } But when i rewrite the function with this new version, I have a " comparison between pointer and integer" warning on the if statement: void handler( int sig){ printf("Signal recu\n"); if( signal == SIGINT){ click++; fprintf(stdout,"SIGINT received; Click = %d\n",click); if(click == N){ fprintf(stdout,"Exiting with SIGINT\n"); exit(0); } } else if(signal == SIGALRM){ fprintf(stdout,"SIGALRM received\n"); exit(0); } else if(signal == SIGTERM){ fprintf(stdout,"SIGTERM received\n"); exit(0); } Can someone tell me where is the prob?

    Read the article

  • Why does redirecting "sudo echo" stdout to a file not give root ownership?

    - by orokusaki
    I'm pretty new to using Linux heavily, and I'm trying to learn more about file ownership and permissions. One thing that I stumbled on just now was exactly what the title says, running: weee@my-server:~$ sudo echo "hello" > some-file.txt weee@my-server:~$ ls -lh total 4.0K -rw-rw-r-- 1 weee weee 6 Dec 5 21:21 some-file.txt The file is owned by me, whereas touch works like one would expect: weee@my-server:~$ sudo touch other-file.txt weee@my-server:~$ ls -lh total 4.0K -rw-r--r-- 1 root root 0 Dec 5 21:22 other-file.txt How can I force the file to be created by root? Do I simply have to create the file in my homedir, then sudo chown root... and sudo mv ... move it to /var where I need it to be? I was hoping there'd be a single step to accomplish this.

    Read the article

  • Immediately tell which output was sent to stderr

    - by Clinton Blackmore
    When automating a task, it is sensible to test it first manually. It would be helpful, though, if any data going to stderr was immediately recognizeable as such, and distinguishable from the data going to stdout, and to have all the output together so it is obvious what the sequence of events is. One last touch that would be nice is if, at program exit, it printed its return code. All of these things would aid in automating. Yes, I can echo the return code when a program finishes, and yes, I can redirect stdout and stderr; what I'd really like it some shell, script, or easy-to-use redirector that shows stdout in black, shows stderr interleaved with it in red, and prints the exit code at the end. Is there such a beast? [If it matters, I'm using Bash 3.2 on Mac OS X]. Update: Sorry it has been months since I've looked at this. I've come up with a simple test script: #!/usr/bin/env python import sys print "this is stdout" print >> sys.stderr, "this is stderr" print "this is stdout again" In my testing (and probably due to the way things are buffered), rse and hilite display everything from stdout and then everything from stderr. The fifo method gets the order right but appears to colourize everything following the stderr line. ind complained about my stdin and stderr lines, and then put the output from stderr last. Most of these solutions are workable, as it is not atypical for only the last output to go to stderr, but still, it'd be nice to have something that worked slightly better.

    Read the article

  • python popen and mysql import

    - by khelll
    I'm doing the following: from subprocess import PIPE from subprocess import Popen file = 'dump.sql.gz' p1 = Popen(["gzip", "-cd" ,file], stdout=PIPE) print "Importing temporary file %s" % file p2 = Popen(["mysql","--default-character-set=utf8", "--user=root" , "--password=something", "--host=localhost", "--port=3306" , 'my_db'],stdin=p1.stdout, stdout=PIPE,stderr=PIPE) err = p1.communicate()[1] if err: print err err = p2.communicate()[1] if err: print err But the db is not being populated. No errors are shown, also I have checked p1.stdout and it has the file contents. Any ideas?

    Read the article

  • Python: Streaming Input with Subprocesses

    - by beary605
    Since input and raw_input() stop the program from running anymore, I want to use a subprocess to run this program... while True: print raw_input() and get its output. This is what I have as my reading program: import subprocess process = subprocess.Popen('python subinput.py', stdout=subprocess.PIPE, stderr=subprocess.PIPE) while True: output=process.stdout.read(12) if output=='' and process.poll()!=None: break if output!='': sys.stdout.write(output) sys.stdout.flush() When I run this, the subprocess exits almost as fast as it started. How can I fix this?

    Read the article

  • MASM StrCmp Undefined?

    - by Yvan JANSSENS
    Hi, If I try to assemble the following code, I get a A2006 error ( error A2006: undefined symbol : StrCmp). Here's my code: .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc include \masm32\include\user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\stdlib.lib includelib \masm32\lib\user32.lib .data YvanSoftware db "(c) YvanSoftware - ALL RIGHTS RESERVED", 13 ,10 ,0 EnterYourName db "Please enter your name: ", 0 CRLF db 13,10,0 TheHolyMan db "Yvan", 0 Seriously db "Seriously? You're the MAN!", 13,10,0 LoserName db "What a loser name.", 13,10 .data? buffer db 100 dup(?) .code start: invoke StdOut,addr YvanSoftware invoke StdOut, addr EnterYourName invoke StdIn, addr buffer, 100 invoke StdOut, addr CRLF invoke StrCmp,addr buffer, addr TheHolyMan ;error fires here je HolyMan IfNotHolyMan: invoke StdOut, addr LoserName jmp EndIfHolyMan HolyMan: invoke StdOut, addr Seriously jmp EndIfHolyMan EndIfHolyMan: invoke ExitProcess,0 END start I'm a complete n00b at assembler, and I'm trying to learn it. ;) Yvan

    Read the article

  • Can I use an opened gzip file with Popen in Python?

    - by eric.frederich
    I have a little command line tool that reads from stdin. On the command line I would run either... ./foo < bar or ... cat bar | ./foo With a gziped file I can run zcat bar.gz | ./foo in Python I can do ... Popen(["./foo", ], stdin=open('bar'), stdout=PIPE, stderr=PIPE) but I can't do import gzip Popen(["./foo", ], stdin=gzip.open('bar'), stdout=PIPE, stderr=PIPE) I wind up having to run p0 = Popen(["zcat", "bar"], stdout=PIPE, stderr=PIPE) Popen(["./foo", ], stdin=p0.stdout, stdout=PIPE, stderr=PIPE) Am I doing something wrong? Why can't I use gzip.open('bar') as an stdin arg to Popen?

    Read the article

  • How do I log from inside my web application in Tomcat 6.

    - by Carlos
    How do I log from within my web application deployed on Tomcat 6? Where should I expect the logging output to go (internal tomcat log files, or will another logfile be generated)? I see a ton of documentation but am having a hard time finding a direct answer to the above questions. Where should I expect the logging to show up (currently it is log4j is not generating a log file and it is not showing up in my console). I am trying to follow http://www.laliluna.de/articles/log4j-tutorial.html . ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### file appender log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.maxFileSize=100KB log4j.appender.file.maxBackupIndex=5 log4j.appender.file.File=test.log log4j.appender.file.threshold=info log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.rootLogger=debug, stdout In my application I define a log object: private static org.apache.log4j.Logger log = Logger.getLogger(MyClass.class); log.error("LOGGING!"); Thanks for the help.

    Read the article

  • How to transform multiple line into one line in bash stdout ?

    - by Samantha
    Hello, I sometimes do this in my shell : sam@sam-laptop:~/shell$ ps aux | grep firefox | awk '{print $2}' 2681 2685 2689 4645 $ kill -9 2681 2685 2689 4645 Is there a way I can transform the multiple lines containing the PIDs into one line separated by spaces ? (It's a little bit annoying to type the PIDs every time and I really would like to learn :) ) Thanks a lot.

    Read the article

  • Powershell $LastExitCode=0 but $?=False . Redirecting stderr to stdout gives NativeCommandError

    - by Colonel Panic
    Can anyone explain Powershell's surprising behaviour in the second example below? First, a example of sane behaviour: PS C:\> & cmd /c "echo Hello from standard error 1>&2"; echo "`$LastExitCode=$LastExitCode and `$?=$?" Hello from standard error $LastExitCode=0 and $?=True No surprises. I print a message to standard error (using cmd's echo). I inspect the variables $? and $LastExitCode. They equal to True and 0 respectively, as expected. However, if I ask Powershell to redirect standard error to standard output over the first command, I get a NativeCommandError: PS C:\> & cmd /c "echo Hello from standard error 1>&2" 2>&1; echo "`$LastExitCode=$LastExitCode and `$?=$?" cmd.exe : Hello from standard error At line:1 char:4 + cmd <<<< /c "echo Hello from standard error 1>&2" 2>&1; echo "`$LastExitCode=$LastExitCode and `$?=$?" + CategoryInfo : NotSpecified: (Hello from standard error :String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError $LastExitCode=0 and $?=False My first question, why the NativeCommandError ? Secondly, why is $? False when cmd ran successfully and $LastExitCode is 0? Powershell's docs about_Automatic_Variables don't explicitly define $?. I always supposed it is True if and only if $LastExitCode is 0 but my example contradicts that. Here's how I came across this behaviour in the real-world (simplified). It really is FUBAR. I was calling one Powershell script from another. The inner script: cmd /c "echo Hello from standard error 1>&2" if (! $?) { echo "Job failed. Sending email.." exit 1 } # do something else Running this simply .\job.ps1, it works fine, no email is sent. However, I was calling it from another Powershell script, logging to a file .\job.ps1 2>&1 > log.txt. In this case, an email is sent! Here, the act of observing a phenomenon changes its outcome. This feels like quantum physics rather than scripting! [Interestingly: .\job.ps1 2>&1 may or not blow up depending on where you run it]

    Read the article

  • Why is my code not printing anything to stdout?

    - by WM
    I'm trying to calculate the average of a student's marks: import java.util.Scanner; public class Average { public static void main(String[] args) { int mark; int countTotal = 0; // to count the number of entered marks int avg = 0; // to calculate the total average Scanner Scan = new Scanner(System.in); System.out.print("Enter your average: "); String Name = Scan.next(); while (Scan.hasNextInt()) { mark = Scan.nextInt(); countTotal++; avg = avg + ((mark - avg) / countTotal); } System.out.print( Name + " " + avg ); } }

    Read the article

  • How do I get stdout into mstest output when running in new app domain?

    - by btlog
    I have been working on test framework, which creates a new app domain to run the tests in. The primary reason being the dll's that we are testing has some horrible code that relies on the dll being located in the app domain path. (No I can't change this code.) The problem that I am having is that my test team is writing a bunch of functional tests in mstest and one of the loggers, that writes to Console.Out, does not have any of the log information captured in the trx output. When running the code through a console app all of the log information is output fine. So do the other loggers that have been implemented. My thought is that mstest is setting its own TextWriter to Console.Out, but the new app doamin has it's own TextWriter for Console.Out as the new app domain has it's own set of statics. I appreciate your ideas.

    Read the article

  • Ubuntu 12.04 LTS installation problem

    - by Zxy
    I am trying to install Ubuntu 12.04 LTS on my PC using WUBI. However, I keep getting this error: An error occured: *Error executing command >>command=C:\\System32\bcdedit.exe /set {2708afc0-9ffa-11e1-bc51-d167219ffa25} device partition=E: >>retval=1 >>stderr=An error has occured setting the element data. The request is not supported. >>stdout= For more information, please see the logfile:* Logfile: 06-11 10:57 DEBUG TaskList: ## Finished choose_disk_sizes 06-11 10:57 DEBUG TaskList: ## Running expand_diskimage... 06-11 10:59 DEBUG TaskList: ## Finished expand_diskimage 06-11 10:59 DEBUG TaskList: ## Running create_swap_diskimage... 06-11 10:59 DEBUG TaskList: ## Finished create_swap_diskimage 06-11 10:59 DEBUG TaskList: ## Running modify_bootloader... 06-11 10:59 DEBUG TaskList: New task modify_bcd 06-11 10:59 DEBUG TaskList: ### Running modify_bcd... 06-11 10:59 DEBUG WindowsBackend: modify_bcd Drive(C: hd 51255.1171875 mb free ntfs) 06-11 10:59 ERROR TaskList: Error executing command >>command=C:\Windows\System32\bcdedit.exe /set {2708afc0-9ffa-11e1-bc51-d167219ffa25} device partition=E: >>retval=1 >>stderr=An error has occurred setting the element data. The request is not supported. >>stdout= Traceback (most recent call last): File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__ File "\lib\wubi\backends\win32\backend.py", line 697, in modify_bcd File "\lib\wubi\backends\common\utils.py", line 66, in run_command Exception: Error executing command >>command=C:\Windows\System32\bcdedit.exe /set {2708afc0-9ffa-11e1-bc51-d167219ffa25} device partition=E: >>retval=1 >>stderr=An error has occurred setting the element data. The request is not supported. >>stdout= 06-11 10:59 DEBUG TaskList: # Cancelling tasklist 06-11 10:59 DEBUG TaskList: New task modify_bcd 06-11 10:59 ERROR root: Error executing command >>command=C:\Windows\System32\bcdedit.exe /set {2708afc0-9ffa-11e1-bc51-d167219ffa25} device partition=E: >>retval=1 >>stderr=An error has occurred setting the element data. The request is not supported. >>stdout= Traceback (most recent call last): File "\lib\wubi\application.py", line 58, in run File "\lib\wubi\application.py", line 132, in select_task File "\lib\wubi\application.py", line 158, in run_installer File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__ File "\lib\wubi\backends\win32\backend.py", line 697, in modify_bcd File "\lib\wubi\backends\common\utils.py", line 66, in run_command Exception: Error executing command >>command=C:\Windows\System32\bcdedit.exe /set {2708afc0-9ffa-11e1-bc51-d167219ffa25} device partition=E: >>retval=1 >>stderr=An error has occurred setting the element data. The request is not supported. >>stdout= 06-11 10:59 DEBUG TaskList: New task modify_bcd 06-11 10:59 DEBUG TaskList: New task modify_bcd 06-11 10:59 DEBUG TaskList: ## Finished modify_bootloader 06-11 10:59 DEBUG TaskList: # Finished tasklist*

    Read the article

  • Self Modifying Python? How can I redirect all print statements within a function without touching sys.stdout?

    - by Fake Name
    I have a situation where I am attempting to port some big, complex python routines to a threaded environment. I want to be able to, on a per-call basis, redirect the output from the function's print statement somewhere else (a logging.Logger to be specific). I really don't want to modify the source for the code I am compiling, because I need to maintain backwards compatibility with other software that calls these modules (which is single threaded, and captures output by simply grabbing everything written to sys.stdout). I know the best option is to do some rewriting, but I really don't have a choice here. Edit - Alternatively, is there any way I can override the local definition of print to point to a different function? I could then define the local print = system print unless overwritten by a kwarg, and would only involve modify a few lines at the beginning of each routine.

    Read the article

  • Non-blocking read on a stream in python.

    - by Mathieu Pagé
    Hi, I'm using the subprocess module to start a subprocess and connect to it's output stream (stdout). I want to be able to execute non-blocking reads on its stdout. Is there a way to make .readline non-bloking or to check if there is data on the stream before I invoke .readline? I'd like this to be portable or at least work under Windows and Linux. here is how I do it for now (It's blocking on the .readline if no data is avaible): p = subprocess.Popen('myprogram.exe', stdout = subprocess.PIPE) str = p.stdout.readline() Thanks for your help.

    Read the article

  • Properly using subprocess.PIPE in python?

    - by Gordon Fontenot
    I'm trying to use subprocess.Popen to construct a sequence to grab the duration of a video file. I've been searching for 3 days, and can't find any reason online as to why this code isn't working, but it keeps giving me a blank result: import sys import os import subprocess def main(): the_file = "/Volumes/Footage/Acura/MDX/2001/Crash Test/01 Acura MDX Front Crash.mov" ffmpeg = subprocess.Popen(['/opt/local/bin/ffmpeg', '-i', the_file], stdout = subprocess.PIPE, ) grep = subprocess.Popen(['grep', 'Duration'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) cut = subprocess.Popen(['cut', '-d', ' ', '-f', '4'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) sed = subprocess.Popen(['sed', 's/,//'], stdin = subprocess.PIPE, stdout = subprocess.PIPE, ) duration = sed.communicate() print duration if __name__ == '__main__': main()

    Read the article

  • Asynchronous subprocess on Windows

    - by Stigma
    First of all, the overall problem I am solving is a bit more complicated than I am showing here, so please do not tell me 'use threads with blocking' as it would not solve my actual situation without a fair, FAIR bit of rewriting and refactoring. I have several applications which are not mine to modify, which take data from stdin and poop it out on stdout after doing their magic. My task is to chain several of these programs. Problem is, sometimes they choke, and as such I need to track their progress which is outputted on STDERR. pA = subprocess.Popen(CommandA, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # ... some more processes make up the chain, but that is irrelevant to the problem pB = subprocess.Popen(CommandB, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=pA.stdout ) Now, reading directly through pA.stdout.readline() and pB.stdout.readline(), or the plain read() functions, is a blocking matter. Since different applications output in different paces and different formats, blocking is not an option. (And as I wrote above, threading is not an option unless at a last, last resort.) pA.communicate() is deadlock safe, but since I need the information live, that is not an option either. Thus google brought me to this asynchronous subprocess snippet on ActiveState. All good at first, until I implement it. Comparing the cmd.exe output of pA.exe | pB.exe, ignoring the fact both output to the same window making for a mess, I see very instantaneous updates. However, I implement the same thing using the above snippet and the read_some() function declared there, and it takes over 10 seconds to notify updates of a single pipe. But when it does, it has updates leading all the way upto 40% progress, for example. Thus I do some more research, and see numerous subjects concerning PeekNamedPipe, anonymous handles, and returning 0 bytes available even though there is information available in the pipe. As the subject has proven quite a bit beyond my expertise to fix or code around, I come to Stack Overflow to look for guidance. :) My platform is W7 64-bit with Python 2.6, the applications are 32-bit in case it matters, and compatibility with Unix is not a concern. I can even deal with a full ctypes or pywin32 solution that subverts subprocess entirely if it is the only solution, as long as I can read from every stderr pipe asynchronously with immediate performance and no deadlocks. :)

    Read the article

  • Perl open file problem

    - by alexBrand
    I am having some trouble trying to print from a file. Any ideas? Thanks open(STDOUT,">/home/int420_101a05/shttpd/htdocs/receipt.html"); print "alex"; close(STDOUT); open(INF,"/home/int420_101a05/shttpd/htdocs/receipt.html"); $emailBody = <INF>; close(INF); print $emailBody; ERRORS: Filehandle STDOUT reopened as INF only for input at ./test.c line 6. print() on closed filehandle STDOUT at ./test.c line 9.

    Read the article

  • How to create a log file in the folder which will be created at run time

    - by swati
    Hello Everyone, I new to apache logger.I am using apache log4j for my application. I am using the following configuration file configure the root logger log4j.rootLogger=INFO, STDOUT, DAILY configure the console appender log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.Target=System.out log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%p] %c:%L - %m%n configure the daily rolling file appender log4j.appender.DAILY=org.apache.log4j.DailyRollingFileAppender log4j.appender.DAILY.File=log4jtest.log log4j.appender.DAILY.DatePattern='.'yyyy-MM-dd-HH-mm log4j.appender.DAILY.layout=org.apache.log4j.PatternLayout log4j.appender.DAILY.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%p] %c:%L - %m%n So when my application runs it creates a folder called somename_2010-04-09-23-09 . My log file has to be created inside of this somename_2010-04-09-23-09 folder.(Which created at run time..). Is there anyway to do that.. Is there anyway we can specify in the configuration file so that it will create at run time the log file inside of the folder somename_2010-04-09-23-03 folder..? I would really appreciate if some one can answer to my questions. Thanks, Swati

    Read the article

  • log4j: Change format of loggers configured in another library.

    - by Ignacio Thayer
    Using clojure, I've been able to successfully setup log4j very simply by using this log4j.properties file, and including log4j in my classpath. # BEGIN log4j.properties log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern=%d{MMdd HHmmss SSS} %5p %c [%t] %m\n log4j.rootLogger=DEBUG, STDOUT Then after :use'ing clojure.contrib.logging, I'm able to print a statement with the desired formatting as expected like so: (info "About to print this") (debug "This is debug-level") My question is how to achieve a consistent formatting for logging statements made from loggers configured in other libraries. I thought I could find existing loggers using org.apache.log4j.LogManager.getCurrentLoggers() and change the PatternLayouts there, but I'm not able to iterate over that enumeration in clojure, as I get the following error: Dont know how to create ISeq from: java.util.Vector$1 I assume this is possible somehow, and probably very simply. How? Thanks much.

    Read the article

  • How to disable log4j logging from Java code

    - by Erel Segal Halevi
    I use a legacy library that writes logs using log4j. My default log4j.properties file directs the log to the console, but in some specific functions of my main program, I would like to disable logging altogether (from all classes). I tried this: Logger.getLogger(BasicImplementation.class.getName()).setLevel(Level.OFF); where "BasicImplementation" is one of the main classes that does logging, but it didn't work - the logs are still written to the console. Here is my log4j.properties: log4j.rootLogger=warn, stdout log4j.logger.ac.biu.nlp.nlp.engineml=info, logfile log4j.logger.org.BIU.utils.logging.ExperimentLogger=warn log4j.appender.stdout = org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout = org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern = %-5p %d{HH:mm:ss} [%t]: %m%n log4j.appender.logfile = ac.biu.nlp.nlp.log.BackupOlderFileAppender log4j.appender.logfile.append=false log4j.appender.logfile.layout = org.apache.log4j.PatternLayout log4j.appender.logfile.layout.ConversionPattern = %-5p %d{HH:mm:ss} [%t]: %m%n log4j.appender.logfile.File = logfile.log

    Read the article

  • Can anyone tell me why these lines are not working?

    - by user343934
    I am trying to generate tree with fasta file input and Alignment with MuscleCommandline import sys,os, subprocess from Bio import AlignIO from Bio.Align.Applications import MuscleCommandline cline = MuscleCommandline(input="c:\Python26\opuntia.fasta") child= subprocess.Popen(str(cline), stdout = subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform!="win32")) align=AlignIO.read(child.stdout,"fasta") outfile=open('c:\Python26\opuntia.phy','w') AlignIO.write([align],outfile,'phylip') outfile.close() I always encounter with these problems Traceback (most recent call last): File "", line 244, in run_nodebug File "C:\Python26\muscleIO.py", line 11, in align=AlignIO.read(child.stdout,"fasta") File "C:\Python26\Lib\site-packages\Bio\AlignIO_init_.py", line 423, in read raise ValueError("No records found in handle") ValueError: No records found in handle

    Read the article

  • Django install on a shared host, .htaccess help

    - by redconservatory
    I am trying to install Django on a shared host using the following instructions: docs.google.com/View?docid=dhhpr5xs_463522g My problem is with the following line on my root .htaccess: RewriteRule ^(.*)$ /cgi-bin/wcgi.py/$1 [QSA,L] When I include this line I get a 500 error with almost all of my domains on this account. My cgi-bin directory is home/my-username/public_html/cgi-bin/ The wcgi.py file contains: #!/usr/local/bin/python import os, sys sys.path.insert(0, "/home/username/django/") sys.path.insert(0, "/home/username/django/projects") sys.path.insert(0, "/home/username/django/projects/newprojects") import django.core.handlers.wsgi os.chdir("/home/username/django/projects/newproject") # optional os.environ['DJANGO_SETTINGS_MODULE'] = "newproject.settings" def runcgi(): environ = dict(os.environ.items()) environ['wsgi.input'] = sys.stdin environ['wsgi.errors'] = sys.stderr environ['wsgi.version'] = (1,0) environ['wsgi.multithread'] = False environ['wsgi.multiprocess'] = True environ['wsgi.run_once'] = True application = django.core.handlers.wsgi.WSGIHandler() if environ.get('HTTPS','off') in ('on','1'): environ['wsgi.url_scheme'] = 'https' else: environ['wsgi.url_scheme'] = 'http' headers_set = [] headers_sent = [] def write(data): if not headers_set: raise AssertionError("write() before start_response()") elif not headers_sent: # Before the first output, send the stored headers status, response_headers = headers_sent[:] = headers_set sys.stdout.write('Status: %s\r\n' % status) for header in response_headers: sys.stdout.write('%s: %s\r\n' % header) sys.stdout.write('\r\n') sys.stdout.write(data) sys.stdout.flush() def start_response(status,response_headers,exc_info=None): if exc_info: try: if headers_sent: # Re-raise original exception if headers sent raise exc_info[0], exc_info[1], exc_info[2] finally: exc_info = None # avoid dangling circular ref elif headers_set: raise AssertionError("Headers already set!") headers_set[:] = [status,response_headers] return write result = application(environ, start_response) try: for data in result: if data: # don't send headers until body appears write(data) if not headers_sent: write('') # send headers now if body was empty finally: if hasattr(result,'close'): result.close() runcgi() Only I changed the "username" to my username...

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >