Python bug in Windows 8--report now, or later?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Python bug in Windows 8--report now, or later?

Kevin Walzer-5
I have been testing my Python application on the just-released developer
preview of Windows 8 and have noted an error: the application does not
create an app folder in the user's "application data" directory. This
causes the app to crash on startup. Manually creating the directory
solves the problem. Since the app uses an os.mkdir() call to create the
directory, and since the app runs fine on Windows 7, my guess is that
the bug lies somewhere in the interaction between Python (I'm using
ActivePython 2.7) and Windows.

Here's the relevant code:

     #make preferences directory if it does not exist
     def makePrefsDir(self):
         self.appdir = os.path.join(os.path.join(os.environ['APPDATA'],
'MyApp'))
         if not os.path.exists(self.appdir):
             os.mkdir(self.appdir)

I realize that this developer preview of Windows is still at somewhere
between alpha- and beta-level, and it's possible things will get better.
Should I wait to report this as a bug until Windows 8 is released, or do
the Python developers test Python on pre-release versions of Windows?
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Terry Reedy
On 9/17/2011 2:01 PM, Kevin Walzer wrote:
> I have been testing my Python application on the just-released developer
> preview of Windows 8 and have noted an error: the application does not
> create an app folder in the user's "application data" directory. This
> causes the app to crash on startup. Manually creating the directory
> solves the problem. Since the app uses an os.mkdir() call to create the
> directory, and since the app runs fine on Windows 7, my guess is that
> the bug lies somewhere in the interaction between Python (I'm using
> ActivePython 2.7) and Windows.

We need more that guesses to act. I think is premature to call this a
'Python bug'.

> Here's the relevant code:
>
> #make preferences directory if it does not exist
> def makePrefsDir(self):
> self.appdir = os.path.join(os.path.join(os.environ['APPDATA'], 'MyApp'))
> if not os.path.exists(self.appdir):
> os.mkdir(self.appdir)
>
> I realize that this developer preview of Windows is still at somewhere
> between alpha- and beta-level, and it's possible things will get better.
> Should I wait to report this as a bug until Windows 8 is released, or do
> the Python developers test Python on pre-release versions of Windows?

3 days ago (Sept 14) someone asked about 'Windows 8 support' on pydev
list. The answers were 1) 2.7 and 3.2 appear to run fine on the Dev
release (but there was no report of test suite results); 2) Python
directly uses so little of the Win interface that problems are not
anticipated; 3) applications might have to make Win 8 specific
adjustments and should test before the release.

Of course, if MS accidentally changes thinly wrapped system calls such
as os.environ, .exists, and .makedir, there will be a problem but that
is their bug. My impression is that they are not intentionally breaking
such things.

I anticipate 3.3 and some future 2.7.z will be officially supported (and
tested) on Win 8.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Chris Angelico
In reply to this post by Kevin Walzer-5
On Sun, Sep 18, 2011 at 4:01 AM, Kevin Walzer <[hidden email]> wrote:
> I realize that this developer preview of Windows is still at somewhere
> between alpha- and beta-level, and it's possible things will get better.
> Should I wait to report this as a bug until Windows 8 is released, or do the
> Python developers test Python on pre-release versions of Windows?

I would consider reporting it as a bug in Windows 8, not a bug in Python.

Chris Angelico
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

John Ladasky-2
In reply to this post by Kevin Walzer-5
On Sep 17, 2:20 pm, Chris Angelico <[hidden email]> wrote:

> I would consider reporting it as a bug in Windows 8, not a bug in Python.
>
> Chris Angelico

+1, beat me to it.  :^)
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Grant Edwards-7
In reply to this post by Kevin Walzer-5
On 2011-09-17, Chris Angelico <[hidden email]> wrote:

> I would consider reporting it as a bug in Windows 8, not a bug in <whatever>

Good luck with that plan.  ;)

[I don't know anything about this particular issue, but I do know that
when there is a bug in Windows, it's usually everyboyd else that has
to change to work around it.]


--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Westley Martínez
On Sun, Sep 18, 2011 at 04:15:57AM +0000, Grant Edwards wrote:

> On 2011-09-17, Chris Angelico <[hidden email]> wrote:
>
> > I would consider reporting it as a bug in Windows 8, not a bug in <whatever>
>
> Good luck with that plan.  ;)
>
> [I don't know anything about this particular issue, but I do know that
> when there is a bug in Windows, it's usually everyboyd else that has
> to change to work around it.]
>
>

Actually Microsoft usually goes out of its way to ensure backwards-
compatibily, even when the app developer is DOING IT WRONG.
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Alec Taylor
On Sun, Sep 18, 2011 at 2:40 PM, Westley Martínez <[hidden email]> wrote:

> On Sun, Sep 18, 2011 at 04:15:57AM +0000, Grant Edwards wrote:
>> On 2011-09-17, Chris Angelico <[hidden email]> wrote:
>>
>> > I would consider reporting it as a bug in Windows 8, not a bug in <whatever>
>>
>> Good luck with that plan.  ;)
>>
>> [I don't know anything about this particular issue, but I do know that
>> when there is a bug in Windows, it's usually everyboyd else that has
>> to change to work around it.]
>>
>>
>
> Actually Microsoft usually goes out of its way to ensure backwards-
> compatibily, even when the app developer is DOING IT WRONG.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

For those interested, Windows 8 is available here:
http://msdn.microsoft.com/windows/apps/br229516/
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

briancurtin
In reply to this post by Kevin Walzer-5
On Sat, Sep 17, 2011 at 13:01, Kevin Walzer <[hidden email]> wrote:

> I have been testing my Python application on the just-released developer
> preview of Windows 8 and have noted an error: the application does not
> create an app folder in the user's "application data" directory. This causes
> the app to crash on startup. Manually creating the directory solves the
> problem. Since the app uses an os.mkdir() call to create the directory, and
> since the app runs fine on Windows 7, my guess is that the bug lies
> somewhere in the interaction between Python (I'm using ActivePython 2.7) and
> Windows.
>
> Here's the relevant code:
>
>    #make preferences directory if it does not exist
>    def makePrefsDir(self):
>        self.appdir = os.path.join(os.path.join(os.environ['APPDATA'],
> 'MyApp'))
>        if not os.path.exists(self.appdir):
>            os.mkdir(self.appdir)
>
> I realize that this developer preview of Windows is still at somewhere
> between alpha- and beta-level, and it's possible things will get better.
> Should I wait to report this as a bug until Windows 8 is released, or do the
> Python developers test Python on pre-release versions of Windows?

First, is your application actually crashing, or does it just exit due
to an unhandled exception? I suspect the latter, so if that's true,
what's the exception and message?

You said "the application does not create an app folder in the user's
'application data' directory" -- what does this mean, or rather, what
is the specific folder you're expecting to have? If Python can't
create the directory but you can do it manually, there may be some
permission or access differences new to Windows 8. What does "echo
%APPDATA%" give you?

I haven't installed Windows 8 yet, but I'm planning to get it up and
running soon. If you submit issues to http://bugs.python.org,
hopefully with specific test cases that we can run and work with,
it'll be easier to track and fix. If you do that, add me to the nosy
list on the issues - tracker id: brian.curtin, I'm one of the Windows
people around there.
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Andrew Berg-4
On 2011.09.19 09:00 AM, Brian Curtin wrote:
> You said "the application does not create an app folder in the user's
> 'application data' directory" -- what does this mean, or rather, what
> is the specific folder you're expecting to have? If Python can't
> create the directory but you can do it manually, there may be some
> permission or access differences new to Windows 8. What does "echo
> %APPDATA%" give you?
I booted up the Win8 dev preview in a VM and os.environ['appdata'] gives
me the same result it would for Windows 7. Perhaps the problem lies in
the os.path.exists() call (that is, Win8 and Win7 react differently to
this call). I personally would try to create the directory and then
catch either a WindowsError (error 183) or an OSError (error 17) if the
directory already exists. I might play around with this later and post
some results.

--
CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 6.0.2
PGP/GPG Public Key ID: 0xF88E034060A78FCB
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Alec Taylor
I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work
on Windows 8 Dev x64.

On Tue, Sep 20, 2011 at 6:40 AM, Andrew Berg <[hidden email]> wrote:

> On 2011.09.19 09:00 AM, Brian Curtin wrote:
>> You said "the application does not create an app folder in the user's
>> 'application data' directory" -- what does this mean, or rather, what
>> is the specific folder you're expecting to have? If Python can't
>> create the directory but you can do it manually, there may be some
>> permission or access differences new to Windows 8. What does "echo
>> %APPDATA%" give you?
> I booted up the Win8 dev preview in a VM and os.environ['appdata'] gives
> me the same result it would for Windows 7. Perhaps the problem lies in
> the os.path.exists() call (that is, Win8 and Win7 react differently to
> this call). I personally would try to create the directory and then
> catch either a WindowsError (error 183) or an OSError (error 17) if the
> directory already exists. I might play around with this later and post
> some results.
>
> --
> CPython 3.2.2 | Windows NT 6.1.7601.17640 | Thunderbird 6.0.2
> PGP/GPG Public Key ID: 0xF88E034060A78FCB
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list
Reply | Threaded
Open this post in threaded view
|

Re: Python bug in Windows 8--report now, or later?

Kevin Walzer-5
In reply to this post by Andrew Berg-4
On 9/20/11 8:32 AM, Alec Taylor wrote:
> I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work
> on Windows 8 Dev x64.

OK--looks like I will need to do a bit more digging into my own code.
Thanks for clarifying.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
--
http://mail.python.org/mailman/listinfo/python-list