Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in PIL stub #994

Closed
alvesvaren opened this issue Feb 26, 2021 · 3 comments
Closed

Typo in PIL stub #994

alvesvaren opened this issue Feb 26, 2021 · 3 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@alvesvaren
Copy link

alvesvaren commented Feb 26, 2021

Environment data

  • Language Server version: (Can't see for some reason)
  • OS and version: Arch Linux, 5.10.17-rt32-xanmod1-1-rt kernel
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.9.2

Expected behaviour

Image.rotate(number, expand=True) works without any typing issue

Actual behaviour

Pylance says that there's no parameter named expand.
Checking the stub file Image.pyi:160 reveals that it's accidentally named exexpand in the file.

Logs

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJoinMailingListVar3'
User belongs to experiment group 'pythonSendEntireLineToREPL'
User belongs to experiment group 'pythonNotDisplayLinterPrompt'
User belongs to experiment group 'pythonTensorboardExperimentcf'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'ShowExtensionSurveyPrompt - control'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - experiment'
User belongs to experiment group 'CollectLSRequestTiming - experiment'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
> conda --version
> pyenv root
> python3.7 ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
> python ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python ~/.vscode/extensions/ms-python.python-2021.2.582707922/pythonFiles/pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda env list
Error 2021-02-26 15:07:25: Failed to get conda environment list from conda [Error: spawn conda ENOENT
	at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
	at onErrorNT (internal/child_process.js:469:16)
	at processTicksAndRejections (internal/process/task_queues.js:84:21)] {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn conda',
  path: 'conda',
  spawnargs: [ 'env', 'list' ]
}
Error 2021-02-26 15:07:25: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file '/home/alve/dev/binimg/.vscode/settings.json' (Error: Unable to resolve non-existing file '/home/alve/dev/binimg/.vscode/settings.json')
	at _handleError (/opt/visual-studio-code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:86:136165)
	at processTicksAndRejections (internal/process/task_queues.js:97:5)
	at async y.readText (/home/alve/.vscode/extensions/ms-python.python-2021.2.582707922/out/client/extension.js:9:298390)
	at async p.doesFileNeedToBeFixed (/home/alve/.vscode/extensions/ms-python.python-2021.2.582707922/out/client/extension.js:59:481374)
	at async /home/alve/.vscode/extensions/ms-python.python-2021.2.582707922/out/client/extension.js:59:480501
	at async Promise.all (index 1)
	at async p.getFilesToBeFixed (/home/alve/.vscode/extensions/ms-python.python-2021.2.582707922/out/client/extension.js:59:480447)
	at async p.updateTestSettings (/home/alve/.vscode/extensions/ms-python.python-2021.2.582707922/out/client/extension.js:59:480074)] {
  code: 'FileNotFound'
}
Starting Pylance language server.
Python interpreter path: /usr/bin/python
> conda --version

(this does not look correct but that's not the problem)

Code Snippet / Additional information

from PIL import Image
from PIL.ImageEnhance import Contrast

im = Image.open("image.jpg")
im = enhancer = Contrast(im).enhance(100)

# im = im.filter(ImageFilter)
im = im.rotate(-90, expand=True)  # Says that this is incorrect
im.show()
for i in im.getdata():
    print(i)
@jakebailey jakebailey self-assigned this Feb 26, 2021
@jakebailey jakebailey added the typestub Issue relating to our bundled type stubs label Feb 26, 2021
@github-actions github-actions bot removed the triage label Feb 26, 2021
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Mar 3, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.3.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202130-3-march-2021

@lepakas
Copy link

lepakas commented Nov 23, 2022

I have a serious problem.Whenever I install a library ex. Pillow or phonenumbers and then try to use them i cannot because in output says module error no module named PIL how can I solve this problem ???
Also sometimes it says that Pylance have not access in a certain library ex

@rchiodo
Copy link
Contributor

rchiodo commented Nov 23, 2022

I have a serious problem.Whenever I install a library ex. Pillow or phonenumbers and then try to use them i cannot because in output says module error no module named PIL how can I solve this problem ??? Also sometimes it says that Pylance have not access in a certain library ex

@lepakas can you log a new issue following our guidelines here:
https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

4 participants