Opened 7 years ago

Last modified 6 years ago

#6557 new defect

sugar.activity.activity.Activity.save() buggy

Reported by: homunq Owned by: homunq
Priority: normal Milestone: 9.1.0-cancelled
Component: sugar Version: Development build as of this date
Keywords: Cc: homunq, marco, tomeu
Blocked By: Blocking: #4365
Deployments affected: Action Needed: code
Verified: no

Description

If I open without a dsobject, and creat_jobject is false, self._jobject gets set to None. But then save nonchalantly does:

self.write_file(file_path)
self._owns_file = True
self._jobject.file_path = file_path

without checking either write_file or self._jobject for existence.

Also, I know that metadata should be in metadata, and I'm setting the right mime_type, but it still hurts not to put the right extension on my file. I don't know what magic occurs when copying to external storage, but having the right extension seems like the Right Thing To Do to me, and SPOT/DRY be damned.

I will make a patch.

Change History (8)

comment:1 Changed 7 years ago by homunq

  • Owner changed from marco to homunq

comment:2 Changed 7 years ago by homunq

OK I just figured out the suggested_filename trick, so I won't do the extension part.

comment:3 Changed 7 years ago by homunq

  • Blocking 4365 added

(In #4365) The current base activity class in python is buggy (see 6557) and so you must save when first opening. Making that bug a blocker of this one.

comment:4 Changed 7 years ago by homunq

  • Keywords review? added

comment:5 Changed 6 years ago by marco

  • Keywords 8.2.0:? added; review? removed
  • Milestone changed from Never Assigned to 8.2.0 (was Update.2)

Please post the patch for review on the list.

comment:6 Changed 6 years ago by marco

  • Action Needed set to review
  • Keywords r? added; 8.2.0:? removed

comment:7 Changed 6 years ago by marco

  • Keywords r- added; r? removed

Please reference the patch (possibly update it too, since a long time has passed). Thanks.

comment:8 Changed 6 years ago by marco

  • Action Needed changed from review to code
  • Keywords r- removed
  • Milestone changed from 8.2.0 (was Update.2) to 9.1.0
Note: See TracTickets for help on using tickets.