conda: Fetching package metadata: SSL verification error: EOF occurred in violation of protocol (_ssl.c:645)

2016-04-09 Thread Hongyi Zhao
Hi all, I use the latest conda, ie, Anaconda3-4.0.0-Linux-x86_64 to install some packages, but always meet the following error: $ conda install conda-build Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: SSL verification error: EOF occurred in violation of

Re: ^D vs ^Z as EOF and DOS dinosaurs talking (was: open() and EOFError)

2014-07-08 Thread Jan van den Broek
On 2014-07-08, Tim Chase wrote: > On 2014-07-09 01:49, Chris Angelico wrote: >> Have you ever used COPY CON to create a binary file? > > No, for that I used DEBUG.EXE (or DEBUG.COM on older versions of DOS) Both. -- Jan v/d Broek ba

Re: ^D vs ^Z as EOF and DOS dinosaurs talking (was: open() and EOFError)

2014-07-08 Thread Chris Angelico
On Wed, Jul 9, 2014 at 1:57 AM, Tim Chase wrote: > On 2014-07-09 01:49, Chris Angelico wrote: >> Have you ever used COPY CON to create a binary file? > > No, for that I used DEBUG.EXE (or DEBUG.COM on older versions of DOS) I never used a DOS version so old it had DEBUG.COM, but I used DEBUG.EXE

Re: ^D vs ^Z as EOF and DOS dinosaurs talking (was: open() and EOFError)

2014-07-08 Thread Tim Chase
On 2014-07-09 01:49, Chris Angelico wrote: > Have you ever used COPY CON to create a binary file? No, for that I used DEBUG.EXE (or DEBUG.COM on older versions of DOS) -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 crashes with 'Py_Initialize: can't initialize sys standard streams' + 'EOFError: EOF read where not expected'

2012-09-25 Thread Robison Santos
This problem does not happen very often, but when it happen is only on system startup, and I couldn't reproduce by starting by hand. My startup script tries to initiate a lot of services in sequence (ruby, java, C and python), but does not do anything with stdio streams, at least not directly. At

Re: Python 3 crashes with 'Py_Initialize: can't initialize sys standard streams' + 'EOFError: EOF read where not expected'

2012-09-25 Thread Robison Santos
ing system start >> time, and sometime when the apps are starting a corefile is generated for >> one one them (not always the same) and the following error is reported: >> >> "Fatal Python error: Py_Initialize: can't initialize sys standard streams >> EOFErr

Re: Python 3 crashes with 'Py_Initialize: can't initialize sys standard streams' + 'EOFError: EOF read where not expected'

2012-09-25 Thread Oscar Benjamin
On 25 September 2012 14:56, Robison Santos wrote: > I'm using python3.2.1 > on Enterprise Linux Server release 5.3 (Carthage). > > I'm starting my apps calling python3 file.py > > I have a script that runs on system startup executing my python scripts. > What happens if you just run the script

Re: Python 3 crashes with 'Py_Initialize: can't initialize sys standard streams' + 'EOFError: EOF read where not expected'

2012-09-25 Thread Oscar Benjamin
when the apps are starting a corefile is generated for one one > them (not always the same) and the following error is reported: > > "Fatal Python error: Py_Initialize: can't initialize sys standard streams > EOFError: EOF read where not expected" > What OS etc. are yo

Python 3 crashes with 'Py_Initialize: can't initialize sys standard streams' + 'EOFError: EOF read where not expected'

2012-09-25 Thread Robison Santos
s the same) and the following error is reported: "Fatal Python error: Py_Initialize: can't initialize sys standard streams EOFError: EOF read where not expected" Does anyone knows more about this problem and how can I fix it? Looking on the internet, I found issues related to the

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-18 Thread Yang Zhang
After way too much time, I figured it out, after a quote from [this post](http://fixunix.com/questions/379652-sending-eof-named-pipe.html) jumped out at me: > See the "I/O on Pipes and FIFOs" section of pipe(7) ("man 7 pipe") > > "If all file descriptors referri

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-13 Thread Yang Zhang
e expected 5. >>>>> >>>>> If you set `verbose=True`, you can see that the straggling subprocess >>>>> is receiving most of the messages, then waiting for the last chunk of >>>>> 3 chars---it's not detecting that the pipe has been

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Yang Zhang
ost of the messages, then waiting for the last chunk of >>>> 3 chars---it's not detecting that the pipe has been closed. >>>> Furthermore, if I simply don't do anything with the second process >>>> (`doreturn=True`), the first process will *never* se

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Jean-Michel Pichavant
iving most of the messages, then waiting for the last chunk of 3 chars---it's not detecting that the pipe has been closed. Furthermore, if I simply don't do anything with the second process (`doreturn=True`), the first process will *never* see the EOF. Any ideas what's happening?

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-09 Thread Yang Zhang
e`, you can see that the straggling subprocess >> is receiving most of the messages, then waiting for the last chunk of >> 3 chars---it's not detecting that the pipe has been closed. >> Furthermore, if I simply don't do anything with the second process >> (`doretu

Re: Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-08 Thread MRAB
-it's not detecting that the pipe has been closed. Furthermore, if I simply don't do anything with the second process (`doreturn=True`), the first process will *never* see the EOF. Any ideas what's happening? Further down is some example output. Thanks in advance. from subproces

Python subprocesses experience mysterious delay in receiving stdin EOF

2011-02-08 Thread Yang Zhang
een closed. Furthermore, if I simply don't do anything with the second process (`doreturn=True`), the first process will *never* see the EOF. Any ideas what's happening? Further down is some example output. Thanks in advance. from subprocess import * from threading import *

Fixing PDF EOF Errors with PyPDF

2010-11-14 Thread Brett Bowman
Hey all, I'm trying to read a library of my company's PDFs, but about a third of them can't be opened. PyPDF (v1.12) spits out this error: pyPdf.utils.PdfReadError: EOF marker not found I searched for the answer via google, but all I found was this link: http://lindaocta.com/?

Re: EOF while scanning triple-quoted string literal

2010-10-16 Thread Grant Edwards
On 2010-10-16, Steven D'Aprano wrote: > On Fri, 15 Oct 2010 20:07:37 +, Grant Edwards wrote: > >> Nor I, which is why I was confused by the statement that in the "Unix >> world" a lot of programs misbehaved when presented with files whose >> names contained a null byte. > > That's not what I s

Re: EOF while scanning triple-quoted string literal

2010-10-16 Thread Steven D'Aprano
On Fri, 15 Oct 2010 20:07:37 +, Grant Edwards wrote: > Nor I, which is why I was confused by the statement that in the "Unix > world" a lot of programs misbehaved when presented with files whose > names contained a null byte. That's not what I said. I said, TRY to create a file with a null by

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Martin Gregorie wrote: > On Fri, 15 Oct 2010 19:59:13 +, Grant Edwards wrote: > >> >> We're talking about Unix. >> We're not talking about CP/M, DOS, RSX-11m, Apple-SOS, etc. > > That's just your assumption. If you go back and look at my original posting in this thread, here's

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Martin Gregorie
On Fri, 15 Oct 2010 19:59:13 +, Grant Edwards wrote: > > We're talking about Unix. > We're not talking about CP/M, DOS, RSX-11m, Apple-SOS, etc. > That's just your assumption. Track back up the thread and you'll see that the OP didn't mention an OS. He merely said that he was using zlib, and

Re: Windows binary stdin goes EOF after \x1a character

2010-10-15 Thread Neil Cerutti
On 2010-10-15, MRAB wrote: >> I wrote an equivalent program in C++ using the win32 >> ReadFile() call, and it read all 255 bytes just fine. What am >> I doing wrong with the python code? >> >> >> I am using Erlang to launch the Python program as a subprocess. The >> Erlang fragment that launches

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Chris Torek wrote: >>> On 2010-10-15, Grant Edwards wrote: How do you create a [Unix] file with a name that contains a NULL byte? > >>On 2010-10-15, Seebs wrote: >>> So far as I know, in canonical Unix, you don't -- the syscalls all work >>> with something like C strings unde

Re: Windows binary stdin goes EOF after \x1a character

2010-10-15 Thread MRAB
On 15/10/2010 20:28, Dan wrote: I am writing a Windows program in Python 3.1.2 that reads binary data from stdin. Whenever it hits a \x1a character, stdin goes EOF and no more data can be read. A short program that exhibits this problem is: #listing of main.pyw import sys def go(): bb

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Seebs wrote: > On 2010-10-15, Grant Edwards wrote: >> Yes, all of the Unix syscalls use NULL-terminated path parameters >> (AKA "C strings"). What I don't know is whether the underlying >> filesystem code also uses NULL-terminated strings for filenames or if >> they have explicit

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Martin Gregorie wrote: >> On 2010-10-15, Martin Gregorie wrote: >>> On Fri, 15 Oct 2010 17:02:07 +, Grant Edwards wrote: On 2010-10-15, Steven D'Aprano : > In the Unix world, which includes OS X, text tools tend to have > difficulty with tabs. Or try naming a

Re: Windows binary stdin goes EOF after \x1a character

2010-10-15 Thread Dan
On Oct 15, 2:42 pm, Neil Cerutti wrote: > On 2010-10-15, Dan wrote: > > > I am writing a Windows program in Python 3.1.2 that reads > > binary data from stdin.  Whenever it hits a \x1a character, > > stdin goes EOF and no more data can be read.  A short program > >

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Chris Torek
>> On 2010-10-15, Grant Edwards wrote: >>> How do you create a [Unix] file with a name that contains a NULL byte? >On 2010-10-15, Seebs wrote: >> So far as I know, in canonical Unix, you don't -- the syscalls all work >> with something like C strings under the hood, meaning that no matter what >

Re: Windows binary stdin goes EOF after \x1a character

2010-10-15 Thread Neil Cerutti
On 2010-10-15, Dan wrote: > I am writing a Windows program in Python 3.1.2 that reads > binary data from stdin. Whenever it hits a \x1a character, > stdin goes EOF and no more data can be read. A short program > that exhibits this problem is: stdin is not in binary mode. Try invo

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Seebs
On 2010-10-15, Grant Edwards wrote: > Yes, all of the Unix syscalls use NULL-terminated path parameters (AKA > "C strings"). What I don't know is whether the underlying filesystem > code also uses NULL-terminated strings for filenames or if they have > explicit lengths. If the latter, there migh

Windows binary stdin goes EOF after \x1a character

2010-10-15 Thread Dan
I am writing a Windows program in Python 3.1.2 that reads binary data from stdin. Whenever it hits a \x1a character, stdin goes EOF and no more data can be read. A short program that exhibits this problem is: #listing of main.pyw import sys def go(): bb=sys.stdin.buffer.raw.read(1

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Martin Gregorie
On Fri, 15 Oct 2010 18:14:13 +, Grant Edwards wrote: > On 2010-10-15, Martin Gregorie wrote: >> On Fri, 15 Oct 2010 17:02:07 +, Grant Edwards wrote: >> >>> On 2010-10-15, Steven D'Aprano >>> wrote: >>> In the Unix world, which includes OS X, text tools tend to have difficulty

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Seebs wrote: > On 2010-10-15, Grant Edwards wrote: >> On 2010-10-15, Steven D'Aprano wrote: >>> In the Unix world, which includes OS X, text tools tend to have >>> difficulty with tabs. Or try naming a file with a newline or carriage >>> return in the file name, or a NULL byte. >

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Seebs
On 2010-10-15, Grant Edwards wrote: > On 2010-10-15, Steven D'Aprano wrote: >> In the Unix world, which includes OS X, text tools tend to have >> difficulty with tabs. Or try naming a file with a newline or carriage >> return in the file name, or a NULL byte. > How do you create a file with a n

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Martin Gregorie wrote: > On Fri, 15 Oct 2010 17:02:07 +, Grant Edwards wrote: > >> On 2010-10-15, Steven D'Aprano >> wrote: >> >>> In the Unix world, which includes OS X, text tools tend to have >>> difficulty with tabs. Or try naming a file with a newline or carriage >>> retu

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Martin Gregorie
On Fri, 15 Oct 2010 17:02:07 +, Grant Edwards wrote: > On 2010-10-15, Steven D'Aprano > wrote: > >> In the Unix world, which includes OS X, text tools tend to have >> difficulty with tabs. Or try naming a file with a newline or carriage >> return in the file name, or a NULL byte. > > How do

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Grant Edwards
On 2010-10-15, Steven D'Aprano wrote: > In the Unix world, which includes OS X, text tools tend to have > difficulty with tabs. Or try naming a file with a newline or carriage > return in the file name, or a NULL byte. How do you create a file with a name that contains a NULL byte? -- Grant E

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Ian
On Oct 14, 10:30 pm, Lawrence D'Oliveiro wrote: > In message , Rhodri James wrote: > > > ... frankly putting arbitrary binary into a literal string is rather > > asking for something like this to come and bite you. > > It normally works fine on sensible OSes. Which OSes would those be? It doesn'

Re: EOF while scanning triple-quoted string literal

2010-10-15 Thread Steven D'Aprano
On Fri, 15 Oct 2010 17:30:20 +1300, Lawrence D'Oliveiro wrote: > In message , Rhodri James wrote: > >> ... frankly putting arbitrary binary into a literal string is rather >> asking for something like this to come and bite you. > > It normally works fine on sensible OSes. What does it have to d

Re: EOF while scanning triple-quoted string literal

2010-10-14 Thread Lawrence D'Oliveiro
In message , Rhodri James wrote: > ... frankly putting arbitrary binary into a literal string is rather > asking for something like this to come and bite you. It normally works fine on sensible OSes. -- http://mail.python.org/mailman/listinfo/python-list

Re: EOF while scanning triple-quoted string literal

2010-10-11 Thread Ian Kelly
On Mon, Oct 11, 2010 at 3:59 PM, Rhodri James wrote: > On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere > wrote: > > > i've looked on the web and here but i didn't find an answer : here is my >> code >> >> zlib.decompress(""" >> xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà >> z...@ÑÁÔqÇlxÇÆïpp >> ~ýVãì゙M6ÛÐ|ê֭ᄁᄂヤ=)}

Re: EOF while scanning triple-quoted string literal

2010-10-11 Thread Rhodri James
On Mon, 11 Oct 2010 10:37:09 +0100, bussiere bussiere wrote: i've looked on the web and here but i didn't find an answer : here is my code zlib.decompress(""" xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà z...@ÑÁÔqÇlxÇÆïpp~ývãì゙m6ÛÐ|ê֭ᄁᄂヤ=)}éÓUe﬿ö3ᄎᄌú"}ʿïÿ÷1þ8ñ́U÷ᄏñíLÒVi:`ᄈᄎL!Ê҆p6-%Fë^ヘ÷à,Q.K!ユô`ÄA!ÑêweÌ ÊÚAロYøøÂjôóᅠÂcñ

EOF while scanning triple-quoted string literal

2010-10-11 Thread bussiere bussiere
i've looked on the web and here but i didn't find an answer : here is my code zlib.decompress(""" xワᆳヤ=ラᄇHナs~Ʀᄑç\ムîà z...@ÑÁÔqÇlxÇÆïpp~ývãì゙m6ÛÐ|ê֭ᄁᄂヤ=)}éÓUe﬿ö3ᄎᄌú"}ʿïÿ÷1þ8ñ́U÷ᄏñíLÒVi:`ᄈᄎL!Ê҆p6-%Fë^ヘ÷à,Q.K!ユô`ÄA!ÑêweÌ ÊÚAロYøøÂjôóᅠÂcñ䊧fᆴùテúN :nüzAÝ7%ᄌcdUタᄌ3ôPۂタlンyHᆲᄑ$/yzᄒíàヌ'ÕÓ&`|S!<'ᄂ÷Zļᄐ2ホモ;ニ(ÅÛf

Re: EOFError: EOF when reading a line

2010-03-11 Thread Gabriel Genellina
En Thu, 11 Mar 2010 06:12:02 -0300, Mihir Patel escribió: I am trying to use the subprocess to send the data to child process. I am not sure why i keep getting "EOFError: EOF when reading a line" command_line = 'python test_input.py' p =subprocess.Popen(command_lin

EOFError: EOF when reading a line

2010-03-11 Thread Mihir Patel
I am trying to use the subprocess to send the data to child process. I am not sure why i keep getting "EOFError: EOF when reading a line" i am using Python 2.4.3, GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on 64bit linux ,centos Thanks output : = Traceback (most recent call las

Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Terry Reedy wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that the module PyQt4 already exists in sys.modules, so Pyth

Re: del an imported Class at EOF... why?

2009-10-08 Thread Terry Reedy
Simon Forman wrote: On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy wrote: Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that th

Re: del an imported Class at EOF... why?

2009-10-08 Thread Simon Forman
On Thu, Oct 8, 2009 at 1:42 AM, Terry Reedy wrote: > Hans Mulder wrote: > >> Errrhm, no.  He is not deleting the PyQt4 module from sys.modules; >> he's only deleting the name QtGui from his own namespace.  Next >> time Python comes across >> >>    from PyQt4 import QtGui >> >> , it finds that the

Re: del an imported Class at EOF... why?

2009-10-07 Thread Terry Reedy
Hans Mulder wrote: Errrhm, no. He is not deleting the PyQt4 module from sys.modules; he's only deleting the name QtGui from his own namespace. Next time Python comes across from PyQt4 import QtGui , it finds that the module PyQt4 already exists in sys.modules, so Python does not have to

Re: del an imported Class at EOF... why?

2009-10-07 Thread Steven D'Aprano
On Wed, 07 Oct 2009 02:31:00 -0700, Ryan wrote: > Thanks everyone for your insight. I'm going to have to agree with the > paranoid desire to prevent people importing his module and then using > the > classes he imports from elsewhere (I'm not ruling out the lead paint > theory until I can gather m

Re: del an imported Class at EOF... why?

2009-10-07 Thread Carl Banks
On Oct 7, 2:31 am, Ryan wrote: > Thanks everyone for your insight. I'm going to have to agree with the > paranoid desire to prevent people importing his module and then using > the > classes he imports from elsewhere (I'm not ruling out the lead paint > theory until I can gather more evidence). I

Re: del an imported Class at EOF... why?

2009-10-07 Thread Hans Mulder
Ryan wrote: [] It does beg the question for me. Consider the example from his code below from PyQt4 import QtGui class LauncherWidget( QtGui.QWidget ): # A Specialization of QWidget del QtGui Next time python comes across from PyQt4 import QtGui it would have to re-import the class,

Re: del an imported Class at EOF... why?

2009-10-07 Thread Stephen Hansen
On Wed, Oct 7, 2009 at 2:31 AM, Ryan wrote: > Next time python comes across > > from PyQt4 import QtGui > > it would have to re-import the class, which seems a waste of cycles > that could accumulate. Python only imports modules once. The next time Python comes across that, it looks in sys.modu

Re: del an imported Class at EOF... why?

2009-10-07 Thread Ryan
Thanks everyone for your insight. I'm going to have to agree with the paranoid desire to prevent people importing his module and then using the classes he imports from elsewhere (I'm not ruling out the lead paint theory until I can gather more evidence). It does beg the question for me. Consider th

Re: del an imported Class at EOF... why?

2009-10-06 Thread alex23
Steven D'Aprano wrote: > import alienmodule > > class MyClass(alienmodule.AlienClass): >     do_stuff() > > rather than: > > from alienmodule import AlienClass > > class MyClass(AlienClass): >     do_stuff() > > del AlienClass The original developer may also have been unaware of the ability to li

Re: del an imported Class at EOF... why?

2009-10-06 Thread Steven D'Aprano
On Tue, 06 Oct 2009 10:56:26 -0700, Ryan wrote: > Good day all! > > I've just inherited a large amount of python code. After spending some > time pour through the code, I've noticed that the original developer > (who is no longer w/ the company) constantly deletes the imported > classes at the en

Re: del an imported Class at EOF... why?

2009-10-06 Thread Dave Angel
Carl Banks wrote: On Oct 6, 10:56 am, Ryan wrote: Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported classes at the end of

Re: del an imported Class at EOF... why?

2009-10-06 Thread Carl Banks
On Oct 6, 10:56 am, Ryan wrote: > Good day all! > > I've just inherited a large amount of python code. After spending some > time pour through the code, I've noticed that the original developer > (who is no longer w/ the company) constantly deletes the imported > classes at the end of the .py file

del an imported Class at EOF... why?

2009-10-06 Thread Ryan
Good day all! I've just inherited a large amount of python code. After spending some time pour through the code, I've noticed that the original developer (who is no longer w/ the company) constantly deletes the imported classes at the end of the .py file. Why would one want to do such a thing? Ry

Re: EOF problem with ENTER

2009-06-12 Thread Jean-Michel Pichavant
Prasoon wrote: I modified my code to #Euler Totient Function import sys from math import sqrt def etf(n): i,res =2,n while(i*i<=n): if(n%i==0): res-=res/i while(n%i==0): n/=i i+=1 if(n>1): res-=res/n return res def main(): while Tr

Re: EOF problem with ENTER

2009-06-12 Thread Prasoon
> You could do: > > while True: >    x = raw_input("Enter x=>") >    if x != "" : break # if you just press enter, raw_input returns an > empty string > > Note that this still leaves out the case when you type something which > is not a number. > To cover this case, supposing that you need a float

Re: EOF problem with ENTER

2009-06-12 Thread Francesco Bochicchio
f(x)) > > >    t-=1 > > > > if __name__ == "__main__": > > >  main() > > > > The problem with my code is that whenever I press an extra "Enter" > > > button instead of getting the cursor moved to the next line.I get > >

Re: EOF problem with ENTER

2009-06-11 Thread Prasoon
eturn res > > > def main(): > >  t=input() > >  while(t): > >    x=input() > >    print str(etf(x)) > >    t-=1 > > > if __name__ == "__main__": > >  main() > > > The problem with my code is that whenever I press an extra "En

Re: EOF problem with ENTER

2009-06-11 Thread Prasoon
eturn res > > > def main(): > >  t=input() > >  while(t): > >    x=input() > >    print str(etf(x)) > >    t-=1 > > > if __name__ == "__main__": > >  main() > > > The problem with my code is that whenever I press an extra "En

Re: EOF problem with ENTER

2009-06-11 Thread Chris Rebert
> if __name__ == "__main__": >  main() > > > The problem with my code is that whenever I press an extra "Enter" > button instead of getting the cursor moved to the next line.I get > an error > > _SyntaxError- EOF while parsing and the program ter

EOF problem with ENTER

2009-06-11 Thread Prasoon
ved to the next line.I get an error _SyntaxError- EOF while parsing and the program terminates.._ How should the code be modified so that even after pressing an extra "Enter" button the cursor get moved to the next line instead to throwing an exception.. Prasoo

Re: Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

2009-01-12 Thread Steve Holden
Gabriel Genellina wrote: > En Sun, 11 Jan 2009 08:12:27 -0200, Barak, Ron > escribió: > >> I googled a bit, and found http://bugs.python.org/issue1355023. >> It seems that this patch implemented fuller seek() for GzipFile around >> November 2006 (including whence==2). >> Do I misunderstand and th

Re: Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

2009-01-11 Thread Gabriel Genellina
En Sun, 11 Jan 2009 08:12:27 -0200, Barak, Ron escribió: I googled a bit, and found http://bugs.python.org/issue1355023. It seems that this patch implemented fuller seek() for GzipFile around November 2006 (including whence==2). Do I misunderstand and this patch was not actually implemented,

Re: Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

2009-01-11 Thread Mark Tolonen
7;re familiar with the inner working of gzip settle this issue ? Is seek from EOF supported for gzip files ? Source from 2.6.1. Seek from EOF not supported: def seek(self, offset, whence=0): if whence: if whence == 1: offset = self.offset + offset e

Is negative seek() from EOF of a GzipFile supported on Python 2.5.2 ?

2009-01-11 Thread Barak, Ron
ive seek self.rewind() count = offset - self.offset for i in range(count // 1024): self.read(1024) self.read(count % 1024) Could any who're familiar with the inner working of gzip settle this issue ? Is seek from EOF supported for gzip files

Re: ftp EOF error, thread and process

2008-12-28 Thread Gabriel Genellina
En Sun, 28 Dec 2008 10:44:11 -0200, nemo escribió: My code like this raise an EOFError, It happens if I use the Process module, while, if I use thread.start_new_thread(ftp.pwd,()), it seems works well. And I wondered why. from ftplib import FTP import thread from multiprocessing import Process

ftp EOF error, thread and process

2008-12-28 Thread nemo
Hi all, My code like this raise an EOFError, It happens if I use the Process module, while, if I use thread.start_new_thread(ftp.pwd,()), it seems works well. And I wondered why. from ftplib import FTP import thread from multiprocessing import Process if __name__ == '__main__': ftp = FTP('loc

Re: EOF

2008-08-24 Thread Anjanesh Lekshminarayanan
e from a server. But how do I detect EOF ? Whenever read() method returns empty string/list. while f1: # When to stop ? retval = f1.read() if not retval: break f2.write(retval) Those read() should be read(size) - read() tries to get the whole co

Re: EOF

2008-08-24 Thread Gabriel Genellina
En Fri, 22 Aug 2008 16:53:58 -0300, Wojtek Walczak <[EMAIL PROTECTED]> escribió: > On Fri, 22 Aug 2008 22:18:37 +0530, Anjanesh Lekshminarayanan wrote: > >> Im trying to download a file from a server. But how do I detect EOF ? > > Whenever read() method returns empty stri

Re: EOF

2008-08-22 Thread Eric Wertman
>> Im trying to download a file from a server. But how do I detect EOF ? Shouldn't this work as well? f1 = urllib2.urlopen('ftp://username:[EMAIL PROTECTED]/data.zip') f2 = file("data.zip", "wb") while f1: # When to stop ? try : f2

Re: EOF

2008-08-22 Thread Wojtek Walczak
On Fri, 22 Aug 2008 22:18:37 +0530, Anjanesh Lekshminarayanan wrote: > Im trying to download a file from a server. But how do I detect EOF ? Whenever read() method returns empty string/list. > while f1: # When to stop ? retval = f1.read() if not retval: break f2

EOF

2008-08-22 Thread Anjanesh Lekshminarayanan
|Hi Im trying to download a file from a server. But how do I detect EOF ? || import urllib2 f1 = urllib2.urlopen('ftp://username:[EMAIL PROTECTED]/data.zip') f2 = file("data.zip", "wb") while f1: # When to stop ? f2.write(f1.read(1024)) f1.close() f2.c

Re: readln() until EOF

2008-07-24 Thread Bruno Desthuilliers
korean_dave a écrit : a = open("Thefile.txt","r") while ?: result = a.readln() I assume you meant "a.readline()" ? Anyway... what do i put in if i want to keep reading line by line until i reach the end of the file? a = open("path/to/file.ext") for line in a: do_something_wit

Re: readln() until EOF

2008-07-24 Thread Stephen Johnson
the_file = open(path, 'r') for this_line in the_file: #do stuff with this_line -Steve Johnson On Jul 24, 2008, at 3:09 PM, korean_dave wrote: a = open("Thefile.txt","r") while ?: result = a.readln() what do i put in if i want to keep reading line by line until i reach the e

readln() until EOF

2008-07-24 Thread korean_dave
a = open("Thefile.txt","r") while ?: result = a.readln() what do i put in if i want to keep reading line by line until i reach the end of the file? I don't want to break the loop if there is a blank line, because there will be. Ex. of a file: map1 result1 map2 result 2 map3 result

Re: Token Error: EOF in multiline statement

2008-06-05 Thread Terry Reedy
"Matimus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Jun 5, 12:58 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: | > I'm not sure what it means but it always highlights the last line with | > nothing on it. My program has 63 lines and it highlights the 64th | > line. This keeps p

Re: Token Error: EOF in multiline statement

2008-06-05 Thread Matimus
On Jun 5, 12:58 pm, maehhheeyy <[EMAIL PROTECTED]> wrote: > I'm not sure what it means but it always highlights the last line with > nothing on it. My program has 63 lines and it highlights the 64th > line. This keeps popping up whenever I try to run my program. Can you > please help me fix this?

Token Error: EOF in multiline statement

2008-06-05 Thread maehhheeyy
I'm not sure what it means but it always highlights the last line with nothing on it. My program has 63 lines and it highlights the 64th line. This keeps popping up whenever I try to run my program. Can you please help me fix this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't figure out traceback: (error_proto(-ERR EOF) line 121 poplib.py

2008-04-09 Thread Gabriel Genellina
En Wed, 09 Apr 2008 02:19:47 -0300, erikcw <[EMAIL PROTECTED]> escribió: > I keep getting this error from poplib: > (error_proto(-ERR EOF) line 121 poplib.py > > Does this mean the connection has timed out? What can I do to deal > with it? If it happens from time to

Can't figure out traceback: (error_proto(-ERR EOF) line 121 poplib.py

2008-04-08 Thread erikcw
Hi, I keep getting this error from poplib: (error_proto(-ERR EOF) line 121 poplib.py Does this mean the connection has timed out? What can I do to deal with it? Thanks! Erik -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-12-08 Thread jjnoakes
On Nov 24, 12:03 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > > class open(file): > def __init__(self, name): > self.size = os.stat(name).st_size > file.__init__(self, name) > def eof(self): > return self.tell() == self.size > > f = open('tmp

Re: eof

2007-12-08 Thread jjnoakes
# ==> Empty String f.eof # ==> True In other words, don't rely on "f.eof" telling you that there is or is not more data... on Unix systems, no matter what, you ALWAYS have to read past EOF to detect it. Languages (like C with FILE*, or Ruby, or anything else) that detects EOF eit

Re: eof

2007-11-26 Thread Boris Borcic
ZeD wrote: > Grant Edwards wrote: > >> The user-defined xor is operates on "logical" boolean values. >> The one in the operator module is a bitwise operator. > > def xor(a, b): > return bool(a) ^ bool(b) > > seems more explicit to me. > maybe, to make "more" explicit (too much, onestly...) >

Re: eof

2007-11-26 Thread ZeD
Grant Edwards wrote: > The user-defined xor is operates on "logical" boolean values. > The one in the operator module is a bitwise operator. def xor(a, b): return bool(a) ^ bool(b) seems more explicit to me. maybe, to make "more" explicit (too much, onestly...) from operator import xor as b

Re: eof

2007-11-26 Thread Grant Edwards
On 2007-11-26, Boris Borcic <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> def xor(a, b): >> return a and not b or b and not a > > > >>> from operator import xor > >>> help(xor) > Help on built-in function xor in module operator: > > xor(...) > xor(a, b) -- Same as a ^ b. Which

Re: eof

2007-11-26 Thread Boris Borcic
[EMAIL PROTECTED] wrote: > def xor(a, b): > return a and not b or b and not a >>> from operator import xor >>> help(xor) Help on built-in function xor in module operator: xor(...) xor(a, b) -- Same as a ^ b. -- http://mail.python.org/mailman/listinfo/python-list

setting attributes on external types (was Re: eof)

2007-11-24 Thread samwyse
On Nov 23, 2:06 am, greg <[EMAIL PROTECTED]> wrote: > There's a fair amount of overhead associated with providing > the ability to set arbitrary attributes on an object, which > is almost never wanted for built-in types, so it's not > provided by default. > > You can easily get it if you want it by

Re: eof

2007-11-23 Thread greg
t;lazy" scheme which deferred the read until you tried to do something with the buffer. But they couldn't completely hide the fact that testing for eof requires a lookahead. > Original Pascal uses > > f = open(somefile) > do something with f^ > read(f) Actually, I think

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 10:43 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This is not the same as ISO C. f.tell could be equal to > File.size(f.path) and eof could be false. An extra read() is required. My bad. As you might have surmised, I'm not a genius when it comes t

Re: eof

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 24, 2:24 am, MonkeeSage <[EMAIL PROTECTED]> wrote: > > Actually, to be a bit more technical, IO#eof acts like standard C eof > for File objects, it only blocks / requires a previous read() on > character devices and pipes and such. For files, it's the same as

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 10:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Ruby doesn't have the good ol' eof. Good old eof tests a single flag > and requires a pre read(). Ruby's eof blocks and does buffering (and > this is a very strong technical statement

Re: eof

2007-11-23 Thread [EMAIL PROTECTED]
On Nov 22, 1:17 pm, braver <[EMAIL PROTECTED]> wrote: > Ruby has iterators and generators too, but it also has my good ol' > f.eof(). I challenge the assumption here of some majectically Python- Ruby doesn't have the good ol' eof. Good old eof tests a single f

Re: eof

2007-11-23 Thread MonkeeSage
On Nov 23, 6:56 pm, greg <[EMAIL PROTECTED]> wrote: > By not providing an eof() function, C -- and Python -- make > it clear that testing for eof is not a passive operation. > It's always obvious what's going on, and it's much harder to > make mistakes like the ab

Re: eof

2007-11-23 Thread greg
braver wrote: > Historically, is it possible to trace the eof-related design decision > in stdlib? You seem to be assuming that someone started out with a design that included an eof() of the kind you want, and then decided to remove it. But I doubt that such a method was ever considered

Re: eof

2007-11-23 Thread Neil Cerutti
On 2007-11-23, braver <[EMAIL PROTECTED]> wrote: > Can we say that f.eof() in fact can check for EOF right after > we've read all characters from a file, but before a failed > attempt to read beyond? In Python's idiom, > > for line lin file: ># look at a

  1   2   3   >