profile
viewpoint
Karthik Nadig karthiknadig @Microsoft Redmond Developer at Microsoft, working on VS Code Python and Python Debugger.

karthiknadig/ArduinoFIS 3

Matlab FIS files to *.c converter.

karthiknadig/papers-we-love 1

Papers from the computer science community to read and discuss.

karthiknadig/corefx 0

This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.

karthiknadig/cpython 0

The Python programming language

karthiknadig/debugpy 0

An implementation of the Debug Adapter Protocol for Python

karthiknadig/DirectXMath 0

DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps

karthiknadig/django_barcode_sample 0

Sample Django app that generates SVG barcode images using EAN13 or EAN8 format.

karthiknadig/FileMeta 0

Enable Explorer in Vista, Windows 7 and later to see, edit and search on tags and other metadata for any file type

issue openedmicrosoft/PTVS

Visual Studio Interactive Window, is printing a static list different

Describe the bug I am experiencing a strange and weird behaviour from the interactive window. I have intialized a static list, with some values (which contain column names from a pandas dataframe), and when I print the list, I lose the "_" character. Moreover, when I add a line within the same cell to check if a column name is inside the list, the printing changes, "_" character shows up, and the boolean evaluates to true. The first case, when "_" character does not show up, can also be confirm from the fact that I fail to extract the subset of columns from my dataframes.

Additional context and screenshots example1 example2

Sample Code

# %%
col_names = ['c_user', 's_user', 'o_user', 'e_user']
print(col_names)
print('c_user' in col_names)

Configuration information VS Version: 1.51.1 PTVS version: v2020.11.371526539 Python version: 3.8.5

created time in 18 hours

issue openedmicrosoft/debug-adapter-protocol

Suggestions on new conditional exception protocol

I was looking at the new support for conditional exceptions and I have two suggestions:

  1. Handling errors - The protocol doesn't specify what an adapter should do if the user input an invalid condition. I feel like the right answer is that an adapter can just fail the SetExceptionBreakpointsRequest. But I felt like maybe this should be called out?
  2. Providing help text - for the C#/C++ extension, I don't know that it will be super obvious to folks what syntax they should use for conditions. It would be helpful if ExceptionBreakpointsFilter had an additional optional description field that would be displayed in a datatip similar to the experience of edited launch.json in VS Code. This would allow a debug adapter to provide examples and link to complete documentation.

created time in 2 days

issue openedmicrosoft/debug-adapter-protocol

Support for a new WriteMemoryRequest if debuggee permits to

Hi, In order to implement a full set of debug tools from DAP, I would like if it would be ok to implement a request such as WriteMemoryRequest, the same way it works for ReadMemoryRequest

interface WriteMemoryArguments {
  /**
   * Memory reference to the base location from which data should be written.
   */
  memoryReference: string;

  /**
   * Bytes to write, [encoded using base64 like ReadMemoryRequest ?]
   */
  content: string;

  /**
   * Optional offset (in bytes) to be applied to the reference location before
   * reading data. Can be negative.
   */
  offset?: number;
}

For the response, I don't know if it can be the same way as ReadMemoryResponse. It can also be a new Memory event with a flag 'modified' and a content/address

interface WriteMemoryResponse {
  // body is not mandatory if write has worked correctly
  body?: {
    /**
     * The address of the first byte of data returned.
     * Treated as a hex value if prefixed with '0x', or as a decimal value
     * otherwise. (It would match previous memoryReference+offset)
     */
    address?: string;

    /**
     * The bytes read from memory, encoded using base64.
     */
    data?: string;
  };
}

Thanks in advance

created time in 2 days

pull request commentkarthiknadig/vscode-python

Bump isort from 5.5.3 to 5.6.3

Dependabot tried to update this pull request, but something went wrong. We're looking into it, but in the meantime you can retry the update by commenting @dependabot rebase.

dependabot[bot]

comment created time in 3 days

pull request commentkarthiknadig/vscode-python

Bump pygls from 0.9.0 to 0.9.1

Dependabot tried to update this pull request, but something went wrong. We're looking into it, but in the meantime you can retry the update by commenting @dependabot rebase.

dependabot[bot]

comment created time in 3 days

issue commentmicrosoft/debug-adapter-protocol

Proposal: Support object favorites

@dustincoleman Thanks a lot for the new DAP feature proposal.

Here are some initial comments and questions:

  • the feature makes sense, but from the overall reaction it has not sparked a lot of interest. That's the main reason why I'm so late in reviewing it..
  • the name "Favorite" in the AddFavorite request is very broad. I suggest to make it more specific, e.g. AddFavoriteVariable.
  • Since favorite variables rely on variablesReference they are only valid for a single debug session and cannot be used to persist them across sessions. Is this the intended behavior?
dustincoleman

comment created time in 3 days

push eventmicrosoft/debug-adapter-protocol

Andre Weinand

commit sha eded56aa372c7921205fad496e87f57d2adf176d

update changelog

view details

Andre Weinand

commit sha 712b4570866944de5c45a5b6a5d9cc9f708c9d17

set protocol version to 1.43

view details

push time in 3 days

PR opened karthiknadig/vscode-python

Bump packaging from 20.4 to 20.7

Bumps packaging from 20.4 to 20.7. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/packaging/blob/master/CHANGELOG.rst">packaging's changelog</a>.</em></p> <blockquote> <p>20.7 - 2020-11-28</p> <pre><code> No unreleased changes. <p>20.6 - 2020-11-28 </code></pre></p> <p>.. note:: This release was subsequently yanked, and these changes were included in 20.7.</p> <ul> <li>Fix flit configuration, to include LICENSE files (:issue:<code>357</code>)</li> </ul> <p>20.5 - 2020-11-27</p> <pre><code>

  • Officially support Python 3.9 (:issue:343)
  • Deprecate the LegacyVersion and LegacySpecifier classes (:issue:321)
  • Handle OSError on non-dynamic executables when attempting to resolve the glibc version string. </code></pre> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/packaging/commit/c048e344affac7649be67c7e06f37e7cf58ef548"><code>c048e34</code></a> Bump for release</li> <li><a href="https://github.com/pypa/packaging/commit/d26543ae443b3ca9f038af11882d4fcde308c725"><code>d26543a</code></a> Merge remote-tracking branch 'upstream/master' into master</li> <li><a href="https://github.com/pypa/packaging/commit/7cfbf62e6b14f573f7f1e3c1ea94f07888f194ff"><code>7cfbf62</code></a> Bump for development</li> <li><a href="https://github.com/pypa/packaging/commit/07f09547c435d08b77c7c80834955f9640d3d3e5"><code>07f0954</code></a> Bump for release</li> <li><a href="https://github.com/pypa/packaging/commit/27ee84a2673c0773513c5f8ea0874a3785539482"><code>27ee84a</code></a> Update changelog with unreleased changes</li> <li><a href="https://github.com/pypa/packaging/commit/0e5023696e68d0b728073d6a381120723c9b0eaf"><code>0e50236</code></a> Include licenses in sdist (<a href="https://github-redirect.dependabot.com/pypa/packaging/issues/358">#358</a>)</li> <li><a href="https://github.com/pypa/packaging/commit/55c33113681a01cbe2aace33c1c1d417837c27cf"><code>55c3311</code></a> Bump for development</li> <li><a href="https://github.com/pypa/packaging/commit/07b8ff471fc978a5b8b3c726717d1941ed083bb8"><code>07b8ff4</code></a> Bump for release</li> <li><a href="https://github.com/pypa/packaging/commit/08fe31273e4e8d3622ae9473cdb73737581682d2"><code>08fe312</code></a> Reference the correct file in the release process</li> <li><a href="https://github.com/pypa/packaging/commit/746aff4b98b4e26f11cae3ef314fa61f18bf9ba5"><code>746aff4</code></a> add support for macos 11.0, arm64, universal2 (<a href="https://github-redirect.dependabot.com/pypa/packaging/issues/319">#319</a>)</li> <li>Additional commits viewable in <a href="https://github.com/pypa/packaging/compare/20.4...20.7">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

</details>

+3 -4

0 comment

1 changed file

pr created time in 3 days

create barnchkarthiknadig/vscode-python

branch : dependabot/pip/packaging-20.7

created branch time in 3 days

issue commentmicrosoft/debugpy

debugpy maps properly the path for setting breakpoints, but not for module location (and thus cannot open the file using the call stack while debugging)

It should be generated in the server (where debugpy is running).

You should be able to set the DEBUGPY_LOG_DIR environment variable to a directory where the logs will be generated in this case.

Yajo

comment created time in 4 days

issue commentmicrosoft/debugpy

debugpy maps properly the path for setting breakpoints, but not for module location (and thus cannot open the file using the call stack while debugging)

El vie, 27 de nov de 2020 a las 05:22, Fabio Zadrozny notifications@github.com escribió:

In particular, I'm interested in the pydevd log file. Can you provide it?

How can I get those logs? Do they come from the container running debugpy, or from the dev machine running vscode?

Yajo

comment created time in 5 days

issue commentmicrosoft/PTVS

Support completion in { } in f-strings

+1

huguesv

comment created time in 5 days

issue commentmicrosoft/debugpy

IOError: [Errno 22] when running files with non-ascii characters.

I investigated it a bit more and it seems that Python 2.7 itself is broken in this regard.

Further info:

In Python 2.7 it's not even possible to use subprocess.Popen with a unicode path. For instance, running the code below has as a result:

  File "W:\pydev.debugger\check\snippet5.py", line 27, in <module>
    subprocess.Popen([sys.executable, code_to_debug])
  File "C:\bin\Miniconda\envs\py27_tests\lib\subprocess.py", line 394, in __init__
    errread, errwrite)
  File "C:\bin\Miniconda\envs\py27_tests\lib\subprocess.py", line 644, in _execute_child
    startupinfo)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 68-69: ordinal not in range(128)

---
C:\bin\Miniconda\envs\py27_tests\python.exe: can't open file 'W:\pydev.debugger\check\??\experiment.py': [Errno 22] Invalid argument

Code:

# coding: utf-8
import os.path
import subprocess
import sys

unicode_chars = u"测试"

tmpdir = os.path.abspath(os.path.dirname(__file__))

directory = os.path.join(tmpdir.decode('utf-8'), unicode_chars)

try:
    # Note: accepts unicode on Python 2.
    os.makedirs(directory)
except:
    pass

code_to_debug = os.path.join(directory, u"experiment.py")
with open(code_to_debug, "w") as stream:
    stream.write(
        """
print('launched')
"""
    )

try:
    subprocess.Popen([sys.executable, code_to_debug])
except:
    import traceback;traceback.print_exc()

sys.stderr.write('\n---\n')
try:
    subprocess.Popen([sys.executable, code_to_debug.encode(sys.getfilesystemencoding())])
except:
    print('Unable to launch as mbcs')
    import traceback;traceback.print_exc()

This happens because the APIs used in Python 2.7 aren't unicode-compatible. There are workarounds such as using CreateProcessW directly (for instance: https://gist.github.com/vaab/2ad7051fc193167f15f85ef573e54eb9).

So, it's not possible to launch unicode that's not compatible with the current machine in Python 2.7 out of the box.

Now, what should be possible is to launch unicode chars that are compatible with the current machine. So, for instance, having unicode chars as: unicode_chars = u"á" in the code above does work in my machine -- where the default locale is cp1252 -- when the Popen args are encoded with the filesystem encoding.

So, I'm working on fixing this use case (but not the use case for any unicode chars).

karthiknadig

comment created time in 5 days

issue commentmicrosoft/debug-adapter-protocol

DataBreakpointEvent?

Hi, I am facing the same thing here. Same issue appears as well between Breakpoint and FunctionBreakpoint, so we can't distinguish a new Breakpoint when sending this event. I guess it'll be similar with InstructionBreakpoint.

hoehrmann

comment created time in 5 days

startedqt4cg/qtspecs

started time in 5 days

issue commentmicrosoft/debugpy

IOError: [Errno 22] when running files with non-ascii characters.

I'll start to take a look at this.

karthiknadig

comment created time in 6 days

push eventmicrosoft/debug-adapter-protocol

Andre Weinand

commit sha 5f2c8f79d40b74a47da8542ebe36474e80c593a7

clarify descriptons for stackTrace request; fixes #162

view details

Andre Weinand

commit sha fd7d38013c9e13e92c0ca4dfa83048d355cb057d

add that 'filter' and 'filterOptions' sets are additive

view details

push time in 6 days

issue closedmicrosoft/debug-adapter-protocol

Clarify semantic of `totalFrames` property in `stackTrace` request

Here my proposals for the descriptions of the DAP stackTrace request and its totalFrames property:

Request stackTrace:

The request returns a stacktrace from the current execution state of a given thread. A client can request all stack frames by omitting the startFrame and levels arguments. For performance conscious clients stack frames can be retrieved in a piecemeal way with the startFrame and levels arguments. The response of the stackTrace request may contain a totalFrames property that hints at the total number of frames in the stack. If a client needs this total number upfront, it can issue a request for a single (first) frame and depending on the value of totalFrames decide how to proceed. In any case should a client be prepared to receive less frames than requested, which is an indication that the end of the stack has been reached.

Property totalFrames:

The total number of frames available in the stack. If omitted or if totalFrames is larger than the available frames, a client is expected to request frames until a request returns less frames than requested (which indicates the end of the stack). Returning monotonically increasing totalFrames values for subsequent requests can be used to enforce paging in the client.

closed time in 6 days

weinand

issue commentmicrosoft/debug-adapter-protocol

Clarify semantic of `totalFrames` property in `stackTrace` request

SGTM, thanks! :-)

In any case should a client be prepared to receive less

Perhaps "should a client" should be "a client should"?

weinand

comment created time in 6 days

issue commentmicrosoft/PTVS

No Official Python 3.8 Support for Visual Studio 16.4

Does VSC have an integrated debugger?

Anapo14

comment created time in 6 days

pull request commentmicrosoft/debugpy

Support module with __file__=None. Fixes #475

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

fabioz

comment created time in 6 days

issue commentmicrosoft/debugpy

debugpy maps properly the path for setting breakpoints, but not for module location (and thus cannot open the file using the call stack while debugging)

The logs aren't complete, so, I can't really diagnose this properly.

In particular, I'm interested in the pydevd log file. Can you provide it?

On a first glance I think that in this case one of the paths has more than one translation back and we just go with the first one found (the pydevd log should have more info on the actual targets and translations to be able to diagnose this better).

Ideally your mapping should be an injective function, but if that's not possible, you should put the ones you want to match first earlier in that list.

p.s.: please attach the log files to this issue instead of putting it in a gist.

Yajo

comment created time in 6 days

pull request commentmicrosoft/debugpy

Support module with __file__=None. Fixes #475

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

fabioz

comment created time in 6 days

pull request commentmicrosoft/debugpy

Support module with __file__=None. Fixes #475

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

fabioz

comment created time in 6 days

issue closedmicrosoft/debugpy

Debug: hide special variables and function variables

<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. --> image

closed time in 6 days

jeffreyyjp

issue commentmicrosoft/debugpy

Debug: hide special variables and function variables

Closing as the support to change how that's presented is already in the debugger backend by editing the launch.json.

You can follow https://github.com/microsoft/vscode-python/issues/12373 for a request to be able to set it in the settings and not only through individual launch configurations.

jeffreyyjp

comment created time in 6 days

PR opened microsoft/debugpy

Support module with __file__=None. Fixes #475
+67 -26

0 comment

5 changed files

pr created time in 6 days

pull request commentmicrosoft/debugpy

Sync with latest pydevd.

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

fabioz

comment created time in 6 days

more