This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: warn_dir is always true for install_data, even if an install_dir is specified
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, steve.dower, tabrezm
Priority: normal Keywords:

Created on 2014-01-02 10:19 by tabrezm, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg207148 - (view) Author: Tabrez Mohammed (tabrezm) Date: 2014-01-02 10:19
In run(), there is a warning message printed to the console if warn_dir is '1':
  if self.warn_dir:
    self.warn("setup script did not provide a directory for "
              "'%s' -- installing right in '%s'" %
             (f, self.install_dir))

warn_dir should be unset in run to suppress the warning if an install_dir is specified.
msg231395 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-11-19 17:28
Does this cause a warning to be printed out when it should not?  Or did you find this by reading the code?

[I think I remember this code being changed in the (now defunct) distutils2 project.]
msg231396 - (view) Author: Tabrez Mohammed (tabrezm) Date: 2014-11-19 18:09
The former. I copy/pasted the code block to show from where the warning message was being printed.
msg231404 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-11-20 01:52
Can you give us steps to reproduce the issue?
msg231407 - (view) Author: Tabrez Mohammed (tabrezm) Date: 2014-11-20 02:42
I don't have access to the code anymore that repro'ed this issue. I just remember writing a setup script for a module I was working on, and when 'install' was run, it would print this error message.

It's pretty easy to see in code what the problem is though. In, warn_dir is set to '1' in initialize_options(), but it's value is never altered. So regardless of what is or isn't passed in, the warning will always be printed.
msg386389 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:26
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:57:56adminsetgithub: 64305
2021-02-03 18:26:31steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386389

resolution: out of date
stage: needs patch -> resolved
2014-11-20 02:42:10tabrezmsetmessages: + msg231407
2014-11-20 01:52:58eric.araujosetmessages: + msg231404
2014-11-19 18:09:42tabrezmsetmessages: + msg231396
2014-11-19 17:28:04eric.araujosetmessages: + msg231395
versions: + Python 3.5, - Python 3.3
2014-11-19 09:05:40serhiy.storchakasetnosy: + eric.araujo, dstufft

stage: needs patch
2014-01-02 10:19:39tabrezmcreate