![](https://secure.gravatar.com/avatar/4ebd883c704507c64eaebce2e0d9f627.jpg?s=120&d=mm&r=g)
The latest numpy svn checkout fails to build (Python 2.3.5) when trying to call tempfile.mktemp(). The module index says: mktemp([suffix[, prefix[, dir]]]) Deprecated since release 2.3. Use mkstemp() instead. [...] ------------------------------------------------------------------------------------ [...] Traceback (most recent call last): File "setup.py", line 84, in ? setup_package() File "setup.py", line 77, in setup_package setup( configuration=configuration ) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/core.py", line 152, in setup return old_setup(**new_attr) File "/usr/lib/python2.3/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands self.run_command(cmd) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/install.py", line 11, in run r = old_install.run(self) File "/usr/lib/python2.3/distutils/command/install.py", line 506, in run self.run_command('build') File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/usr/lib/python2.3/distutils/command/build.py", line 107, in run self.run_command(cmd_name) File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command cmd_obj.run() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 84, in run self.build_sources() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 103, in build_sources self.build_extension_sources(ext) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 209, in build_extension_sources sources = self.generate_sources(sources, ext) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", line 267, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 35, in generate_config_h library_dirs = default_lib_dirs) File "/usr/lib/python2.3/distutils/command/config.py", line 278, in try_run self._check_compiler() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/config.py", line 35, in _check_compiler self.fcompiler.customize(self.distribution) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", line 294, in customize oflags = self.__get_flags(self.get_flags_opt,'FOPT',(conf,'opt')) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", line 511, in __get_flags var = command() File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/gnu.py", line 122, in get_flags_opt if self.get_version()<='3.3.3': File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/ccompiler.py", line 251, in CCompiler_get_version status, output = exec_command(cmd,use_tee=0) File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 254, in exec_command use_tee=use_tee, File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mktemp() AttributeError: 'module' object has no attribute 'mktemp' ------------------------------------------------------------------------------------ Replacing mktemp() by mkstemp() doesn't help: [...] File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mkstemp() AttributeError: 'module' object has no attribute 'mkstemp' but doing it in an interactive session works: In [1]: import tempfile In [2]: tempfile.mkstemp() Out[2]: (3, '/tmp/tmp0Iv8K7') What's going on? cheers, steve -- Random number generation is the art of producing pure gibberish as quickly as possible.
![](https://secure.gravatar.com/avatar/764323a14e554c97ab74177e0bce51d4.jpg?s=120&d=mm&r=g)
Steve Schmerler wrote:
The latest numpy svn checkout fails to build (Python 2.3.5) when trying to call tempfile.mktemp(). The module index says:
mktemp([suffix[, prefix[, dir]]]) Deprecated since release 2.3. Use mkstemp() instead. [...]
File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mktemp() AttributeError: 'module' object has no attribute 'mktemp'
Do you have a file tempfile.py sitting around that isn't the standard library's tempfile.py? -- Robert Kern robert.kern@gmail.com "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
![](https://secure.gravatar.com/avatar/4ebd883c704507c64eaebce2e0d9f627.jpg?s=120&d=mm&r=g)
Robert Kern wrote:
Steve Schmerler wrote:
The latest numpy svn checkout fails to build (Python 2.3.5) when trying to call tempfile.mktemp(). The module index says:
mktemp([suffix[, prefix[, dir]]]) Deprecated since release 2.3. Use mkstemp() instead. [...]
File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mktemp() AttributeError: 'module' object has no attribute 'mktemp'
Do you have a file tempfile.py sitting around that isn't the standard library's tempfile.py?
No. elcorto@ramrod:~/install/python/matplotlib$ sudo updatedb Password: elcorto@ramrod:~/install/python/matplotlib$ locate tempfile.py /usr/lib/python2.3/tempfile.py /usr/lib/python2.3/tempfile.pyc /usr/lib/python2.3/tempfile.pyo /usr/share/reportbug/rbtempfile.py /usr/share/reportbug/rbtempfile.pyc /usr/share/reportbug/rbtempfile.pyo numpy 0.9.6 from sourceforge builds just fine. cheers, steve -- Random number generation is the art of producing pure gibberish as quickly as possible.
![](https://secure.gravatar.com/avatar/9b85a909fbfc71a3ea3275c7872e714d.jpg?s=120&d=mm&r=g)
On Mon, 3 Apr 2006, Steve Schmerler wrote:
Robert Kern wrote:
Steve Schmerler wrote:
The latest numpy svn checkout fails to build (Python 2.3.5) when trying to call tempfile.mktemp(). The module index says:
mktemp([suffix[, prefix[, dir]]]) Deprecated since release 2.3. Use mkstemp() instead. [...]
File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mktemp() AttributeError: 'module' object has no attribute 'mktemp'
Do you have a file tempfile.py sitting around that isn't the standard library's tempfile.py?
No.
I can reproduce this error with pyhton 2.3 but not with 2.4. So it seems to be a bug of import machinery of Python 2.3. I have commited a workaround to this problem to numpy svn. Pearu
![](https://secure.gravatar.com/avatar/4ebd883c704507c64eaebce2e0d9f627.jpg?s=120&d=mm&r=g)
Pearu Peterson wrote:
On Mon, 3 Apr 2006, Steve Schmerler wrote:
Robert Kern wrote:
Steve Schmerler wrote:
The latest numpy svn checkout fails to build (Python 2.3.5) when trying to call tempfile.mktemp(). The module index says:
mktemp([suffix[, prefix[, dir]]]) Deprecated since release 2.3. Use mkstemp() instead. [...]
File "/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", line 279, in _exec_command_posix tmpfile = tempfile.mktemp() AttributeError: 'module' object has no attribute 'mktemp'
Do you have a file tempfile.py sitting around that isn't the standard library's tempfile.py?
No.
I can reproduce this error with pyhton 2.3 but not with 2.4. So it seems to be a bug of import machinery of Python 2.3. I have commited a workaround to this problem to numpy svn.
Thanks. I should switch to python 2.4 anyway sometime soon ... cheers, steve -- When danger or in doubt, run in circles, scream and shout.
participants (3)
-
Pearu Peterson
-
Robert Kern
-
Steve Schmerler