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: 'TypeError: object of type 'NoneType' has no len()' in 'splitdrive'
Type: compile error Stage: resolved
Components: Distutils, Windows Versions: Python 3.4
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Konrad, dstufft, eric.araujo, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2016-02-24 10:14 by Konrad, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg260783 - (view) Author: (Konrad) Date: 2016-02-24 10:14

when trying to build the 'bsddb3' extension (from which is necessary for Gramps ( )I get the error 'TypeError: object of type 'NoneType' has no len()'. MinGW32 which I've installed for this purpose seems to work.

Here is the Traceback:

Detected Berkeley DB version 6.0 from db.h
running build
running build_py
running build_ext
building 'bsddb3._pybsddb' extension
c:\temp\mingw\bin\gcc.exe -mdll -O -Wall -IC:/Temp/BerkelyDB/include/ -Ic:\temp\
python34\include -Ic:\temp\python34\include -c Modules/_bsddb.c -o build\temp.wi
writing build\temp.win32-3.4\Release\modules\_pybsddb.def
Traceback (most recent call last):
  File "", line 527, in <module>
    'Programming Language :: Python :: 3.4',
  File "c:\temp\python34\lib\distutils\", line 148, in setup
  File "c:\temp\python34\lib\distutils\", line 955, in run_commands
  File "c:\temp\python34\lib\distutils\", line 974, in run_command
  File "c:\temp\python34\lib\distutils\command\", line 126, in run
  File "c:\temp\python34\lib\distutils\", line 313, in run_command
  File "c:\temp\python34\lib\distutils\", line 974, in run_command
  File "c:\temp\python34\lib\site-packages\setuptools\command\", line 49, in run
  File "c:\temp\python34\lib\distutils\command\", line 339, in run
  File "c:\temp\python34\lib\distutils\command\", line 448, in build_extensions
  File "c:\temp\python34\lib\site-packages\setuptools\command\", line 174, in build_extension
    _build_ext.build_extension(self, ext)
  File "c:\temp\python34\lib\distutils\command\", line 535, in build_extension
  File "c:\temp\python34\lib\distutils\", line 717, in link_shared_object
    extra_preargs, extra_postargs, build_temp, target_lang)
  File "c:\temp\python34\lib\distutils\", line 248, in link
  File "c:\temp\python34\lib\distutils\", line 157, in link
  File "c:\temp\python34\lib\distutils\", line 1092, in gen_lib_options
    opt = compiler.runtime_library_dir_option(dir)
  File "c:\temp\python34\lib\distutils\", line 224, in runtime_library_dir_option
    compiler = os.path.basename(sysconfig.get_config_var("CC"))
  File "c:\temp\python34\lib\", line 246, in basename
    return split(p)[1]
  File "c:\temp\python34\lib\", line 217, in split
    d, p = splitdrive(p)
  File "c:\temp\python34\lib\", line 159, in splitdrive
    if len(p) > 1:
TypeError: object of type 'NoneType' has no len()

This behavior possibly relates to other issues (, but I'm not sure about it.

Sorry for my poor understanding of these things.


msg260792 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-24 11:51
This is not related to issue22587. The problem is that sysconfig.get_config_var("CC") returns None. This may be a bug in the distutils package, in the bsddb3 extension, in MinGW32, or in user configuration.
msg386377 - (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:58:27adminsetgithub: 70612
2021-02-03 18:26:19steve.dowersetstatus: open -> closed
resolution: out of date
messages: + msg386377

stage: resolved
2016-02-24 11:51:48serhiy.storchakasetnosy: + eric.araujo, dstufft, serhiy.storchaka
messages: + msg260792
components: + Distutils
2016-02-24 10:14:39Konradcreate