* Steven D'Aprano:
I have no idea what commented lines NOT shown you are talking about, but
you attacked Brian for referring to the NameError relating to framerate.
Well, first, let me state that this is debating details of something irrelevant
to anything.
Now, that said, Brian responded (first response, Brian subsequently made a patch
which fixed not just the bugs but also the unit test, so very good everything!),
<quote>
In your example, the "n_frames" name does not exist, which is causing the
problem. In your first comment, "framerate" also did not exist.
I don't know what a proper frame rate value is, but I just put 10 in there
and it worked fine. Can you confirm?
</quote>
Note that the "n_frames" that Brian here thinks "is causing the problem" is a
name only used in a comment in the demo code.
You claimed that he was:
thinking instead that maybe a "wrong" name in *a comment*
might be the culprit
But in fact your initial error report included this traceback, which
displays a very much uncommented line of code:
Traceback (most recent call last):
File "C:\Documents and Settings\Alf\sound\error.py", line 6, in <module>
writer.setframerate( framerate )
NameError: name 'framerate' is not defined
Note (1) that "n_frames" does *not* occur here -- or anywhere.
And that (2) the error report included this correction:
<quote>
Sorry, here's correct error message:
Traceback (most recent call last):
File "C:\Documents and Settings\Alf\sound\error.py", line 8, in <module>
writer.writeframes( b"\0"*2*4 )
File "C:\Program Files\cpython\python31\lib\wave.py", line 432, in writeframes
self.writeframesraw(data)
File "C:\Program Files\cpython\python31\lib\wave.py", line 416, in writeframesraw
self._ensure_header_written(len(data))
File "C:\Program Files\cpython\python31\lib\wave.py", line 459, in
_ensure_header_written
self._write_header(datasize)
File "C:\Program Files\cpython\python31\lib\wave.py", line 472, in _write_header
self._sampwidth * 8, 'data'))
struct.error: required argument is not an integer
Exception struct.error: 'required argument is not an integer' in <bound method
Wave_write.__del__ of <wave.Wave_write ob
ject at 0x00FE87F0>> ignored
</quote>
Which you can see that Brian was very well aware of, since he referred to <q>In
your first comment, "framerate" also did not exist.</q>, as opposed to this
corrected output.
But again, even though he did get off on the wrong foot, probably assuming that
it was a novice posting (and regarding Python I'm still a novice!), after that
he did superb job. So very much thanks to him, people will not have to struggle
with this bug. And perhaps the [wave] module will start getting more used!
Alf, I know you are able to read tracebacks, because you've demonstrated
the ability in the past. And I'm pretty sure that you're aware that can
too, because you're not an idiot.
So what puzzles me is, given that you can read the traceback you posted,
and we can too, why on earth do you claim that the reference to framerate
was commented out? The line that was executed is right there.
I don't claim and haven't claimed that framerate was commented out.
I referred to the fact that Brian (at first) thought that "n_frames" was, quote,
"causing the problem", and that that name only occurred in a comment.
Really? Well, that explains why none of my programs do anything!
*wink*
Right. A simple, silly error that anyone could have made. We've all made
similarly embarrassing mistakes.
But you then responded with a public put-down on Brian all out of
proportion for his sin of *answering your initial post*. And that just
makes you look obnoxious.
Nah, I didn't mention his name nor link to the error report.
Because I've made similar mistakes based on too low intake of coffee.
And after that, as mentioned, he did a superb job!
Reading back over this thread, it's obvious how cool, calm and collected
you are. I can't imagine what I was thinking, that somebody who would say
"Well how f*****g darn patient do they expect me to be?"
has strong feelings over the issue?
Of course I had strong feelings about the time wasted on the bug, and I'm not
one to hold my tongue, in general...
But no strong feelings about the bug report or handling of it.
I'm sure that you can understand that distinction, the two very different issues
(time wasted versus a puzzling Thorbjørning) now that I point it out, yes?
Just for good measure, let me once again point out that Brian, whom I didn't
name or refer to then, turned out to then do a superb job.
And in about no time at all.
Cheers,
- Alf