internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Debugger broken with IPython 7.24.0
Running "Debug" (Ctrl+F5) on a file does not stop on breakpoints anymore, but simply runs through them.

I first noticed it after upgrading spyder in my normal work environment from 5.0.1 to 5.0.3. However, the same thing happens with a clean spyder install in a separate conda environment, even if I revert to .1 or .2.

Python 3.8.10 64-bit | Qt 5.12.9 | PyQt5 5.12.3 | Windows 10 


Discussion:

Resolving patch:
diff --git a/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py b/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
--- a/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
+++ b/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
@@ -15,8 +15,8 @@
 from collections import namedtuple
 
 from IPython.core.autocall import ZMQExitAutocall
-from IPython.core.getipython import get_ipython
 from IPython.core.debugger import Pdb as ipyPdb
+from IPython.core.getipython import get_ipython
 
 from spyder_kernels.comms.frontendcomm import CommError, frontend_request
 from spyder_kernels.customize.utils import path_is_library
@@ -92,6 +92,10 @@ def __init__(self, completekey='tab', stdin=None, stdout=None,
         self._pdb_breaking = False
         self._frontend_notified = False
 
+        # Don't report hidden frames for IPython 7.24+. This attribute
+        # has no effect in previous versions.
+        self.report_skipped = False
+
     # --- Methods overriden for code execution
     def print_exclamation_warning(self):
         """Print pdb warning for exclamation mark."""


Test patch:
Repository: spyder-ide/spyder

Issue:
Allow more recent Parso versions
currenctly the requirement for parso module is version 0.7.0

From the [changelog](https://github.com/davidhalter/parso/blob/master/CHANGELOG.rst#071-2020-07-24) it is only a bug fix release.

```
0.7.1 (2020-07-24)

    Fixed a couple of smaller bugs (mostly syntax error detection in Grammar.iter_errors)

This is going to be the last release that supports Python 2.7, 3.4 and 3.5.
```


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -209,14 +209,14 @@ def run(self):
     'diff-match-patch>=20181111',
     'intervaltree>=3.0.2',
     'ipython>=7.6.0',
-    'jedi==0.17.2',
+    'jedi>=0.17.2,<0.19.0',
     'jsonschema>=3.2.0',
     'keyring>=17.0.0',
     'nbconvert>=4.0',
     'numpydoc>=0.6.0',
     # Required to get SSH connections to remote kernels
     'paramiko>=2.4.0;platform_system=="Windows"',
-    'parso==0.7.0',
+    'parso>=0.7.0,<0.9.0',
     'pexpect>=4.4.0',
     'pickleshare>=0.4',
     'psutil>=5.3',
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -40,13 +40,13 @@
 # (check way to add dist.info/egg.info from packages without wheels available)
 INTERVALTREE_REQVER = None if is_pynsist() else '>=3.0.2'
 IPYTHON_REQVER = ">=7.6.0"
-JEDI_REQVER = '=0.17.2'
+JEDI_REQVER = '>=0.17.2;<0.19.0'
 JSONSCHEMA_REQVER = '>=3.2.0'
 KEYRING_REQVER = '>=17.0.0'
 NBCONVERT_REQVER = '>=4.0'
 NUMPYDOC_REQVER = '>=0.6.0'
 PARAMIKO_REQVER = '>=2.4.0'
-PARSO_REQVER = '=0.7.0'
+PARSO_REQVER = '>=0.7.0,<0.9.0'
 PEXPECT_REQVER = '>=4.4.0'
 PICKLESHARE_REQVER = '>=0.4'
 PSUTIL_REQVER = '>=5.3'


Test patch:
Repository: spyder-ide/spyder

Issue:
Pylint package not found with the Syder 5.0.4 Mac installer
 
<!---   *** BEFORE SUBMITTING: PASTE CLIPBOARD HERE TO COMPLETE YOUR REPORT ***   ---!>
Step-1 Python file (.py) already opened in the Editor pane
Step-2 Cliked on "Source" on the Menu bar 
Step-3 Slected "Run Code Analysis"

Error Message: "/Application/Spyder.app/Contents/MacOS/ 
python: No Module named
plynt.__main__; 'plynt' is a package and cannot be directly executed "



Discussion:
Hey @ColedanosTX, thanks for reporting. We'll try to fix this in our next release.

@mrclary, could you take a look at this one?
> Hey @ColedanosTX, thanks for reporting. We'll try to fix this in our next release.
> 
> @mrclary, could you take a look at this one?

Thanks @ccordoba12 for the prompt reaction. Many thanks 
This hasn't been solved, so we need to keep it open to not forget fixing it later.

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -71,7 +71,7 @@ def make_app_bundle(dist_dir, make_lite=False):
     docutils :
         [Errno 20] Not a directory: '<path>/Resources/lib/python39.zip/
         docutils/writers/latex2e/docutils.sty'
-    ipython :
+    IPython :
         [IPKernelApp] WARNING | Could not copy README_STARTUP to startup dir.
         Source file
         <path>/Resources/lib/python38.zip/IPython/core/profile/README_STARTUP
@@ -97,6 +97,8 @@ def make_app_bundle(dist_dir, make_lite=False):
         Note: only applicable to not-Lite build
     pygments :
         ModuleNotFoundError: No module named 'pygments.formatters.latex'
+    pylint :
+        <path>/Contents/MacOS/python: No module named pylint.__main__
     pylsp :
         <path>/Contents/MacOS/python: No module named pylsp
         Note: still occurs in alias mode
@@ -143,10 +145,11 @@ def make_app_bundle(dist_dir, make_lite=False):
     build_type = 'lite' if make_lite else 'full'
     logger.info('Creating %s app bundle...', build_type)
 
-    PACKAGES = ['alabaster', 'astroid', 'docutils', 'blib2to3', 'IPython',
-                'jedi', 'jinja2', 'keyring', 'parso', 'pygments', 'pylsp',
-                'pylsp_black', 'pyls_spyder', 'qtawesome', 'setuptools',
-                'sphinx', 'spyder', 'spyder_kernels', 'textdistance',
+    PACKAGES = ['alabaster', 'astroid', 'blib2to3', 'docutils', 'IPython',
+                'jedi', 'jinja2', 'keyring', 'parso', 'pygments', 'pylint',
+                'pylsp', 'pylsp_black', 'pyls_spyder', 'qtawesome',
+                'setuptools', 'sphinx', 'spyder', 'spyder_kernels',
+                'textdistance',
                 ]
     INCLUDES = ['_sitebuiltins',  # required for IPython help()
                 # required for sphinx


Test patch:
Repository: spyder-ide/spyder

Issue:
AttributeError in snippets extension
 
<!---   *** BEFORE SUBMITTING: PASTE CLIPBOARD HERE TO COMPLETE YOUR REPORT ***   ---!>
I have no clue as I am a beginner. Hopefully, someone else understands what might have gone wrong.


QTextCursor::setPosition: Position '147' out of range
QTextCursor::setPosition: Position '147' out of range
Traceback (most recent call last):
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/spyder/plugins/editor/extensions/snippets.py", line 52, in wrapper
    return f(self, *args, **kwargs)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/spyder/plugins/editor/extensions/snippets.py", line 241, in _process_text
    self.insert_text(text, line, column)
  File "/Applications/Spyder.app/Contents/Resources/lib/python3.9/spyder/plugins/editor/extensions/snippets.py", line 383, in insert_text
    text_node_tokens = list(text_node.tokens)
AttributeError: 'NoneType' object has no attribute 'tokens'



Discussion:
Hey @MJV1989, thanks for reporting. Could you let us know what text you introduced in the editor that generated this error?
Hi @ccordoba12, I believe I was writing the following when this happened:

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

animals = {'a' : 'aardvark', 'b' : 'baboon', 'c' : 'coati'}

animals['d'] = ['donkey']
animals['d'].append('dog')
animals['d'].append('dingo')

def biggest(aDict):
    '''
    
    Parameters
    ----------
    aDict : A dictionary where all the values are lists.

    Returns
    -------
    The key with the largest number of values associated with it.

    '''
    if aDict == {}:
        return None
    else:
        return max(aDict, key = lambda x : len(aDict[x]))

Resolving patch:
diff --git a/spyder/plugins/editor/extensions/snippets.py b/spyder/plugins/editor/extensions/snippets.py
--- a/spyder/plugins/editor/extensions/snippets.py
+++ b/spyder/plugins/editor/extensions/snippets.py
@@ -363,7 +363,7 @@ def insert_text(self, text, line, column):
             self._remove_selection(start, end)
             line, column = start
         node, snippet, text_node = self._find_node_by_position(line, column)
-        if node is None:
+        if node is None or text_node is None:
             self.reset()
             return
         tokens = tokenize(text)


Test patch:
Repository: spyder-ide/spyder

Issue:
Splash screen can take a lot of space in low resolution screens
When starting Spyder in my laptop screen (1366 x 768) the splash looks like this (kind of big):

![image](https://user-images.githubusercontent.com/16781833/125324449-374ae780-e340-11eb-8de1-9f15903007e4.png)


However in my secondary screen (1920×1080) the splash looks better:

![image](https://user-images.githubusercontent.com/16781833/125323370-fe5e4300-e33e-11eb-8372-53702b7cef7d.png)



Discussion:
Thanks for reporting @dalthviz. @juanis2112 will take care of it.

Resolving patch:
diff --git a/spyder/app/utils.py b/spyder/app/utils.py
--- a/spyder/app/utils.py
+++ b/spyder/app/utils.py
@@ -176,7 +176,9 @@ def qt_message_handler(msg_type, msg_log_context, msg_string):
 def create_splash_screen():
     """Create splash screen."""
     if not running_under_pytest():
-        splash = QSplashScreen(QPixmap(get_image_path('splash')))
+        pixmap = QPixmap(get_image_path('splash'))
+        splash = QSplashScreen(
+            pixmap.scaledToWidth(500, Qt.SmoothTransformation))
         splash_font = splash.font()
         splash_font.setPixelSize(14)
         splash.setFont(splash_font)


Test patch:
Repository: spyder-ide/spyder

Issue:
"Format file or selection with Autopep8" cause the code to be misplaced
### What steps reproduce the problem?

1. select a python source file that contains comments "# ..."
![捕获](https://user-images.githubusercontent.com/10581915/128652127-51bb3583-dc9a-42c7-bd73-7fb10996b640.PNG)

2. click Source -> Format file or selection with Autopep8
![image](https://user-images.githubusercontent.com/10581915/128652351-546375fb-5598-43f7-aa0e-1b2c1d79c424.png)

3.  It will cause the code to be misplaced
![捕获2](https://user-images.githubusercontent.com/10581915/128652176-ea611cae-7fb2-4a6a-ae14-026e806b0542.PNG)
4.The bug appear after **version 5.1.0**,it's OK at **version 5.0.5**




Discussion:
This also happens when formatting with black
I am also having the same problem.
Autopep8 and black doesn't matter, it incorrectly changes the code.

Version : 5.1.1
Python 3.7.9 64-bit | Qt 5.12.10 | PyQt5 5.12.3 | Windows 10 
Hi @Godsix, @zariiii9003 and @onerozer, 

Can you all send me a code example that is showing the error? I'm trying to reproduce this with a simple script and the error doesn't show up.
Hi @steff456 ,
You can see it in the attached screenrecording.
This error happens even with the simplest code. 

https://user-images.githubusercontent.com/14151240/128976788-0a300a9e-8702-4792-86e6-bfee53135f13.mp4

https://user-images.githubusercontent.com/14151240/128978287-31b14277-f521-481b-847b-7cc5a3fb5b50.mp4


Thanks for the videos! We will take a look at this issue to fix it in one of our next releases.

Resolving patch:
diff --git a/spyder/plugins/editor/widgets/codeeditor.py b/spyder/plugins/editor/widgets/codeeditor.py
--- a/spyder/plugins/editor/widgets/codeeditor.py
+++ b/spyder/plugins/editor/widgets/codeeditor.py
@@ -1747,7 +1747,11 @@ def _apply_document_edits(self, edits):
         if edits is None:
             return
 
-        text = self.get_text_with_eol()
+        # We need to use here toPlainText and not get_text_with_eol to
+        # to not mess up the code when applying formatting.
+        # See spyder-ide/spyder#16180
+        text = self.toPlainText()
+
         text_tokens = list(text)
         merged_text = None
         for edit in edits:


Test patch:
Repository: spyder-ide/spyder

Issue:
Maximum character line slightly wrong
In Spyder 5.1.1, the maximum character line is slightly moved to the left, so that is does cross the characters at the maximum allowed position:

![len_80_spyder5](https://user-images.githubusercontent.com/79669161/130124885-03b7801a-0c4f-4f7e-ae62-b9298bdb46ca.png)

Same line of code in Spyder 3.3.6, maximum character line is displayed correctly:

![len_80_spyder3](https://user-images.githubusercontent.com/79669161/130124957-c5f782b2-9e57-4ec3-b0b4-7c36bc92e263.png)



Discussion:
Hey @andprosoft, thanks for reporting. In Spyder 4 we added a small margin next to the line numbers area (as can be seen in your screenshot), which causes the error.

This is a small issue that no one has reported before, so it's very low priority for us. But you're welcome to help us fix it.
Hi @ccordoba12 , thanks for the info.

Do you know maybe, where to look in the code?
It could be in `spyder/plugins/editor/widgets/codeeditor.py` (not really sure though).
Well, I also noticed this and already wanted to open a new issue,but there were more pressing issues and now @andprosoft beat me to it!
I'd be happy to submit a PR with a simple fix for this if no one else is on it (@andprosoft ?)

@rhkarls No problems, go for it! ;)

Resolving patch:
diff --git a/spyder/plugins/editor/panels/edgeline.py b/spyder/plugins/editor/panels/edgeline.py
--- a/spyder/plugins/editor/panels/edgeline.py
+++ b/spyder/plugins/editor/panels/edgeline.py
@@ -36,7 +36,8 @@ def paintEvent(self, event):
         painter.setPen(color)
 
         for column in self.columns:
-            x = self.editor.fontMetrics().width(column * '9')
+            # draw edge line at column n + 3 to account for line number margin
+            x = self.editor.fontMetrics().width(column * '9') + 3
             painter.drawLine(x, 0, x, size.height())
 
     def sizeHint(self):


Test patch:
Repository: spyder-ide/spyder

Issue:
ModuleNotFoundError: No module named 'platformdirs.macos' on macOS App
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

pylint 2.10.2 migrated from `appdirs` to `platformdirs`, resulting in the error for the macOS application.


Discussion:

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -155,7 +155,9 @@ def make_app_bundle(dist_dir, make_lite=False):
                 # required for sphinx
                 'sphinxcontrib.applehelp', 'sphinxcontrib.devhelp',
                 'sphinxcontrib.htmlhelp', 'sphinxcontrib.jsmath',
-                'sphinxcontrib.qthelp', 'sphinxcontrib.serializinghtml']
+                'sphinxcontrib.qthelp', 'sphinxcontrib.serializinghtml',
+                'platformdirs.macos',  # required for platformdirs
+                ]
     EXCLUDES = []
     EXCLUDE_EGG = ['py2app']
 


Test patch:
Repository: spyder-ide/spyder

Issue:
5.1.2 Mac installer broken?
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

I installed the update (my first update after installing and working with Spyder for the last 2 days). In the update, the kernel will not load (macOS Catalina):

NotADirectoryError: [Errno 20] Not a directory: '/Applications/Spyder.app/Contents/Resources/lib/python39.zip/debugpy/_vendored'


Discussion:
Hey @gctwnl, thanks for reporting. That's a problem with the Mac installer only.

@mrclary, could you take a look at this one? 
installs fine but fails 'cannot load kernel'. 

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -68,6 +68,9 @@ def make_app_bundle(dist_dir, make_lite=False):
         File "<frozen zipimport>", line 177, in get_data
         KeyError: 'blib2to3/Users/rclary/Library/Caches/black/20.8b1/
         Grammar3.8.6.final.0.pickle'
+    debugpy :
+        NotADirectoryError: [Errno 20] Not a directory:
+        '<path>/Resources/lib/python39.zip/debugpy/_vendored'
     docutils :
         [Errno 20] Not a directory: '<path>/Resources/lib/python39.zip/
         docutils/writers/latex2e/docutils.sty'
@@ -149,7 +152,7 @@ def make_app_bundle(dist_dir, make_lite=False):
                 'jedi', 'jinja2', 'keyring', 'parso', 'pygments', 'pylint',
                 'pylsp', 'pylsp_black', 'pyls_spyder', 'qtawesome',
                 'setuptools', 'sphinx', 'spyder', 'spyder_kernels',
-                'textdistance',
+                'textdistance', 'debugpy',
                 ]
     INCLUDES = ['_sitebuiltins',  # required for IPython help()
                 # required for sphinx


Test patch:
Repository: spyder-ide/spyder

Issue:
Add code signing to macOS installer
We should add code signing to the macOS application and/or DMG file.



Discussion:
I would like to set up a meeting to work on this @mrclary and @ccordoba12. Can you tell me when does it fit better for both of you?
https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -84,7 +84,7 @@ def make_app_bundle(dist_dir, make_lite=False):
             'CFBundleDocumentTypes': [{'CFBundleTypeExtensions': EDIT_EXT,
                                        'CFBundleTypeName': 'Text File',
                                        'CFBundleTypeRole': 'Editor'}],
-            'CFBundleIdentifier': 'org.spyder-ide',
+            'CFBundleIdentifier': 'org.spyder-ide.Spyder',
             'CFBundleShortVersionString': SPYVER,
             'NSRequiresAquaSystemAppearance': False,  # Darkmode support
             'LSEnvironment': {'SPY_COMMIT': SPYCOM, 'SPY_BRANCH': SPYBRA}


Test patch:
Repository: spyder-ide/spyder

Issue:
Installer-based Spyder does not start on Windows
Using the latest installer, Spyder does not start on Windows. It only shows the splash screen, then nothing else happens. (How to activate the console or debug logging?)

I suspect that it is related to https://github.com/spyder-ide/qtawesome/issues/167 because it works when I change the Untrusted Font Blocking setting (described in https://docs.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/feature-to-block-untrusted-fonts). Unfortunately, the listed solutions in the Microsoft page cannot be applied on the target machines.


Discussion:
Hi @giumas thank you for the feedback! I think you are right although maybe we should move this issue to the Spyder main repo to keep track of it, what do you think @ccordoba12 ?

Besides that I guess checking if we can somehow try to install the fonts for the current user could be quite useful. If you get to know more info regarding that process let us know at spyder-ide/qtawesome#167 (I started checking and searching but not yet there so any help is quite appreciated!)

Yeah, this issue doesn't belong here. @dalthviz, please move it to our main repo. 
Note: For now fix the fallback to the Spyder 2 icon set so if the icons are not available due to the font load error, Spyder should use the old Spyder 2 icon set which doesn't rely in loading fonts. 
By the way @giumas to debug you can launch the installed Spyder from a terminal running the `Target` specified in the generated shortcut and changing `pythonw.exe` for `python.exe`. It should be something like this (where `<your user>` is the current session user directory):

```

C:\Users\<your user>\AppData\Local\Programs\Spyder\Python\python.exe "C:\Users\<your user>\AppData\Local\Programs\Spyder\Spyder.launch.pyw"

```

If you want even more information you can run it with the `debug-info verbose` flag, so something like this:

```

C:\Users\<your user>\AppData\Local\Programs\Spyder\Python\python.exe "C:\Users\<your user>\AppData\Local\Programs\Spyder\Spyder.launch.pyw" --debug-info verbose

```

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1088,7 +1088,8 @@ def __getattr__(self, attr):
         # names given for plugins
         try:
             if attr in self._INTERNAL_PLUGINS_MAPPING.keys():
-                return self.get_plugin(self._INTERNAL_PLUGINS_MAPPING[attr])
+                return self.get_plugin(
+                    self._INTERNAL_PLUGINS_MAPPING[attr], error=False)
             return self.get_plugin(attr)
         except SpyderAPIError:
             pass


Test patch:
Repository: spyder-ide/spyder

Issue:
has_been_modified method has two arguments but only one is passed in Preferences

Hello.
"has_been_modified" of api.py has 2 arguments.
https://github.com/spyder-ide/spyder/blob/c5b4291245dc8b0ee71705175023f0fbe0f565c9/spyder/plugins/preferences/api.py#L387-L389

But in the code below, only one is entered. 
https://github.com/spyder-ide/spyder/blob/c5b4291245dc8b0ee71705175023f0fbe0f565c9/spyder/plugins/shortcuts/confpage.py#L64-L66

Thank you.



Discussion:
Hey @ok97465, thanks for reporting. We'll try to take a look at this problem after we release 5.2.0 in a couple of weeks.
@steff456, could you take a look at this one next week? I noticed it's a serious bug because it doesn't allow to set new shortcuts in Spyder.

Resolving patch:
diff --git a/spyder/plugins/shortcuts/confpage.py b/spyder/plugins/shortcuts/confpage.py
--- a/spyder/plugins/shortcuts/confpage.py
+++ b/spyder/plugins/shortcuts/confpage.py
@@ -63,7 +63,8 @@ def setup_page(self):
 
         # Signals
         self.table.proxy_model.dataChanged.connect(
-            lambda i1, i2, roles, opt='': self.has_been_modified(opt))
+            lambda i1, i2, roles, opt='', sect='': self.has_been_modified(
+                sect, opt))
         self.reset_btn.clicked.connect(self.reset_to_default)
 
     def check_settings(self):


Test patch: