48

This edit removed the whole traceback (call stack) in the question. IMHO, this contained the detail in which line exactly the problem occurred.

Is it just my lack of Python knowledge not finding the culprit line, or shouldn't that edit have been approved?

8
  • 21
    IMO no; now I don't know what line throws the error. I don't know the specific error but now I can't see what libraries were involved in its existence and the error isn't in English, so I don't know what it's saying to me either. Tracebacks should not be viewed as extraneous data.
    – roganjosh
    Commented May 20, 2019 at 22:04
  • 4
    Meh, it is okay, too much of a good thing. It was edited by the answerer who knew that the trace wasn't that useful to diagnose the problem. Just a basic misuse of the subprocess command, shell=True would probably have worked too. Hard to get a helpful vote in [python] these days isn't it? I can fix that. Commented May 20, 2019 at 22:26
  • 2
    @HansPassant an error without info on what line throws it is ok?
    – roganjosh
    Commented May 20, 2019 at 22:28
  • 2
    Sure, if you know Windows then you don't have to guess. Please don't guess. Commented May 20, 2019 at 22:29
  • 4
    @HansPassant: I agree that it was too much traceback. The edit could have removed a big part of it. However, with just the information %1 is not a valid Win32 application, how would you know whether to use shell=True because a .py file was executed or whether a 64 bit executable was executed on 32 bit Windows or a 16 bit executable was executed on 64 bit Windows? I'd like to exclude likelyness and experience, because I don't want to guess. Commented May 21, 2019 at 7:42
  • 5
    Gah. What this question needs, if it should exist at all, is the removal of most of the code. Several imports aren't even used, stuff's needlessly wrapped in a function, and much of the code shown comes after the line that raises. The fact that we need to look at a traceback to see what line throws the error is a symptom of a more profound problem: that the question is full of irrelevant noise that ought to have been culled from the exhibited code before the question was ever asked. If it contained an MCVE, the massive traceback would be unnecessary, and removing it would be right.
    – Mark Amery
    Commented May 21, 2019 at 11:56
  • 3
    @MarkAmery the nice thing about tracebacks (just in general) is that anyone in a position to give a decent answer would also be able to recognise it was a traceback and fly right past it if its not necessary. It's the one part of questions that I think we should always encourage because, after all, it's probably the most trustworthy info (god knows how many times we can use a traceback to see that the error doesn't even get thrown from the posted example code because the OP has already misdiagnosed the issue)
    – roganjosh
    Commented May 21, 2019 at 12:29
  • 2
    @roganjosh Eh... if somebody includes information in the question, then I'm going to scrutinise it and sanity-check that it coheres with the rest of the question and with what I believe the answer to be. It seems foolhardy to "fly right past" anything. But in any case, a question isn't primarily there for "anyone in a position to give a decent answer"; its main audience is (or at least, is meant to be) future readers looking for a solution, who will have varied skill levels. Using 10 lines instead of 75 to illustrate an error makes it easier for them to parse the question.
    – Mark Amery
    Commented May 21, 2019 at 12:43

1 Answer 1

61

No, the edit should not have been approved. I cannot tell how many times I say "please show the traceback" on the Python tag. What we've just lost:

  1. What line actually throws the error. The code starts with an import so we can hope that line numbers match up if we copy/paste into an editor. But at the very least, we see the guilty code and can search for it. Now we have a disembodied error.
  2. All of the information about what libraries might cause this error. In this case it's probably irrelevant, but I know now that they're on Windows and using Anaconda.
  3. A possibility of not having to translate the error into English to understand (perhaps laziness more than anything on my part, but SO works in English)

Dropping the traceback is a disservice to the OP.

4
  • 18
    Disservice to the community as well as to the OP. Both sides will get frustrated for no good reason. Commented May 20, 2019 at 23:07
  • 21
    And it suggests to the OP that they mustn't include such detail in future, which is mistraining, arguably the biggest loss Commented May 21, 2019 at 11:25
  • 2
    "but I know now that they're on Windows and using Anaconda" We should not need to rely on stack traces for this information. The author should include it.
    – jpmc26
    Commented May 21, 2019 at 20:57
  • 7
    @jpmc26 sure. But I'm pretty sure this question is about what someone did remove from what the author did include. I'm trying very hard to stick to that point rather than expanding into the question itself.
    – roganjosh
    Commented May 21, 2019 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .