473,786 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ 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\Admini strator>python -c "import site"

[snip]

'import site' failed; use -v for traceback
set(['c:\\python25\\ lib\\plat-win', 'c:\\windows\\s ystem32\
\python25.zip', 'c:\\
python25', 'c:\\python25\\ lib\\lib-tk', 'c:\\users\\adm inistrator', '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\x0 0\x00\t\x00\x00 \x002\x00\x00\x 0e
\xb0\x00\x00\x0 0\x02\x00\x00\x
0e\xe2\x00\x00\ x01\x1e
\x00\x00\x00\x0 0\x00\x00\x00\x 00\x00\x00\x00\ x00\x00\x00\x
00\x00\x00\x00\ x00\x00\x00\x00 \x00\x00\x00\x0 0\x00\x00\x00\x 00\x00\x00\x00\ x00AT
TR\x00\x00\x00! \x00\x00\x0e\xe 2\x00\x00\x00\x 98\x00\x00\x00
\x00\x00\x00\x0 0\x00
\x00\x00\x00\x0 0\x00\x00\x00\x 00\x00\x00\x01\ x00\x00\x00\x98 \x00\x00\x00
\x00\x0
0\x15com.macrom ates.caret\x00x \x9c\xab\xe6R\x 00\x82\xe4\xfc\ x9c
\xd2\xdc<\x05[\x0
5\x03k0?'3/\x15\xc2\xab\x0 5\x00\x8b\x99\x 08\x1d
\x00\x00\x00\x0 0\x00\x00\x00\x 00\
x00\x00\x00\x00 \x00\x00\x00\x0 0\x00\x00\x00\x 00\x00\x00\x00\ x00\x00\x00\x00 \x00\
x00\x00\x00\x00 \x00\x00\x00\x0 0\x00\x00\x00\x 00\x00\x00\x00\ x00\x00\x00\x00 \x00\

[snip a load of null bytes]

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

[snip a load more null bytes]

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

Michael Foord
http://www.ironpythoninaction.com
Mar 29 '08 #1
2 1924
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.a r>
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.pt h' 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
4233
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 last): File "conftest.py", line 17, in ? import gnome.gconf ImportError: No module named gconf cat: conftest.out: No such file or directory configure: error:
1
1566
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 be reproduced on your computer? Thanks for your time and experience, pepr
0
334
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 ( -1) / 229 closed ( +2) / 452 total ( +1) New / Reopened Patches ______________________
331
14987
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 most versatile text editor. And, besides text editing, it also serves as a
4
2490
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 accessing pyqt. How can I solve this problem? Markus # installing zipimport hook
5
2769
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 exchanges. The problem is that some of the files I read/write are python files so that, before embedding, I imported them as modules when I needed them.
0
1847
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... Did you do something to add wx to your PYTHONPATH? Maybe do "import sys; print sys.path" or "import os; print os.environ" to verify this. (Hopefully someone more knowledgeable than me will come along soon.)
2
2649
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 ~/Documents/Code/Python/src/jester/service.py -m jester then I did : make
1
2794
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 http://common-lisp.net/project/python-on-lisp/. It was quite easy to get it to run and do some simple things with python. However, I was unable to get sage to run within it. If I start my local python 2.5 and follow (roughly)
0
9497
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8992
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.