Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What's Going on between Python and win7?

0 views
Skip to first unread message

W. eWatson

unread,
Feb 22, 2010, 10:22:02 AM2/22/10
to
Last night I copied a program from folder A to folder B. It inspects the
contents of files in a folder. When I ran it in B, it gave the results
for A! Out of frustration I changed the name in A, and fired up the
program in B. Win7 went into search mode for the file. I looked at
properties for the B program, and it was clearly pointing to folder A.

Anyone have this happen to them?

Another anomaly. I have the files track.py and trackstudy.py in the same
folder along with 100 or so other py and txt data files. When I did a
search from the folder window in the upper right corner, search only
found one of the two. I called HP tech support about it, and they could
see it for themselves via remote control. They had no idea, but agreed
to contact MS. In this case, I noted that this search box has some sort
of filter associated with it. Possibly, in my early stages of learning
to navigate in Win7, I accidentally set the filter.

Comments?

Krister Svanlund

unread,
Feb 22, 2010, 10:43:07 AM2/22/10
to W. eWatson, pytho...@python.org

I can't really see the python related problem here...

MRAB

unread,
Feb 22, 2010, 11:01:34 AM2/22/10
to pytho...@python.org
W. eWatson wrote:
> Last night I copied a program from folder A to folder B. It inspects the
> contents of files in a folder. When I ran it in B, it gave the results
> for A! Out of frustration I changed the name in A, and fired up the
> program in B. Win7 went into search mode for the file. I looked at
> properties for the B program, and it was clearly pointing to folder A.
>
Sounds like you didn't copy it but made a shortcut to it instead.

> Anyone have this happen to them?
>
> Another anomaly. I have the files track.py and trackstudy.py in the same
> folder along with 100 or so other py and txt data files. When I did a
> search from the folder window in the upper right corner, search only
> found one of the two. I called HP tech support about it, and they could
> see it for themselves via remote control. They had no idea, but agreed
> to contact MS. In this case, I noted that this search box has some sort
> of filter associated with it. Possibly, in my early stages of learning
> to navigate in Win7, I accidentally set the filter.
>
> Comments?

Not Python-related.

Grant Edwards

unread,
Feb 22, 2010, 11:29:47 AM2/22/10
to
On 2010-02-22, W. eWatson <wolft...@invalid.com> wrote:

> Last night I copied a program from folder A to folder B.

[tail of various windows breakages elided]

> Comments?

Switch to Linux?

Or at least install Cygwin?

--
Grant Edwards grante Yow! Maybe I should have
at asked for my Neutron Bomb
visi.com in PAISLEY --

W. eWatson

unread,
Feb 22, 2010, 1:30:31 PM2/22/10
to
On 2/22/2010 8:29 AM, Grant Edwards wrote:
> On 2010-02-22, W. eWatson<wolft...@invalid.com> wrote:
>
>> Last night I copied a program from folder A to folder B.
>
> [tail of various windows breakages elided]
>
>> Comments?
>
> Switch to Linux?
>
> Or at least install Cygwin?
>
Yes, definitely not related, but maybe some W7 user has a similar
experience here. It seems a natural place to look, since it should be
reasonably common.

I have Cygwin.

Gib Bogle

unread,
Feb 22, 2010, 3:16:26 PM2/22/10
to
MRAB wrote:
> W. eWatson wrote:
>> Last night I copied a program from folder A to folder B. It inspects
>> the contents of files in a folder. When I ran it in B, it gave the
>> results for A! Out of frustration I changed the name in A, and fired
>> up the program in B. Win7 went into search mode for the file. I looked
>> at properties for the B program, and it was clearly pointing to folder A.
>>
> Sounds like you didn't copy it but made a shortcut to it instead.

Windows 7 has symbolic links?

John Bokma

unread,
Feb 22, 2010, 3:33:43 PM2/22/10
to
Gib Bogle <g.b...@auckland.no.spam.ac.nz> writes:

Symbolic links are designed to aid in migration and application
compatibility with UNIX operating systems. Microsoft has implemented
its symbolic links to function just like UNIX links.

:

Symbolic links are available in NTFS starting with Windows Vista.

http://msdn.microsoft.com/en-us/library/aa365680(VS.85).aspx

--
John Bokma j3b

Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development

Grant Edwards

unread,
Feb 22, 2010, 4:19:32 PM2/22/10
to
On 2010-02-22, John Bokma <jo...@castleamber.com> wrote:
> Gib Bogle <g.b...@auckland.no.spam.ac.nz> writes:
>
>> MRAB wrote:
>>> W. eWatson wrote:
>>>> Last night I copied a program from folder A to folder B. It
>>>> inspects the contents of files in a folder. When I ran it in B, it
>>>> gave the results for A! Out of frustration I changed the name in A,
>>>> and fired up the program in B. Win7 went into search mode for the
>>>> file. I looked at properties for the B program, and it was clearly
>>>> pointing to folder A.
>>>>
>>> Sounds like you didn't copy it but made a shortcut to it instead.
>>
>> Windows 7 has symbolic links?
>
> Symbolic links are designed to aid in migration and application
> compatibility with UNIX operating systems. Microsoft has implemented
> its symbolic links to function just like UNIX links.

So symbolic links on W7 function like Unix (hard) links
rather than Unix _symbolic_ links??

--
Grant Edwards grante Yow! Is this sexual
at intercourse yet?? Is it,
visi.com huh, is it??

John Bokma

unread,
Feb 22, 2010, 5:02:47 PM2/22/10
to
Grant Edwards <inv...@invalid.invalid> writes:

Which leads you to this conclusion?

According to http://msdn.microsoft.com/en-us/library/aa365006(VS.85).aspx

There are three types of file links supported in the NTFS file
system: hard links, junctions, and symbolic links. This topic is an
overview of hard links and junctions. For information about symbolic
links, see Creating Symbolic Links.

Creating Symbolic Links:
http://msdn.microsoft.com/en-us/library/aa363878(VS.85).aspx

Gib Bogle

unread,
Feb 22, 2010, 5:10:54 PM2/22/10
to
John Bokma wrote:
> Gib Bogle <g.b...@auckland.no.spam.ac.nz> writes:
>
>> MRAB wrote:
>>> W. eWatson wrote:
>>>> Last night I copied a program from folder A to folder B. It
>>>> inspects the contents of files in a folder. When I ran it in B, it
>>>> gave the results for A! Out of frustration I changed the name in A,
>>>> and fired up the program in B. Win7 went into search mode for the
>>>> file. I looked at properties for the B program, and it was clearly
>>>> pointing to folder A.
>>>>
>>> Sounds like you didn't copy it but made a shortcut to it instead.
>> Windows 7 has symbolic links?
>
> Symbolic links are designed to aid in migration and application
> compatibility with UNIX operating systems. Microsoft has implemented
> its symbolic links to function just like UNIX links.
>
> :
>
> Symbolic links are available in NTFS starting with Windows Vista.
>
> http://msdn.microsoft.com/en-us/library/aa365680(VS.85).aspx
>

That explains my ignorance of this (excellent) development. I'm still using W2K
and XP.

Grant Edwards

unread,
Feb 22, 2010, 5:40:27 PM2/22/10
to
On 2010-02-22, John Bokma <jo...@castleamber.com> wrote:
> Grant Edwards <inv...@invalid.invalid> writes:

>>>> Windows 7 has symbolic links?
>>>
>>> Symbolic links are designed to aid in migration and application
>>> compatibility with UNIX operating systems. Microsoft has implemented
>>> its symbolic links to function just like UNIX links.

>>
>> So symbolic links on W7 function like Unix (hard) links
>> rather than Unix _symbolic_ links??
>
> Which leads you to this conclusion?

The quote above that says that "symbolic links" on W7 function
just like "links" on Unix. A "link" on Unix is a hard link. I
presumed that if they meant "symbolic links" on Unix, they
would have said "symbolic links".


--
Grant Edwards grante Yow! What a COINCIDENCE!
at I'm an authorized "SNOOTS
visi.com OF THE STARS" dealer!!

Lawrence D'Oliveiro

unread,
Feb 22, 2010, 6:01:57 PM2/22/10
to
In message <mailman.60.12668544...@python.org>, MRAB wrote:

> Not Python-related.

Seems to be pretty common with Windows-related complaints in this group.

Lawrence D'Oliveiro

unread,
Feb 22, 2010, 6:06:36 PM2/22/10
to
In message <873a0ts...@castleamber.com>, John Bokma wrote:

> According to http://msdn.microsoft.com/en-us/library/aa365006(VS.85).aspx
>
> There are three types of file links supported in the NTFS file
> system: hard links, junctions, and symbolic links. This topic is an
> overview of hard links and junctions.

“Junctions” sound like Linux/Unix “mount points”, plus Linux-style “bind
mounts”. Except of course Dimdows puts it all into the NTFS-specific
implementation, instead of at the virtual filesystem layer. So whereas Linux
can handle these while letting you mix and match different filesystem types
(ext3, XFS, even FAT32, etc), Windows cannot.

W. eWatson

unread,
Feb 22, 2010, 8:25:30 PM2/22/10
to
So what's the bottom line? This link notion is completely at odds with
XP, and produces what I would call something of a mess to the unwary
Python/W7 user. Is there a simple solution?

How do I get out of this pickle? I just want to duplicate the program
in another folder, and not link to an ancestor.

David Robinow

unread,
Feb 22, 2010, 9:39:34 PM2/22/10
to W. eWatson, pytho...@python.org
On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson <wolft...@invalid.com> wrote:
> How do I get out of this pickle? I just want to duplicate the  program in
> another folder, and not link to an ancestor.
Ask in an appropriate forum. I'm not sure where that is but you might
try http://www.sevenforums.com/

W. eWatson

unread,
Feb 22, 2010, 11:06:30 PM2/22/10
to
Not in my NG list.

If the way this is going is that it occurs on W7, not just in my case,
then it will impact many Python users.

Alf P. Steinbach

unread,
Feb 22, 2010, 11:50:14 PM2/22/10
to
* W. eWatson:

> So what's the bottom line? This link notion is completely at odds with
> XP,

Well, Windows NT has always had *hardlinks*. <g>

I found it a bit baffling that that functionality is documented as not
implemented for Windows in the Python standard library.

But OK, it was non-trivial to do prior to Windows 2000; you had to sort of hack
it using the backup APIs since the functionality was not exposed through the
ordinary file APIs.

> and produces what I would call something of a mess to the unwary
> Python/W7 user. Is there a simple solution?
>
> How do I get out of this pickle? I just want to duplicate the program
> in another folder, and not link to an ancestor.

Copy and paste.


Cheers & hth.,

- Alf

W. eWatson

unread,
Feb 23, 2010, 12:05:28 AM2/23/10
to
I thought that's what I did. Is there some other way?

W. eWatson

unread,
Feb 23, 2010, 12:09:51 AM2/23/10
to
On 2/22/2010 8:50 PM, Alf P. Steinbach wrote:
Alf? Hello,Norway. My wife is Norwegian and that was her father's name.

I thought that's what I did. Is there some other way?

Tusin Tak (That's about the size of my vocabulary and spelling ability!
1000 thanks. What is the correct spelling?)

W. eWatson

unread,
Feb 23, 2010, 12:15:01 AM2/23/10
to
Maybe someone could verify my result?

open file
read file line
print line
close file

data 1234

Execute it in a folder

Create another folder and copy the program to it.
put in a new data file as

data 4567

Execute the copied program
Does it give
data1234?

Alf P. Steinbach

unread,
Feb 23, 2010, 1:00:48 AM2/23/10
to
* W. eWatson:

> On 2/22/2010 8:50 PM, Alf P. Steinbach wrote:
>> * W. eWatson:
>>> So what's the bottom line? This link notion is completely at odds with
>>> XP,
>>
>> Well, Windows NT has always had *hardlinks*. <g>
>>
>> I found it a bit baffling that that functionality is documented as not
>> implemented for Windows in the Python standard library.
>>
>> But OK, it was non-trivial to do prior to Windows 2000; you had to sort
>> of hack it using the backup APIs since the functionality was not exposed
>> through the ordinary file APIs.
>>
>>
>>
>>> and produces what I would call something of a mess to the unwary
>>> Python/W7 user. Is there a simple solution?
>>>
>>> How do I get out of this pickle? I just want to duplicate the program
>>> in another folder, and not link to an ancestor.
>>
>> Copy and paste.
>>
>>
>> Cheers & hth.,
>>
>> - Alf
> Alf? Hello,Norway. My wife is Norwegian and that was her father's name.
>
> I thought that's what I did. Is there some other way?

(A)
For using Explorer, see

<url: http://windows.microsoft.com/en-us/windows7/Copy-and-paste-a-file>

and in particular look at the tips at the bottom.

(B)
To get absolute control you can use the command interpreter. I don't have
Windows7 but googling yielded the following URL:

<url: http://www.sevenforums.com/tutorials/947-command-prompt.html>

The "copy" command there copies files.


> Tusin Tak (That's about the size of my vocabulary and spelling ability!
> 1000 thanks. What is the correct spelling?)

That's "tusen takk".

Jerry Hill

unread,
Feb 23, 2010, 9:34:00 AM2/23/10
to pytho...@python.org
On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson <wolft...@invalid.com> wrote:
> So what's the bottom line? This link notion is completely at odds with XP,
> and produces what I would call something of a mess to the unwary Python/W7
> user. Is there a simple solution?

I know people went off on a tangent talking about symbolic links and
hard links, but it is extremely unlikely that you created something
like that by accident. Windows just doesn't create those without you
doing quite a bit of extra work. It certainly doesn't create them
when you drag & drop files around through the normal interface.

> How do I get out of this pickle? I just want to duplicate the  program in
> another folder, and not link to an ancestor.

You need to dig into the technical details of what's happening on your
hard drive. You say you "copied a program from folder A to folder B".
Can you describe, exactly, what steps you took? What was the file
name of the program? Was it just one file, or a directory, or several
files? What was the path to directory A? What is the the path to
directory B? When you open a CMD window and do a dir of each
directory, what exactly do you see?

You've given a pretty non-technical description of the problem you're
experiencing. If you want more than wild speculation, you'll need to
give more specifics for people to help you with.

My wild guess: you held down control and shift while copying your
program. That's the keyboard command to create a shortcut instead of
moving or copying a file.

--
Jerry

chris grebeldinger

unread,
Feb 23, 2010, 1:49:59 PM2/23/10
to
Have you tried opening file explorer in administrative mode before
performing the copy? I think if there isn't sufficient permissions,
it does something weird like that.

Gib Bogle

unread,
Feb 23, 2010, 1:56:44 PM2/23/10
to

No

Michel Claveau - MVP

unread,
Feb 23, 2010, 3:35:53 PM2/23/10
to
Hi!

> Symbolic links are available in NTFS starting with Windows Vista.

No.
Hardlink come with NTFS, and already exists in W2K (and NT with specifics utilities).

@-salutations
--
Michel Claveau

bug...@sdlfkj.com

unread,
Feb 23, 2010, 4:11:52 PM2/23/10
to
"W. eWatson" <wolft...@invalid.com> writes:

> I noted that this search box has
> some sort of filter associated with it. Possibly, in my early stages
> of learning to navigate in Win7, I accidentally set the filter.
>
> Comments?

FYI, the only truly reliable and powerful file search utility I've found
for Windows is Agent Ransack (http://download.mythicsoft.com/agentran.exe)

Benjamin Kaplan

unread,
Feb 23, 2010, 4:40:10 PM2/23/10
to pytho...@python.org

And there's a difference between hard links and symbolic links.
Symbolic links were added to NTFS starting with Windows Vista.

http://msdn.microsoft.com/en-us/library/aa365680%28VS.85%29.aspx

> --
> http://mail.python.org/mailman/listinfo/python-list
>

Lie Ryan

unread,
Feb 23, 2010, 8:12:12 PM2/23/10
to

IMHO that doesn't justify.

The advice to move the discussion to a windows-specific group is not
just about reducing off-topic discussion[1], but because there isn't
that much Windows (Seven) users in this newsgroup. Most comp.lang.python
users either uses linux, unix, macs, or older version of windows, and
are not familiar with the specifics of Windows 7.

It would be nice though, if you reposted the solution you found from
another forum here to benefit other python Windows 7 users.

[1] pretty much anything computer-related is not entirely off-topic in
c.l.py because of the wide range of situations people uses python in
(I've seen general algorithmic questions, text-editor wars, problems
with 3rd party module, jython/ironpython internals, etc discussed in
here; many of those gets quite welcomed even though technically off-topic)

Steven D'Aprano

unread,
Feb 23, 2010, 8:31:47 PM2/23/10
to
On Tue, 23 Feb 2010 09:34:00 -0500, Jerry Hill wrote:

> On Mon, Feb 22, 2010 at 8:25 PM, W. eWatson <wolft...@invalid.com>
> wrote:
>> So what's the bottom line? This link notion is completely at odds with
>> XP, and produces what I would call something of a mess to the unwary
>> Python/W7 user. Is there a simple solution?
>
> I know people went off on a tangent talking about symbolic links and
> hard links, but it is extremely unlikely that you created something like
> that by accident. Windows just doesn't create those without you doing
> quite a bit of extra work. It certainly doesn't create them when you
> drag & drop files around through the normal interface.

I find it far more likely that Windows 7 makes it easy for the user to
accidentally produce links rather than copies, rather than that Python
suddenly has developed a bug where it opens a completely different file
to the one you ask for.

But more likely still is some confusion regarding paths.

--
Steven

Tim Roberts

unread,
Feb 25, 2010, 12:44:32 AM2/25/10
to
"W. eWatson" <wolft...@invalid.com> wrote:

No, of course not.

C:\tmp\x>echo data 1234>data.txt

C:\tmp\x>type check.py
f = open('data.txt','r')
print f.read()
f.close()

C:\tmp\x>check.py
data 1234

C:\tmp\x>cd ..\y

C:\tmp\y>echo data 4567>data.txt

C:\tmp\y>copy ..\x\check.py .
1 file(s) copied.

C:\tmp\y>check.py
data 4567

C:\tmp\y>

Would you like to post your exact code?
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

0 new messages