Page 1 of 1
Append mode not supported for files
Posted: Mon Jun 09, 2014 2:01 pm
by randomhuman
It looks like append mode is not supported when opening files, I get this exception:
ValueError: invalid mode: 'a'
The code works fine if I use write mode, but obviously that clobbers the file, which is inconvenient. Is there a reason for this, or is it maybe an oversight?
--
Kevin
Re: Append mode not supported for files
Posted: Mon Jun 09, 2014 5:32 pm
by pfalcon
I wouldn't call it "by oversight", but rather, "by design" - being "Micro", all Python features cannot be implemented, certainly not at once. But any features actually needed by users, especially those we hardly can be worked around, and append mode is such - will get into queue to wait for being implemented, if reported to bugtracker:
https://github.com/micropython/micropython/issues . When you submit report, please don't forget to specify which MicroPython port you use - for example, unix port does support append mode.
Re: Append mode not supported for files
Posted: Mon Jun 09, 2014 9:00 pm
by randomhuman
Ok I've created a bug report as you suggested:
https://github.com/micropython/micropython/issues/676
Thanks for the feedback.