473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Buffer Overflow with Python 2.5 on Vista in import site

A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the
official msi installers and running on Vista under Parallels on the
Mac).

'import site' fails due to a string in sys.path that contains a huge
number of null bytes.

The error is actually in ntpath - I adjusted it to print the paths it
is working with and a string on encountering the bad path.

Because 'import site' is executed twice with the following code I
snipped the first dump and only print the one with the traceback:

C:\Users\Administrator>python -c "import site"

[snip]

'import site' failed; use -v for traceback
set(['c:\\python25\\lib\\plat-win', 'c:\\windows\\system32\
\python25.zip', 'c:\\
python25', 'c:\\python25\\lib\\lib-tk', 'c:\\users\\administrator', 'c:
\\python2
5\\dlls', 'c:\\python25\\lib', 'c:\\python25\\lib\\site-packages'])

******************** BAD PATH ********************
"C:\\Python25\\lib\\site-packages\\\x00\x05\x16\x07\x00\x02\x00\x00Mac
OS X
\x00\x02\x00\x00\x00\t\x00\x00\x002\x00\x00\x0e
\xb0\x00\x00\x00\x02\x00\x00\x
0e\xe2\x00\x00\x01\x1e
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x
00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x00\x00\x00AT
TR\x00\x00\x00!\x00\x00\x0e\xe2\x00\x00\x00\x98\x0 0\x00\x00
\x00\x00\x00\x00\x00
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x 00\x00\x98\x00\x00\x00
\x00\x0
0\x15com.macromates.caret\x00x\x9c\xab\xe6R\x00\x8 2\xe4\xfc\x9c
\xd2\xdc<\x05[\x0
5\x03k0?'3/\x15\xc2\xab\x05\x00\x8b\x99\x08\x1d
\x00\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\

[snip a load of null bytes]

x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0 0\x00\x00\x00\x00\x00\x00\x00\
x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x0 0\x1eThis resource
fork intent
ionally left blank
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x 00\x00\x0

[snip a load more null bytes]

0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\ x00\x00\x1e
\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x1c\x00\x1e\xff\xff"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Python25\lib\site.py", line 417, in <module>
main()
File "C:\Python25\lib\site.py", line 402, in main
paths_in_sys = addsitepackages(paths_in_sys)
File "C:\Python25\lib\site.py", line 206, in addsitepackages
addsitedir(sitedir, known_paths)
File "C:\Python25\lib\site.py", line 169, in addsitedir
addpackage(sitedir, name, known_paths)
File "C:\Python25\lib\site.py", line 141, in addpackage
dir, dircase = makepath(sitedir, line)
File "C:\Python25\lib\site.py", line 67, in makepath
dir = os.path.abspath(os.path.join(*paths))
File "C:\Python25\lib\ntpath.py", line 500, in abspath
path = _getfullpathname(path)
TypeError: _getfullpathname() argument 1 must be (buffer overflow),
not str
Odd. Anyone got any clues?

Michael Foord
http://www.ironpythoninaction.com
Mar 29 '08 #1
2 1898
En Sat, 29 Mar 2008 17:34:27 -0300, Fuzzyman <fu******@gmail.comescribió:
A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the
official msi installers and running on Vista under Parallels on the
Mac).
It may be actually a Parallels issue - I've installed 2.5.1 on Vista (just
once, on a real PC) and it worked fine. Anyway a better place for bug
reports is bugs.python.org

Mmm, maybe you should check all your .pth files - looks like this strange
path comes from one of them.

--
Gabriel Genellina

Mar 30 '08 #2
On Mar 30, 3:53 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Sat, 29 Mar 2008 17:34:27 -0300, Fuzzyman <fuzzy...@gmail.comescribió:
A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the
official msi installers and running on Vista under Parallels on the
Mac).

It may be actually a Parallels issue - I've installed 2.5.1 on Vista (just
once, on a real PC) and it worked fine. Anyway a better place for bug
reports is bugs.python.org

Mmm, maybe you should check all your .pth files - looks like this strange
path comes from one of them.

I think it comes from the '._something.pth' that Textmate created as a
temporary file when I edited a 'pth' file. The 'macromates' text in
their is from textmate. I'm not sure if it is Mac specific or Texmate
specific, but those temp files are really annoying.

Thanks.

Michael
http://www.ironpythoninaction.com/
>
--
Gabriel Genellina
Mar 30 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jeremy C. Reed | last post by:
Configuring gramps (genealogy software) says: checking Python bindings for gtk... ok checking Python bindings for GNOME... ok checking Python bindings for gconf... Traceback (most recent call...
1
by: Petr Prikryl | last post by:
I did observe the problem when using the -U option on Windows 2000. Seems like some infinite recursion in cp1250.py -- see below. I did not try it with earlier versions of Python. Can this...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 393 open (+15) / 3315 closed (+17) / 3708 total (+32) Bugs : 908 open (+22) / 5975 closed (+49) / 6883 total (+71) RFE : 223 open...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
4
by: Markus Dahlbokum | last post by:
Hello, I'm trying to link python statically with qt and pyqt. I've tried this in several ways but never succeeded. At the moment the final make runs without errors but I get import errors when...
5
by: Gruik | last post by:
Hi people, I'm currently working on python embedding with C++. My goal is that the C++ part handle files writing/reading so that the Python part only works with buffers. I succeeded in buffer...
0
by: Matt Nordhoff | last post by:
Barak, Ron wrote: For some reason, when you run "import locale", it's importing wx.locale instead of the "locale" module from the stdlib. However, I have no idea why that would be happening......
2
by: Gabriel Rossetti | last post by:
Hello everyone, I'm trying to use python's freeze utility but I'm running into problems. I called it like this : python /usr/share/doc/python2.5/examples/Tools/freeze/freeze.py...
1
by: Martin Rubey | last post by:
Dear all, I'm trying to call from common lisp functions written for Sage (www.sagemath.org), which in turn is written in python. To do so, I tried...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.