[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2020-11-16 Thread Eryk Sun


Eryk Sun  added the comment:

> The patch adding 'name' and 'path' to the ImportError str/repr 
> was not merged yet.

It's up to whatever code raises an ImportError to determine how the name and 
path should be included in the error message. In Windows, the DLL name was 
added to the exception message in 3.8. So I'm closing this issue again, with 
regard to its final scope. 

With regard to its original scope, the reason for closing is "wont fix". There 
are no plans to extend the import error of an extension module in Windows to 
include the missing DLL dependency that caused the import to fail. There are 
tools such as the "DLL Diagnostics" package on PyPI that implement a proper 
trace by parsing loader snaps, and at the very least there are tools such as 
dumpbin.exe (or link.exe /dump) to manually list the direct dependencies of a 
DLL.

--
nosy: +eryksun
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2020-11-16 Thread Irit Katriel


Irit Katriel  added the comment:

The patch adding 'name' and 'path' to the ImportError str/repr was not merged 
yet.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.9 -Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-07-22 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Ok, the demo demo I added sucks, because I didn't demo the original problem 
(.pyd found but could not be loaded), but the point is, it displays the "name" 
and "path" attributes.  They can be set, for example, if the module is found 
but cannot be loaded for some reason.

That's the point of this issue.  The fix added a "name" and "path" attributes, 
but they were never actually _output_ when such an error occurred.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-07-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

How it the new message better than "ImportError: No module named '_socket'"?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-07-22 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

An example patch that aims to put the "name" and "path" in str() and repr() 
representations of ImportError.

Output when _socket.pyd is not found:

>>> import socket
Traceback (most recent call last):
  File "", line 1, in 
  File "D:\pydev\hg\cpython3\lib\socket.py", line 47, in 
import _socket
ImportError: No module named '_socket', _socket,
>>> sys.last_value

>>>

--
Added file: http://bugs.python.org/file26476/ImportError.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-07-21 Thread Piotr Dobrogost

Changes by Piotr Dobrogost :


--
nosy: +piotr.dobrogost

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-06-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Brian, reopening this since the original issue isn't addressed:  The "path" and 
"module" attributes aren't part of the error "repr"

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-06-05 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

repr() or str() of ImportError doesn't include the 'name' or 'path' members.  
It would be useful to have them added to the repr if present.

--
nosy: +kristjan.jonsson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-04-15 Thread Brian Curtin

Changes by Brian Curtin :


--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2012-04-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f341b99bb370 by Brian Curtin in branch 'default':
Fix #10854. Make use of the new path and name attributes on ImportError
http://hg.python.org/cpython/rev/f341b99bb370

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-11-22 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-11-22 Thread Brian Curtin

Changes by Brian Curtin :


--
assignee:  -> brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-11-11 Thread Brian Curtin

Brian Curtin  added the comment:

Marked #1559549 as a dependency. I combine the patch in this issue with the one 
over there.

--
dependencies: +ImportError needs attributes for module and file name

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-07-26 Thread Nick Coghlan

Nick Coghlan  added the comment:

See also #1559549, which similarly adds attribute support to ImportError and 
covers some of the issues with using positional arguments to do so.

Extending that approach to a path keyword argument as well should work nicely.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-07-26 Thread Brian Curtin

Brian Curtin  added the comment:

How about something like this?

ImportError moves from being a "simple" exception to a "complex" one, then adds 
a "name" and "path" attribute. In dynload_win.c where we try (and fail) to load 
C extensions, the name and path are set on the ImportError. The test simply 
creates a file following the C extension name format and checks that the 
attributes end up being correct upon ImportError.

Jazzing up the ImportErrors elsewhere in the code might be useful after this, 
but I'll handle that in another issue if this gains traction.

--
keywords: +patch
Added file: http://bugs.python.org/file22768/issue10854.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-01-20 Thread Christoph Gohlke

Changes by Christoph Gohlke :


--
nosy: +cgohlke

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-01-14 Thread anatoly techtonik

anatoly techtonik  added the comment:

Great. Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10854] Output .pyd name in error message of ImportError when DLL load fails

2011-01-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Sorry, I missed that the request had changed to just the .pyd name. That at 
least is useful, since you then know where to start with depends.exe. It should 
be fairly straightforward to implement as well.

Adjusted issue title accordingly.

--
resolution: wont fix -> 
status: closed -> open
title: Output DLL name in error message of ImportError when DLL is missing -> 
Output .pyd name in error message of ImportError when DLL load fails

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com