reading/writing files in windows
sameer_ at email.com
Wed Jun 11 15:08:31 CEST 2003
thank you Peter for your ahem.... help. The function I pasted is part
of a larger system so in this context it might have seemed confusing.
I considered changing the name of the function to "n" but I do have a
"laborious" naming convention which explicitly says what the function
does. Generally, I have had a lot of good help in the python
newsgroup and those answers are usually good and go straight to the
point. I prefer the answer or no answer approach, rather than someone
who can go on and on about not having patience and lobriousness of my
naming convention. Do you really think you're being helpful? Not in
the least bit. I would much prefer someone who would give me a
straight answer or none at all if he doesn't understand my question.
Please learn to answer the question, and not drag on and on about
having no patience and your inability to understand, ad nauseam.
You're not a least bit helpful, and I don't need a reply to this,
Peter Hansen <peter at engcorp.com> wrote in message news:<3EE619A2.55D7AF44 at engcorp.com>...
> sameer wrote:
> > why would it need to be in binary mode?
> Because mixing text and binary mode under Windows can cause all sorts
> of trouble with line termination and obviously you are having problems
> with line termination so I was asking you to verify that you are at
> least use the same mode for each part of the process.
> What happens if you don't edit the file with Notepad? Why are you
> editing the file with Notepad? Can you produce a much smaller example
> program which still demonstrates the problem, preferably one that
> uses only five or ten lines and doesn't have a lot of distracting
> cruft that has no bearing on the problem at hand?
> > I create all files in 'a'
> > append mode. All my code reads the file only in 'r' mode. By
> > "jumbled" I you simply mean the lines are all joined together, as
> > though there were no linebreaks at all.
> At what point do the files appear to be corrupted? You say you
> are editing in Notepad, then saving, so presumably up until that
> point everything looks okay? Where do you notice the problem
> first arising? In the input routine laboriously called
> _extract_published_retrieved_email_object(), or elsewhere?
> Perhaps at the point it writes "raw message is >>>"? You
> don't appear to actually output anything anywhere else, so I
> can't tell what you mean.
> > the code that generates the contents of the file
> Sorry, I can't make head nor tails of what you're actually trying
> to do. Perhaps someone else with more patience will be willing
> to try to decipher it, or perhaps you can take a bit more time to
> carefully describe the missing detail.
More information about the Python-list