Bug#1009659: bullseye-pu: package spyder/4.2.1+dfsg1-3

2023-01-09 Thread Julian Gilbey
On Sat, May 28, 2022 at 08:45:28PM +0100, Adam D. Barratt wrote:
> Control: tags -1 + confirmed
> 
> On Wed, 2022-04-13 at 19:46 +0100, Julian Gilbey wrote:
> > The bug is reported in https://bugs.debian.org/989660
> > I didn't spot it at the time because I'm only an uploader, not the
> > named maintainer, and had forgotten to check the BTS.  Sorry about
> > that.  The bug was present in version 4.2.1 of Spyder, but was fixed
> > by upstream in version 4.2.2.
> > 
> 
> The metadata for that bug indicates that it still affects the version
> of spyder present in unstable and testing. Given the above description,
> I'm assuming that this is simply an oversight in the metadata. Assuming
> that's correct, please feel free to go ahead with the  upload, but
> please do add an appropriate fixed version to #989660 so that the BTS
> knows the correct state.

Dear Adam,

Oh gosh, I've let this slip so long.

I've just closed the BTS bug #989660 with an appropriate version.

> FWIW, I think the patch actually ends up being relatively simple if one
> excludes the changes in indentation that result; a version with the
> equivalent of "diff -w" applied would potentially be helpful to
> confirm.

You are spot on here!  Here's the -w version for the files touched
under spyder (i.e., excluding the debian/* files):

diff -Nrub spyder-4.2.1+dfsg1-3/spyder/plugins/editor/plugin.py 
spyder-4.2.1+dfsg1-3+deb11u1/spyder/plugins/editor/plugin.py
--- spyder-4.2.1+dfsg1-3/spyder/plugins/editor/plugin.py2021-02-05 
12:29:00.0 +
+++ spyder-4.2.1+dfsg1-3+deb11u1/spyder/plugins/editor/plugin.py
2023-01-06 07:36:24.0 +
@@ -2567,7 +2567,7 @@
 def run_file(self, debug=False):
 """Run script inside current interpreter or in a new one"""
 editorstack = self.get_current_editorstack()
-if editorstack.save(save_new_files=False):
+
 editor = self.get_current_editor()
 fname = osp.abspath(self.get_current_filename())
 
@@ -2650,7 +2650,9 @@
 def re_run_file(self, save_new_files=True):
 """Re-run last script"""
 if self.get_option('save_all_before_run'):
-self.save_all(save_new_files=save_new_files)
+all_saved = self.save_all(save_new_files=save_new_files)
+if not all_saved:
+return
 if self.__last_ec_exec is None:
 return
 (fname, wdir, args, interact, debug,
diff -Nrub spyder-4.2.1+dfsg1-3/spyder/plugins/editor/widgets/editor.py 
spyder-4.2.1+dfsg1-3+deb11u1/spyder/plugins/editor/widgets/editor.py
--- spyder-4.2.1+dfsg1-3/spyder/plugins/editor/widgets/editor.py
2021-02-05 12:29:00.0 +
+++ spyder-4.2.1+dfsg1-3+deb11u1/spyder/plugins/editor/widgets/editor.py
2023-01-06 07:36:24.0 +
@@ -2265,9 +2265,11 @@
 
 Iterate through self.data and call save() on any modified files.
 """
+all_saved = True
 for index in range(self.get_stack_count()):
 if self.data[index].editor.document().isModified():
-self.save(index, save_new_files=save_new_files)
+all_saved &= self.save(index, save_new_files=save_new_files)
+return all_saved
 
 #-- Update UI
 def start_stop_analysis_timer(self):


I've just updated the debian/changelog timestamp so it is not
misleading, otherwise everything remains the same as when I originally
sent a debdiff.  I'm now uploading this version to bullseye.

Thanks for your help!

   Julian



Bug#1009659: bullseye-pu: package spyder/4.2.1+dfsg1-3

2022-05-28 Thread Adam D. Barratt
Control: tags -1 + confirmed

On Wed, 2022-04-13 at 19:46 +0100, Julian Gilbey wrote:
> The bug is reported in https://bugs.debian.org/989660
> I didn't spot it at the time because I'm only an uploader, not the
> named maintainer, and had forgotten to check the BTS.  Sorry about
> that.  The bug was present in version 4.2.1 of Spyder, but was fixed
> by upstream in version 4.2.2.
> 

The metadata for that bug indicates that it still affects the version
of spyder present in unstable and testing. Given the above description,
I'm assuming that this is simply an oversight in the metadata. Assuming
that's correct, please feel free to go ahead with the  upload, but
please do add an appropriate fixed version to #989660 so that the BTS
knows the correct state.

FWIW, I think the patch actually ends up being relatively simple if one
excludes the changes in indentation that result; a version with the
equivalent of "diff -w" applied would potentially be helpful to
confirm.

Regards,

Adam



Bug#1009659: bullseye-pu: package spyder/4.2.1+dfsg1-3

2022-04-13 Thread Julian Gilbey
Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian@packages.debian.org
Usertags: pu

(Please provide enough information to help the release team
to judge the request efficiently. E.g. by filling in the
sections below.)

[ Reason ]
(Explain what the reason for the (old-)stable update is. I.e.
what is the bug, when was it introduced, is this a regression
with respect to the previous (old-)stable.)

The bug is reported in https://bugs.debian.org/989660
I didn't spot it at the time because I'm only an uploader, not the
named maintainer, and had forgotten to check the BTS.  Sorry about
that.  The bug was present in version 4.2.1 of Spyder, but was fixed
by upstream in version 4.2.2.

The bug means that in some cases when the black code formatter is
used, the code is modified before being saved (rather than just being
reformatted).  This is likely to cause bugs in the user's code.

[ Impact ]
(What is the impact for the user if the update isn't approved?)

As noted above, this might silently corrupt code that the user is
editing.

[ Tests ]
(What automated or manual tests cover the affected code?)

Unfortunately there are no tests in the stable version of this
package.  (This has been rectified in unstable.)

[ Risks ]
(Discussion of the risks involved. E.g. code is trivial or
complex, alternatives available.)

This patch is moderately complex; it appears to fix the issue and it
was approved by the core Spyder maintainer, who is very sharp-eyed.
It is also present in the current version of Spyder (uploaded to
unstable within the last few days).  There are no alternatives I am
aware of.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
(Explain *all* the changes)

Applying the upstream patch is the only change made.

[ Other info ]
(Anything else the release team should know.)

I have not yet uploaded it to bullseye; I await your instructions.

Best wishes,

   Julian
diff -Nru spyder-4.2.1+dfsg1/debian/changelog 
spyder-4.2.1+dfsg1/debian/changelog
--- spyder-4.2.1+dfsg1/debian/changelog 2021-02-21 09:28:17.0 +
+++ spyder-4.2.1+dfsg1/debian/changelog 2022-04-13 19:05:26.0 +0100
@@ -1,3 +1,9 @@
+spyder (4.2.1+dfsg1-3+deb11u1) bullseye; urgency=medium
+
+  * Fix duplicate-code-on-save bug (closes: #989660)
+
+ -- Julian Gilbey   Wed, 13 Apr 2022 19:05:26 +0100
+
 spyder (4.2.1+dfsg1-3) unstable; urgency=medium
 
   * Missed one dependency (python3-setuptools) in the last upload, and
diff -Nru 
spyder-4.2.1+dfsg1/debian/patches/Prevent-double-saving-when-running-a-file.patch
 
spyder-4.2.1+dfsg1/debian/patches/Prevent-double-saving-when-running-a-file.patch
--- 
spyder-4.2.1+dfsg1/debian/patches/Prevent-double-saving-when-running-a-file.patch
   1970-01-01 01:00:00.0 +0100
+++ 
spyder-4.2.1+dfsg1/debian/patches/Prevent-double-saving-when-running-a-file.patch
   2022-04-13 19:05:26.0 +0100
@@ -0,0 +1,183 @@
+From: Edgar Andrés Margffoy Tuay 
+Subject: Prevent double saving when running a file
+  This patch has had the line-endings converted to make it compatible
+Origin: upstream, https://github.com/spyder-ide/spyder/pull/14759
+Applied-Upstream: 
https://github.com/spyder-ide/spyder/commit/9325d0d7be1a88602b8092d35be309edc876aa38
+Bug: https://github.com/spyder-ide/spyder/issues/14653
+Bug-Debian: http://bugs.debian.org/989660
+Last-Update: 2022-04-13
+
+---
+ spyder/plugins/editor/plugin.py | 130 
+ spyder/plugins/editor/widgets/editor.py |   4 +-
+ 2 files changed, 69 insertions(+), 65 deletions(-)
+
+diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py
+index 1faec3c82..8034714a0 100644
+--- a/spyder/plugins/editor/plugin.py
 b/spyder/plugins/editor/plugin.py
+@@ -2567,72 +2567,72 @@ def edit_run_configurations(self):
+ def run_file(self, debug=False):
+ """Run script inside current interpreter or in a new one"""
+ editorstack = self.get_current_editorstack()
+-if editorstack.save(save_new_files=False):
+-editor = self.get_current_editor()
+-fname = osp.abspath(self.get_current_filename())
+-
+-# Get fname's dirname before we escape the single and double
+-# quotes. Fixes spyder-ide/spyder#6771.
+-dirname = osp.dirname(fname)
+ 
+-# Escape single and double quotes in fname and dirname.
+-# Fixes spyder-ide/spyder#2158.
+-fname = fname.replace("'", r"\'").replace('"', r'\"')
+-dirname = dirname.replace("'", r"\'").replace('"', r'\"')
++editor = self.get_current_editor()
++fname = osp.abspath(self.get_current_filename())
+ 
+-runconf = get_run_configuration(fname)
+-if runconf is None:
+-dialog =