On 21May2020 21:30, Rob Cliffe <rob.cli...@btinternet.com> wrote:
On 21/05/2020 14:50, Steve Barnes wrote:
The issue is simple and simple enough for a beginner to fall foul of - test procedure: Change directory to any directory with files in totally a few 10s of megs (ideally but it doesn't matter much).
python -m zipfile -c my_zipfile.zip .
[... zip that zips its own archive...]

Am I missing something here?

Yes. The discussion isn't about the bug, but about containing the bug during testing.

IIUC zipfile.py tries to add the zipfile it's creating to the zipfile it's creating.
That's a bug, pure and simple (and a dangerous one).

Which is the point of Steve's post. He's asking about good ways to write a test for something like this, which has bad/dangerous behaviour when the test fails. The whole point of the test is to trigger the bad behaviour but the secondary objective is to do it without zip exploding in the tester's face.

The process here is:
- bug exists (exploding zip)
- write a test that fails when the bug exists
- fix the bug
- the test should now pass

Step 2 eats an unbounded amount of disc (in this case, other bugs can go bad on other ways).

Cheers,
Cameron Simpson <c...@cskk.id.au>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MH6UL6OKNOU4ANXH6CESL43VB53GREUV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to