Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Weatherby,Gerard
“So the case where the assumption fails may not be easily
reproducable and the more information you can get post-mortem the
better”

That’s true for rare corner cases or esoteric race conditions. Usually, when I 
see asserts it's just because I was just plain stupid.

From: Python-list  on 
behalf of Peter J. Holzer 
Date: Saturday, February 25, 2023 at 5:21 PM
To: python-list@python.org 
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) 
values are ?
On 2023-02-25 21:58:18 +, Weatherby,Gerard wrote:
> I only use asserts for things I know to be true.

Yeah, that's what assers are for. Or rather for things that you *think*
are true.

> In other words, a failing assert means I have a hole in my program
> logic.

Yes, if you include your assumptions in your definition of "logic".


> For that use, the default behavior –telling me which line the assert
> is on, is more than sufficient. Depending on the circumstance, I’ll
> re-run the code with a breakpoint or replace the assert with an
> informative f-string Exception.

That may not always be practical. Things that we know (or think) are
true often have *are* true in most cases (otherwise we wouldn't think
so). So the case where the assumption fails may not be easily
reproducable and the more information you can get post-mortem the
better. For example, in C on Linux a failed assertion causes a core
dump. So you can inspect the complete state of the program.

hp

--
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 21:58:18 +, Weatherby,Gerard wrote:
> I only use asserts for things I know to be true.

Yeah, that's what assers are for. Or rather for things that you *think*
are true.

> In other words, a failing assert means I have a hole in my program
> logic.

Yes, if you include your assumptions in your definition of "logic".


> For that use, the default behavior –telling me which line the assert
> is on, is more than sufficient. Depending on the circumstance, I’ll
> re-run the code with a breakpoint or replace the assert with an
> informative f-string Exception.

That may not always be practical. Things that we know (or think) are
true often have *are* true in most cases (otherwise we wouldn't think
so). So the case where the assumption fails may not be easily
reproducable and the more information you can get post-mortem the
better. For example, in C on Linux a failed assertion causes a core
dump. So you can inspect the complete state of the program.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Weatherby,Gerard
I only use asserts for things I know to be true. Nothing is harder to debug 
than when something you know to be true turns out to be… not True. Because I’ll 
check everything else instead of the cause of the bug.

In other words, a failing assert means I have a hole in my program logic.

For that use, the default behavior –telling me which line the assert is on, is 
more than sufficient. Depending on the circumstance, I’ll re-run the code with 
a breakpoint or replace the assert with an informative f-string Exception.



From: Python-list  on 
behalf of Peter J. Holzer 
Date: Saturday, February 25, 2023 at 9:22 AM
To: python-list@python.org 
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) 
values are ?
On 2023-02-25 09:10:06 -0500, Thomas Passin wrote:
> On 2/25/2023 1:13 AM, Peter J. Holzer wrote:
> > On 2023-02-24 18:19:52 -0500, Thomas Passin wrote:
> > > Sometimes you can use a second parameter to assert if you know what kind 
> > > of
> > > error to expect:
[...]
> > > With type errors, assert may actually give you the information needed:
> > >
> > > > > > c = {"a": a, "b": 2}
> > > > > > assert a > c
> > > Traceback (most recent call last):
> > >File "", line 1, in 
> > > TypeError: '>' not supported between instances of 'list' and 'dict'
> >
> > Actually in this case it isn't assert which gives you the information,
> > it's evaluating the expression itself. You get the same error with just
> >  a > c
> > on a line by its own.
>
> In some cases.  For my example with an explanatory string, you wouldn't want
> to write code like that after an ordinary line of code, at least not very
> often.  The assert statement allows it syntactically.

Yes, but if an error in the expression triggers an exception (as in this
case) the explanatory string will never be displayed.

hp

--
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Peter J. Holzer
On 2023-02-25 09:10:06 -0500, Thomas Passin wrote:
> On 2/25/2023 1:13 AM, Peter J. Holzer wrote:
> > On 2023-02-24 18:19:52 -0500, Thomas Passin wrote:
> > > Sometimes you can use a second parameter to assert if you know what kind 
> > > of
> > > error to expect:
[...]
> > > With type errors, assert may actually give you the information needed:
> > > 
> > > > > > c = {"a": a, "b": 2}
> > > > > > assert a > c
> > > Traceback (most recent call last):
> > >File "", line 1, in 
> > > TypeError: '>' not supported between instances of 'list' and 'dict'
> > 
> > Actually in this case it isn't assert which gives you the information,
> > it's evaluating the expression itself. You get the same error with just
> >  a > c
> > on a line by its own.
> 
> In some cases.  For my example with an explanatory string, you wouldn't want
> to write code like that after an ordinary line of code, at least not very
> often.  The assert statement allows it syntactically.

Yes, but if an error in the expression triggers an exception (as in this
case) the explanatory string will never be displayed.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-25 Thread Thomas Passin

On 2/25/2023 1:13 AM, Peter J. Holzer wrote:

On 2023-02-24 18:19:52 -0500, Thomas Passin wrote:

On 2/24/2023 2:47 PM, dn via Python-list wrote:

On 25/02/2023 08.12, Peter J. Holzer wrote:

On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:

In some ways, providing this information seems appropriate.
Curiously, this does not even occur during an assert exception -
despite the value/relationship being the whole point of using
the command!

  x = 1
  assert x == 2

AssertionError (and that's it)


Sometimes you can use a second parameter to assert if you know what kind of
error to expect:


a = [1,2,3]
b = [4,5]
assert len(a) == len(b), f'len(a): {len(a)} != len(b): {len(b)}'

Traceback (most recent call last):
   File "", line 1, in 
AssertionError: len(a): 3 != len(b): 2


Yup. That's very useful (but I tend to forget that).



With type errors, assert may actually give you the information needed:


c = {"a": a, "b": 2}
assert a > c

Traceback (most recent call last):
   File "", line 1, in 
TypeError: '>' not supported between instances of 'list' and 'dict'


Actually in this case it isn't assert which gives you the information,
it's evaluating the expression itself. You get the same error with just
 a > c
on a line by its own.


In some cases.  For my example with an explanatory string, you wouldn't 
want to write code like that after an ordinary line of code, at least 
not very often.  The assert statement allows it syntactically.


--
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-24 18:19:52 -0500, Thomas Passin wrote:
> On 2/24/2023 2:47 PM, dn via Python-list wrote:
> > On 25/02/2023 08.12, Peter J. Holzer wrote:
> > > On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:
> > > > In some ways, providing this information seems appropriate.
> > > > Curiously, this does not even occur during an assert exception -
> > > > despite the value/relationship being the whole point of using
> > > > the command!
> > > > 
> > > >  x = 1
> > > >  assert x == 2
> > > > 
> > > > AssertionError (and that's it)
> 
> Sometimes you can use a second parameter to assert if you know what kind of
> error to expect:
> 
> >>> a = [1,2,3]
> >>> b = [4,5]
> >>> assert len(a) == len(b), f'len(a): {len(a)} != len(b): {len(b)}'
> Traceback (most recent call last):
>   File "", line 1, in 
> AssertionError: len(a): 3 != len(b): 2

Yup. That's very useful (but I tend to forget that).


> With type errors, assert may actually give you the information needed:
> 
> >>> c = {"a": a, "b": 2}
> >>> assert a > c
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: '>' not supported between instances of 'list' and 'dict'

Actually in this case it isn't assert which gives you the information,
it's evaluating the expression itself. You get the same error with just
a > c
on a line by its own.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Thomas Passin

On 2/24/2023 2:47 PM, dn via Python-list wrote:

On 25/02/2023 08.12, Peter J. Holzer wrote:

On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:
In some ways, providing this information seems appropriate. 
Curiously, this

does not even occur during an assert exception - despite the
value/relationship being the whole point of using the command!

 x = 1
 assert x == 2

AssertionError (and that's it)


Sometimes you can use a second parameter to assert if you know what kind 
of error to expect:


>>> a = [1,2,3]
>>> b = [4,5]
>>> assert len(a) == len(b), f'len(a): {len(a)} != len(b): {len(b)}'
Traceback (most recent call last):
  File "", line 1, in 
AssertionError: len(a): 3 != len(b): 2

With type errors, assert may actually give you the information needed:

>>> c = {"a": a, "b": 2}
>>> assert a > c
Traceback (most recent call last):
  File "", line 1, in 
TypeError: '>' not supported between instances of 'list' and 'dict'

So now we know that a is a list and c is a dictionary.


Pytest is great there. If an assertion in a test case fails it analyzes
the expression to give you various levels of details:

 test session starts 


platform linux -- Python 3.10.6, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /home/hjp/tmp/t
plugins: cov-3.0.0, anyio-3.6.1
collected 1 item

test_a.py 
F   [100%]


= FAILURES 
==
__ test_a 
___


 def test_a():
 a = [1, 2, 3]
 b = {"a": a, "b": 2}


   assert len(a) == len(b)

E   AssertionError: assert 3 == 2
E    +  where 3 = len([1, 2, 3])
E    +  and   2 = len({'a': [1, 2, 3], 'b': 2})

test_a.py:7: AssertionError
== short test summary info 
==

FAILED test_a.py::test_a - AssertionError: assert 3 == 2
= 1 failed in 0.09s 
=


+1
and hence the tone of slight surprise in the observation - because only 
ever use assert within pytests, and as observed, pytest amplifies the 
report-back to provide actionable-intelligence. See also: earlier 
contribution about using a debugger.



That said, have observed coders 'graduating' from other languages, 
making wider use of assert - assumed to be more data (value) 
sanity-checks than typing, but ...


Do you use assert frequently?


The OP seems wedded to his?her ways, complaining that Python does not 
work the way it 'should'. In turn, gives rise to the impression that 
expounding the advantages of TDD, and thus anticipating such unit and 
integration error-possibilities, might be considered an insult or 
unhelpful.

(sigh!)

Personally, I struggled a bit to adapt from the more-strictured (if not 
more-structured) languages of my past, to Python - particularly the 
different philosophies or emphases of what happens at 'compile-time' cf 
'execution-time'; and how such required marked changes in attitudes to 
design, time-allocation, work-flow, and tool-set. Two related-activities 
which made the language-change more workable and unleashed greater than 
step-change advantage, were: increased use of TDD, and actively learning 
the facilities within Python-oriented IDEs.




--
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-25 08:47:00 +1300, dn via Python-list wrote:
> That said, have observed coders 'graduating' from other languages, making
> wider use of assert - assumed to be more data (value) sanity-checks than
> typing, but ...
> 
> Do you use assert frequently?

Not very often, but I do use it. Sometimes for its intended purpose
(i.e. to guard against bugs or wrong assumptions), sometimes just to
guard incomplete or sloppy code (e.g. browsing through some projects I
find
assert len(data["structure"]["dimensions"]["observation"]) == 1
(incomplete code - I didn't bother to implement multiple observations)
and
assert(header[0] == "Monat (MM)")
(the code below is sloppy. Instead of fixing it I just made the original
programmer's assumptions explicit)
and of course
assert False
(this point should never be reached)).

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread dn via Python-list

On 25/02/2023 08.12, Peter J. Holzer wrote:

On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:

In some ways, providing this information seems appropriate. Curiously, this
does not even occur during an assert exception - despite the
value/relationship being the whole point of using the command!

 x = 1
 assert x == 2

AssertionError (and that's it)


Pytest is great there. If an assertion in a test case fails it analyzes
the expression to give you various levels of details:

 test session starts 

platform linux -- Python 3.10.6, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /home/hjp/tmp/t
plugins: cov-3.0.0, anyio-3.6.1
collected 1 item

test_a.py F 
  [100%]

= FAILURES 
==
__ test_a 
___

 def test_a():
 a = [1, 2, 3]
 b = {"a": a, "b": 2}


   assert len(a) == len(b)

E   AssertionError: assert 3 == 2
E+  where 3 = len([1, 2, 3])
E+  and   2 = len({'a': [1, 2, 3], 'b': 2})

test_a.py:7: AssertionError
== short test summary info 
==
FAILED test_a.py::test_a - AssertionError: assert 3 == 2
= 1 failed in 0.09s 
=


+1
and hence the tone of slight surprise in the observation - because only 
ever use assert within pytests, and as observed, pytest amplifies the 
report-back to provide actionable-intelligence. See also: earlier 
contribution about using a debugger.



That said, have observed coders 'graduating' from other languages, 
making wider use of assert - assumed to be more data (value) 
sanity-checks than typing, but ...


Do you use assert frequently?


The OP seems wedded to his?her ways, complaining that Python does not 
work the way it 'should'. In turn, gives rise to the impression that 
expounding the advantages of TDD, and thus anticipating such unit and 
integration error-possibilities, might be considered an insult or unhelpful.

(sigh!)

Personally, I struggled a bit to adapt from the more-strictured (if not 
more-structured) languages of my past, to Python - particularly the 
different philosophies or emphases of what happens at 'compile-time' cf 
'execution-time'; and how such required marked changes in attitudes to 
design, time-allocation, work-flow, and tool-set. Two related-activities 
which made the language-change more workable and unleashed greater than 
step-change advantage, were: increased use of TDD, and actively learning 
the facilities within Python-oriented IDEs.


--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:
> In some ways, providing this information seems appropriate. Curiously, this
> does not even occur during an assert exception - despite the
> value/relationship being the whole point of using the command!
> 
> x = 1
> assert x == 2
> 
> AssertionError (and that's it)

Pytest is great there. If an assertion in a test case fails it analyzes
the expression to give you various levels of details:

 test session starts 

platform linux -- Python 3.10.6, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /home/hjp/tmp/t
plugins: cov-3.0.0, anyio-3.6.1
collected 1 item

test_a.py F 
  [100%]

= FAILURES 
==
__ test_a 
___

def test_a():
a = [1, 2, 3]
b = {"a": a, "b": 2}

>   assert len(a) == len(b)
E   AssertionError: assert 3 == 2
E+  where 3 = len([1, 2, 3])
E+  and   2 = len({'a': [1, 2, 3], 'b': 2})

test_a.py:7: AssertionError
== short test summary info 
==
FAILED test_a.py::test_a - AssertionError: assert 3 == 2
= 1 failed in 0.09s 
=

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-23 20:32:26 -0700, Michael Torrie wrote:
> On 2/23/23 01:08, Hen Hanna wrote:
> >  Python VM  is seeing an "int" object (123)   (and telling me that)
> >  ...   so it should be easy to print that "int" object What does
> >  Python VMknow ?   and when does it know it ?
> It knows there is an object and its name and type.  It knows this from
> the first moment you create the object and bind a name to it.
> > it seems like  it is being playful, teasing (or mean),and
> > hiding  the ball from me
> 
> Sorry you aren't understanding.  Whenever you print() out an object,
> python calls the object's __repr__() method to generate the string to
> display.  For built-in objects this is obviously trivial. But if you
> were dealing an object of some arbitrary class, there may not be a
> __repr__() method

Is this even possible? object has a __repr__ method, so all other
classes would inherit that if they don't define one themselves. I guess
it's possible to explicitely remove it ...

> which would cause an exception, or if the __repr__()
> method itself raised an exception,

Yup. That is possible and has happened to me several times - of course
always in a situation where I really needed that output ...

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-22 15:46:09 -0800, Hen Hanna wrote:
> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote:
> > > py bug.py 
> > Traceback (most recent call last): 
> > File "C:\Usenet\bug.py", line 5, in  
> > print( a + 12 ) 
> > TypeError: can only concatenate str (not "int") to str 
> > 
> > 
> > Why doesn't Python (error msg) do the obvious thing and tell me 
> > WHAT the actual (offending, arg) values are ? 
> > 
> > In many cases, it'd help to know what string the var A had , when the error 
> > occurred. 
> >  i wouldn't have to put print(a) just above, to see. 
> > 
> > ( pypy doesn't do that either, but Python makes programming
> > (debugging) so easy that i hardly feel any inconvenience.)

That seems like a non-sequitur to me. If you hardly feel any
inconvenience, why argue so forcefully?
And why is pypy relevant here?


> i  see that my example   would be clearER  with this one-line  change:
> 
> 
>   >  py   bug.py
> 
>Traceback (most recent call last):
> 
>   File "C:\Usenet\bug.py", line 5, in 
>  map( Func,fooBar(  X,  Y,  X +  
> Y  ))
>  
>TypeError: can only concatenate str (not "int") to str
> 
> 
> i hope that   NOW   a few of you  can  see this as a genuine,  (reasonable)  
> question.

That doesn't seem a better example to me. There is still only one
subexpression (X + Y) where that error can come from, so I know that X
is a str and Y is an int.

A better example would be something like 

x = (a + b) * (c + d)

In this case it could be either (a + b) or (c + d) which caused the
error. But what I really want to know here is the names of the involved
variables, NOT the values. If the error message told me that the values
were 'foo' and 12.3, I still wouldn't be any wiser. The problem here of
course is that the operands aren't necessarily simple variables as in
this example - they may be arbitrarily complex expressions. However, it
might be sufficient to mark the operator which caused the exception:

|   ...
|   File "/home/hjp/tmp/./foo", line 4, in f
| return (a + b) * (c + d)
| ^
| TypeError: can only concatenate str (not "int") to str

would tell me that (c + d) caused the problem and therefore that c must
be a str which it obviously shouldn't be.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread avi.e.gross
We have been supplying many possible reasons or consequences for why the
implementation of python does not do what the OP wants and even DEMANDS.

I am satisfied with knowing it was because they CHOSE NOT TO in some places
and maybe not in others. It is nice to see some possible reasons, but
something as simple as efficiency or needing to complicate the code in
something used regularly, might be enough for now.

But to comment on what Michael T. and Dave N. have been saying, newcomers
often have no clue of what can happen so their questions may sound quite
reasonable.

So what happens if you create a large data structure, so some operation that
fails, catch the error and save the variables involved in an exception and
throw that onward and perhaps the program keeps running? There is now a
pointer to the large data structure in the exception object, or even a copy.
If that exception is not discarded or garbage collected, it can remain in
memory indefinitely even if the original string was expected to be removed,
replaced, or garbage collected. Some modern features in R such as generators
will stay alive infinitely and retain their state in between calls for a
next item.

You can end up with memory leaks that are not trivial to solve or that may
mysteriously disappear when an iterable has finally been consumed and all
the storage it used or pointed at can be retrieved, as one example.

A more rational approach is to realize that python has multiple levels of
debugging and exceptions are one among many. They are not meant to solve the
entire problem but just enough to be helpful or point you in some direction.
Yes, they can do more.

And, FYI, I too pointed this person at the Tutor list and I see no sign they
care how many people they make waste their time with so many mainly gripes.
I personally now ignore any post by them.
-Original Message-
From: Python-list  On
Behalf Of Michael Torrie
Sent: Thursday, February 23, 2023 10:32 PM
To: python-list@python.org
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg)
values are ?

On 2/23/23 01:08, Hen Hanna wrote:
>  Python VM  is seeing an "int" object (123)   (and telling me that)   ...
so it should be easy to print that "int" object 
> What does  Python VMknow ?   and when does it know it ?
It knows there is an object and its name and type.  It knows this from the
first moment you create the object and bind a name to it.
> it seems like  it is being playful, teasing (or mean),and   hiding
the ball from me

Sorry you aren't understanding.  Whenever you print() out an object, python
calls the object's __repr__() method to generate the string to display.  For
built-in objects this is obviously trivial. But if you were dealing an
object of some arbitrary class, there may not be a
__repr__() method which would cause an exception, or if the __repr__()
method itself raised an exception, you'd lose the original error message and
the stack trace would be all messed up and of no value to you.  Does that
make sense?  Remember that Python is a very dynamic language and what might
be common sense for a built-in type makes no sense at all for a custom type.
Thus there's no consistent way for Python to print out the information you
think is so simple.
--
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread Michael Torrie
On 2/23/23 01:08, Hen Hanna wrote:
>  Python VM  is seeing an "int" object (123)   (and telling me that)   ...   
> so it should be easy to print that "int" object 
> What does  Python VMknow ?   and when does it know it ?
It knows there is an object and its name and type.  It knows this from
the first moment you create the object and bind a name to it.
> it seems like  it is being playful, teasing (or mean),and   hiding  the 
> ball from me

Sorry you aren't understanding.  Whenever you print() out an object,
python calls the object's __repr__() method to generate the string to
display.  For built-in objects this is obviously trivial. But if you
were dealing an object of some arbitrary class, there may not be a
__repr__() method which would cause an exception, or if the __repr__()
method itself raised an exception, you'd lose the original error message
and the stack trace would be all messed up and of no value to you.  Does
that make sense?  Remember that Python is a very dynamic language and
what might be common sense for a built-in type makes no sense at all for
a custom type.  Thus there's no consistent way for Python to print out
the information you think is so simple.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread dn via Python-list

On 23/02/2023 09.05, Hen Hanna wrote:


   >  py   bug.py
Traceback (most recent call last):
  File "C:\Usenet\bug.py", line 5, in 
  print( a + 12 )
   TypeError: can only concatenate str (not "int") to str


Why doesn't  Python (error msg) do the obvious thing and tell me
 WHAT   the actual   (offending,  arg)  values are ?

In many cases, it'd help to know what string the var  A  had  ,   when the 
error occurred.
    i wouldn't have to put  print(a) just 
above,  to see.


In some ways, providing this information seems appropriate. Curiously, 
this does not even occur during an assert exception - despite the 
value/relationship being the whole point of using the command!


x = 1
assert x == 2

AssertionError (and that's it)

Then again, remember that exceptions can be 'caught'. So, such data 
would need to be added to the exception-instance. This could become 
quite costly.




What are the appropriate tools for the job?


Don't add an extra print(), use a debugger.

Not only does this allow you to breakpoint critical points in the code, 
but identifiers can be watch-ed and changes noted. The other handy 
feature is being able to correct the current erroneous value of the 
identifier and continue execution.


For us, memory-challenged coders, there is no need to remember to remove 
the print() again, afterwards.



The TypeError indicates a problem between the programmer's ears. What 
was thought to be a string or an integer was the opposite. This seems to 
be playing fast-and-loose with Python's dynamic-typing. To quote: "we're 
all adults here". Thus, I wouldn't recommend 're-cycling' an identifier 
to represent two different (types of) data-point in the same code - but 
there's nothing to stop you/anyone!


The other possibility is that it was an accident. Sounds more like 
something I would do, but... In this case, the tool which is your/my 
friend is typing. The IDE should catch most of the situations where an 
int would be used as an str, or v-v. Remember though, Python's typing is 
(a) not part of the language, and (b) probably won't help at run-time.



PS are you aware that there is a Python-Tutor list for the use of people 
learning Python?

--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list


RE: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread avi.e.gross
or but a
temporary drawback. Only when int fails too is there a likely error but int
is not programmed to do anything lie reporting in __iadd__() and nor should
it except if you are debugging new functionality.

Can we get better error messages in many cases? Sure. Clearly the
interpreter level sees a call like func(x, y, x+y) and if evaluating it
causes an error, it could type out what all the variables were. 

But if you are running code at the console and it aborts like this, you
usually have the variables at your fingertips and can say print(x) or
print(y) but you cannot properly say print(x+y) yet. The error message did
specify you were trying to work with incompatible objects as one was of type
this and the other of type that. That suggests the values of both could have
been accessed and shown in this case ad perhaps the code could be modified
so it returns some semblance of the values at least for built-in objects.
All that though adds code and complexity and often slows things down. 



-Original Message-
From: Python-list  On
Behalf Of Rob Cliffe via Python-list
Sent: Wednesday, February 22, 2023 4:31 PM
To: python-list@python.org
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg)
values are ?



On 22/02/2023 20:05, Hen Hanna wrote:
> Python makes programming (debugging) so easy
I agree with that!
Rob Cliffe
-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread Rob Cliffe via Python-list




On 22/02/2023 20:05, Hen Hanna wrote:

Python makes programming (debugging) so easy

I agree with that!
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread Hen Hanna
On Wednesday, February 22, 2023 at 11:57:45 PM UTC-8, Barry wrote:
> > On 23 Feb 2023, at 01:39, Hen Hanna  wrote:
> > 
> > On Wednesday, February 22, 2023 at 3:46:21 PM UTC-8, Hen Hanna wrote: 
> >> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote: 
> >>>> py bug.py 
> >>> Traceback (most recent call last): 
> >>> File "C:\Usenet\bug.py", line 5, in  
> >>> print( a + 12 ) 
> >>> TypeError: can only concatenate str (not "int") to str 
> >>> 
> >>> 
> >>> Why doesn't Python (error msg) do the obvious thing and tell me 
> >>> WHAT the actual (offending, arg) values are ? 
> >>> 
> >>> In many cases, it'd help to know what string the var A had , when the 
> >>> error occurred. 
> >>>  i wouldn't have to put print(a) just above, to see. 
> >>> 
> >>> 
> >>> 
> >>> 
> >>> ( pypy doesn't do that either, but Python makes programming (debugging) 
> >>> so easy that i hardly feel any inconvenience.) 
> > 
> > 
> > i see that my example would be (even) clearER with this one-line change: 
> > 
> > py bug.py 
> > 
> > Traceback (most recent call last): 
> > 
> > File "C:\Usenet\bug.py", line 5, in  
> > map( Func, fooBar( X, Y, X + Y )) 
> > 
> > TypeError: can only concatenate str (not "int") to str 
> >   attempt to call +  with   'abc',  123 
> >   <-- 
> > 
> >> i hope that NOW a few of you can see this as a genuine, (reasonable) 
> >> question. 
> > 
> > Python seems so perfectly User-friendly that 
> > i 'm so curious (puzzled) that it doesn't do the very obvious and easy 
> > thing 
> > of giving me this info: 
> > 
> > attempt to call +with   'abc',   
> > 123 <--

> It is not easy to do that in a robust and reliable way for any object. 
> You can end up in the code to generate the error message itself breaking. 
> For example using unbounded CPU time when attempting to get the string repr 
> of the variable. 
> 
> Barry 
> 


 Python VM  is seeing an "int" object (123)   (and telling me that)   ...   so 
it should be easy to print that "int" object 


What does  Python VMknow ?   and when does it know it ?


it seems like  it is being playful, teasing (or mean),and   hiding  the 
ball from me
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-23 Thread Barry


> On 23 Feb 2023, at 01:39, Hen Hanna  wrote:
> 
> On Wednesday, February 22, 2023 at 3:46:21 PM UTC-8, Hen Hanna wrote:
>> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote: 
>>>> py bug.py 
>>> Traceback (most recent call last): 
>>> File "C:\Usenet\bug.py", line 5, in  
>>> print( a + 12 ) 
>>> TypeError: can only concatenate str (not "int") to str 
>>> 
>>> 
>>> Why doesn't Python (error msg) do the obvious thing and tell me 
>>> WHAT the actual (offending, arg) values are ? 
>>> 
>>> In many cases, it'd help to know what string the var A had , when the error 
>>> occurred. 
>>>  i wouldn't have to put print(a) just above, to see. 
>>> 
>>> 
>>> 
>>> 
>>> ( pypy doesn't do that either, but Python makes programming (debugging) so 
>>> easy that i hardly feel any inconvenience.)
> 
> 
> i see that my example would be (even)  clearER with this one-line change:
> 
>   py bug.py 
> 
> Traceback (most recent call last): 
> 
>   File "C:\Usenet\bug.py", line 5, in 
> map( Func, fooBar( X, Y, X + Y ))
> 
> TypeError: can only concatenate str (not "int") to str
>attempt to call +  with  'abc'  ,   123.45  
> <--
> 
>> i hope that NOW a few of you can see this as a genuine, (reasonable) 
>> question.
> 
> Python  seems so perfectly  User-friendly that
>   i 'm  so curious (puzzled)  that it doesn't do the very  
> obvious and easy thing 
> of giving me this info:
> 
>attempt to call  + with  'abc'  ,   
> 123.45  <--

It is not easy to do that in a robust and reliable way for any object.
You can end up in the code to generate the error message itself breaking.
For example using unbounded CPU time when attempting to get the string repr of 
the variable.

Barry

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

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Hen Hanna
On Wednesday, February 22, 2023 at 3:46:21 PM UTC-8, Hen Hanna wrote:
> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote: 
> > > py bug.py 
> > Traceback (most recent call last): 
> > File "C:\Usenet\bug.py", line 5, in  
> > print( a + 12 ) 
> > TypeError: can only concatenate str (not "int") to str 
> > 
> > 
> > Why doesn't Python (error msg) do the obvious thing and tell me 
> > WHAT the actual (offending, arg) values are ? 
> > 
> > In many cases, it'd help to know what string the var A had , when the error 
> > occurred. 
> >  i wouldn't have to put print(a) just above, to see. 
> > 
> > 
> > 
> > 
> > ( pypy doesn't do that either, but Python makes programming (debugging) so 
> > easy that i hardly feel any inconvenience.)


 i see that my example would be (even)  clearER with this one-line change:

   py bug.py 
   
 Traceback (most recent call last): 
  
   File "C:\Usenet\bug.py", line 5, in 
 map( Func, fooBar( X, Y, X + Y ))

 TypeError: can only concatenate str (not "int") to str
attempt to call +  with  'abc'  ,   123.45  
<--

> i hope that NOW a few of you can see this as a genuine, (reasonable) question.

Python  seems so perfectly  User-friendly that
   i 'm  so curious (puzzled)  that it doesn't do the very  
obvious and easy thing 
 of giving me this info:

attempt to call  + with  'abc'  ,   
123.45  <--
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Thomas Passin

On 2/22/2023 6:46 PM, Hen Hanna wrote:

On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote:

py bug.py

Traceback (most recent call last):
File "C:\Usenet\bug.py", line 5, in 
print( a + 12 )
TypeError: can only concatenate str (not "int") to str


Why doesn't Python (error msg) do the obvious thing and tell me
WHAT the actual (offending, arg) values are ?

In many cases, it'd help to know what string the var A had , when the error 
occurred.
 i wouldn't have to put print(a) just above, to see.




( pypy doesn't do that either, but Python makes programming (debugging) so easy 
that i hardly feel any inconvenience.)




i  see that my example   would be clearER  with this one-line  change:


   >  py   bug.py

Traceback (most recent call last):

   File "C:\Usenet\bug.py", line 5, in 
  map( Func,fooBar(  X,  Y,  X +  Y 
 ))
  
TypeError: can only concatenate str (not "int") to str



i hope that   NOW   a few of you  can  see this as a genuine,  (reasonable)  
question.


It tells me to go look at the function definition and how it's being 
invoked.  Even if I knew which of (X, Y) was an int and which a str, I'd 
still need to do that.


Or you could add type annotations to your code and run mypy on it...


--
https://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Hen Hanna
On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote:
> > py bug.py 
> Traceback (most recent call last): 
> File "C:\Usenet\bug.py", line 5, in  
> print( a + 12 ) 
> TypeError: can only concatenate str (not "int") to str 
> 
> 
> Why doesn't Python (error msg) do the obvious thing and tell me 
> WHAT the actual (offending, arg) values are ? 
> 
> In many cases, it'd help to know what string the var A had , when the error 
> occurred. 
>  i wouldn't have to put print(a) just above, to see. 
> 
> 
> 
> 
> ( pypy doesn't do that either, but Python makes programming (debugging) so 
> easy that i hardly feel any inconvenience.)



i  see that my example   would be clearER  with this one-line  change:


  >  py   bug.py

   Traceback (most recent call last):

  File "C:\Usenet\bug.py", line 5, in 
 map( Func,fooBar(  X,  Y,  X +  Y  
))
 
   TypeError: can only concatenate str (not "int") to str


i hope that   NOW   a few of you  can  see this as a genuine,  (reasonable)  
question.

-- 
https://mail.python.org/mailman/listinfo/python-list


RE: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread avi.e.gross
Hen or Hanna,

You keep asking WHY which may be reasonable but hard or irrelevant in many
cases.

I find the traceback perfectly informative.

It says you asked it to print NOT just "a" but "a + 12" and the error is
coming not from PRINT but from trying to invoke addition between two objects
that have not provided instructions on how to do so. Specifically, an object
of type str has not specified anything to do if asked to concatenate an
object of type int to it. And, an object of type int has not specified what
to do if asked to add itself to an object of type str to the left of it.
Deeper in python, the objects have dunder methods like __ADD__() and
___RADD__() to invoke for those situations that do some logic and decide
they cannot handle it and return an exception of sorts that ends up
generating your message.

If you want to know what "a" has at the moment, ask for just it, not adding
twelve to it. Perhaps you should add a line above your print asking to just
print(a).

Before you suggest what might be helpful, consider what it might mean in a
complex case with lots of variables and what work the interpreter might have
to do to dump the current values of anything relevant or just ANYTHING.

The way forward is less about asking why but asking what to do to get what
you want, or realize it is not attained the way you thought.

Avi

-Original Message-
From: Python-list  On
Behalf Of Hen Hanna
Sent: Wednesday, February 22, 2023 3:05 PM
To: python-list@python.org
Subject: Why doesn't Python (error msg) tell me WHAT the actual (arg) values
are ?


  >  py   bug.py
   Traceback (most recent call last):
 File "C:\Usenet\bug.py", line 5, in 
 print( a + 12 )
  TypeError: can only concatenate str (not "int") to str


Why doesn't  Python (error msg) do the obvious thing and tell me
WHAT   the actual   (offending,  arg)  values are ?

In many cases, it'd help to know what string the var  A  had  ,   when the
error occurred.
   i wouldn't have to put  print(a) just
above,  to see.




( pypydoesn't do that either,   but Python makes programming (debugging)
so easy that i hardly feel any inconvenience.)
-- 
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-22 Thread Hen Hanna


  >  py   bug.py
   Traceback (most recent call last):
 File "C:\Usenet\bug.py", line 5, in 
 print( a + 12 )
  TypeError: can only concatenate str (not "int") to str


Why doesn't  Python (error msg) do the obvious thing and tell me
WHAT   the actual   (offending,  arg)  values are ?

In many cases, it'd help to know what string the var  A  had  ,   when the 
error occurred.
   i wouldn't have to put  print(a) just above, 
 to see.




( pypydoesn't do that either,   but Python makes programming (debugging) so 
easy that i hardly feel any inconvenience.)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

2022-10-12 Thread Dennis Lee Bieber
On Tue, 11 Oct 2022 16:40:31 -0700, LouisAden Capellupo
 declaimed the following:

> So basically, I get, "The term '...\python.exe' is not recognized as the 
>name of a cmdlet, function, script, file, or operable program... At line: 1 
>char: 3." It works the first way I showed with Code Runner, but the second or 
>original way doesn't work. What if I don't want to use Code Runner? Any help 
>in fixing this problem would be greatly appreciated. Sorry if certain things 
>are unclear as this is my first time using Python.
>

What happens if you change the system to use the "command" shell
INSTEAD OF PowerShell?

PowerShell may not honor the same environment variables.


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

2022-10-11 Thread Eryk Sun
On 10/11/22, LouisAden Capellupo via Python-list  wrote:
> Variables. 
> C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\Scripts\,
> and C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\.

I suggest that you switch to a user account that doesn't have single
quotes in the name. Using a name that contains single quotes is asking
for trouble. In most command-line shells, which includes PowerShell
(but not CMD), a literal (verbatim) string is contained by single
quotes. The shell usually consumes the quote character if it's not
escaped. See the following sections of the PowerShell documentation:

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.2#single-quoted-strings

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.2#including-quote-characters-in-a-string
-- 
https://mail.python.org/mailman/listinfo/python-list


How to fix Python error, The term '.../python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program, in VS Code?

2022-10-11 Thread LouisAden Capellupo via Python-list
 Hi! I've just downloaded and installed Python 3.10.7 (64-bit) for Windows 
10 from python.org. I'm quite new but, I've already downloaded and installed 
Visual Studio Code as well. I have included the two paths for python under User 
Variables. 
C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\Scripts\, and 
C:\Users\It'sMeLil'Loui\AppData\Local\Programs\Python\Python310\. I verified 
that python is recognized in the Command Prompt and PowerShell and installed 
the necessary extensions for python in Visual Studio Code. I created a test 
python file in the directory of D:\Projects\Python\Test\HelloWorld.py, and 
opened it in Visual Studio Code. I also restarted my laptop after all of this. 
Under the arrow used to run the code, I clicked "Run Code" (since I have Code 
Runner by Jun Han installed), and it worked just fine, displaying the output in 
the terminal.

Code:

print("Hello, world.")
input("Press Enter to continue...")

Output in Terminal when using Code Runner:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\Projects\Python\Test> python -u "d:\Projects\Python\Test\HelloWorld.py"
Hello, world.
Press Enter to continue...
PS D:\Projects\Python\Test> 
However, under the arrow to run code, when I click "Run Python File", I get 
this error message:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Output in Terminal when normally running it:

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS D:\Projects\Python\Test> & 
C:/Users/It'sMeLil'Loui/AppData/Local/Programs/Python/Python310/python.exe 
d:/Projects/Python/Test/HelloWorld.py
& : The term 
'C:/Users/ItsMeLilLoui/AppData/Local/Programs/Python/Python310/python.exe' is 
not recognized as the name of a cmdlet, function, script 
file, or operable program. Check the spelling of the name, or if a path was 
included, verify that the path is correct and try again.
At line:1 char:3
+ & C:/Users/It'sMeLil'Loui/AppData/Local/Programs/Python/Python310/pyt ...
+   ~~~
    + CategoryInfo  : ObjectNotFound: 
(C:/Users/ItsMeL...n310/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS D:\Projects\Python\Test>

 So basically, I get, "The term '...\python.exe' is not recognized as the 
name of a cmdlet, function, script, file, or operable program... At line: 1 
char: 3." It works the first way I showed with Code Runner, but the second or 
original way doesn't work. What if I don't want to use Code Runner? Any help in 
fixing this problem would be greatly appreciated. Sorry if certain things are 
unclear as this is my first time using Python.

Thanks, 
LouisAden


Sent from Mail for Windows

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue231207] Fatal Python Error during program shutdown

2022-04-10 Thread admin


Change by admin :


--
github: None -> 33851

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue233096] Fatal python error in com_make_closure()

2022-04-10 Thread admin


Change by admin :


--
github: None -> 33963

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Maybe related: bpo-20891

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

So what is causing this bug in 3.10 is the following stack:

thread_entry_point()
  PyGILState_Ensure()
  PyGILState_Release()
...
  PyGILState_Ensure()

The core issue is that PyGILState_Ensure is getting called while the tstate 
itself is in the process of being destroyed. This causes an invalid state and 
eventually results in a segfault or "Fatal Python Error."

I think the most robust fix is to allow re-entrancy to 
PyGILState_Release/PyGILState_Ensure. If that is prohibitively complex and/or 
is not specified to be allowed, I believe the most robust fix is to avoid using 
sqlite3 destructor callbacks to DECREF Python objects.

--

___
Python tracker 
<https://bugs.python.org/issue47019>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI, PyGILState_Ensure may be called by a thread as many times as you want, and 
it has been so for a very long time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If PyGILState_Ensure() has been fixed to become re-entrant during 
PyGILState_Release() in 3.11+ then I believe that change should be backported 
to 3.10. @vstinner would know

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

> All callbacks triggered from external libraries must protect Python C API 
> calls. You may call it offending, but that is the reality; a callback may 
> trigger at any point in time, so we need to make sure the GIL is held before 
> calling any Py API. That is also the case for the destructor.

Sure but I'm suggesting sidestepping and not using the destructor_callback 
entirely. You can DECREF the callbacks manually in connection_close() after 
calling sqlite3_close_v2(). Doing this makes sense to me since the destructor 
may be called under special conditions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also Petrs msg400205:

> [...] I recommend that any function passed to SQLite (and only those) should
>  - be named `*_callback`, for clarity
>  - acquire the GIL at the very start
>  - release the GIL at the very end

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also bpo-44304

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

All callbacks triggered from external libraries must protect Python C API 
calls. You may call it offending, but that is the reality; a callback may 
trigger at any point in time, so we need to make sure the GIL is held before 
calling any Py API. That is also the case for the destructor.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

I don't see it immediately but I think it's still possible to happen since all 
the same offending code is in place. There are two reasosn why it probably 
doesn't happen in 3.11+:

1) because something is deferring calling the finalizer for the zero-ref object 
to another thread instead on immediately on the thread that is dying as in 
<=3.10

2) In 3.11+ it is fixed so that PyGILState_Ensure can be called in a sequence 
started by PyGILState_Release. @vstinner is this correct?


If the reason it doesn't happen in 3.11+ is because of 1) then I don't think 
that is specified to happen anywhere and changing the GC in future versions 
could theoretically trigger the same bug. If it is 2) then it is fixed in a 
more robust location.

IMO, the most robust fix is to destroy the function callbacks in 
connection_close() and avoid using the destructor_callback and calling 
PyGILState_Ensure() altogether.

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> If you connect with check_same_thread=False, I believe the issue may still 
> present itself on 3.11+

Nope, works swell on my Mac. Do you see this on Linux with latest 3.11?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If you connect with check_same_thread=False, I believe the issue may still 
present itself on 3.11+

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> My recommended fix is to call sqlite3_close() within 
> Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all 
> connection-related functions afterward.

3.11 already drops the GIL before sqlite3_close_v2(); backporting this change 
to 3.10 results in the following assertion error:

$ ./python.exe sqlite3_fatal_python_error.py  
Assertion failed: (!_PyMem_IsPtrFreed(tstate->interp)), function 
is_tstate_valid, file ceval.c, line 155.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> A perfect repro has been attached, should be run on Linux.

FTR, the repo works on macOS 12.2.1 as well:

$ python3.10 ./sqlite3_fatal_python_error.py
Fatal Python error: PyThreadState_Get: the function must be called with the 
GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized

Thread 0x0001126e7600 (most recent call first):
  File 
"/Users/erlendaasland/src/cpython-build/./sqlite3_fatal_python_error.py", line 
52 in 
zsh: abort  python3.10 ./sqlite3_fatal_python_error.py

--

___
Python tracker 
<https://bugs.python.org/issue47019>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I'm removing 3.11 from the versions field:


$ python3.11 sqlite3_fatal_python_error.py
Exception ignored in: 
Traceback (most recent call last):
  File 
"/Users/erlendaasland/src/cpython-build/sqlite3_fatal_python_error.py", line 
10, in __del__
self.close()

sqlite3.ProgrammingError: SQLite objects created in a thread can only be 
used in that same thread. The object was created in thread id 123145443913728 
and this is thread id 4506211840.

--
versions:  -Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-14 Thread hydroflask


hydroflask  added the comment:

If you connect to the sqlite3 database in the example without using the 
factory, it will simply segfault.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-14 Thread hydroflask


New submission from hydroflask :

_destructor in connection.c in Python 3.10+ now calls `PyGILState_Ensure()`, 
this is a problem because if the destructor is being called while the thread is 
being torn down it will cause an unbalanced/erroneous call to 
"PyEval_RestoreThread" in PyGILState_Ensure which will eventually trigger a 
Fatal Python Error. A perfect repro has been attached, should be run on Linux.

My recommended fix is to call sqlite3_close() within 
Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all 
connection-related functions afterward.

--
components: Extension Modules, Library (Lib)
files: sqlite3_fatal_python_error.py
messages: 415212
nosy: erlendaasland, hydroflask
priority: normal
severity: normal
status: open
title: Fatal Python Error in sqlite3 Python 3.10
type: crash
versions: Python 3.10, Python 3.11
Added file: https://bugs.python.org/file50676/sqlite3_fatal_python_error.py

___
Python tracker 
<https://bugs.python.org/issue47019>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46115] Interrupting subprocess.popen in recursive calls by KeyboardInterrupt causes Fatal Python error.

2022-01-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-26 Thread tongxiaoge

tongxiaoge  added the comment:

We make SSL3 disappear to newly built dependencies, the test_ssl success. Refer 
to the modification of OpenSSL on fedoras (address: 
https://src.fedoraproject.org/rpms/openssl/tree/f34 )

```
 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/*.dist
 
+# Next step of gradual disablement of SSL3.
+# Make SSL3 disappear to newly built dependencies.
+sed -i '/^\#ifndef OPENSSL_NO_SSL_TRACE/i\
+#ifndef OPENSSL_NO_SSL3\
+# define OPENSSL_NO_SSL3\
+#endif' $RPM_BUILD_ROOT/%{_prefix}/include/openssl/opensslconf.h
+
 %check
```

--
nosy: +sxt1001

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread Christian Heimes


Christian Heimes  added the comment:

You are using a OpenSSL build with custom, additional patches and your code is 
crashing somewhere in OpenSSL. It is likely that your patches are causing 
issue. I'm not going to provide free service for custom builds.

--
assignee: christian.heimes -> 
nosy: +christian.heimes
resolution:  -> third party
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


Change by tongxiaoge :


--
nosy:  -christian.heimes, sxt1001, thatiparthy, vstinner
Added file: https://bugs.python.org/file50512/python3.spec

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


tongxiaoge  added the comment:

I want to know whether this is an OpenSSL problem or a python 3 problem, and 
how to fix it? Thanks.
(The OpenSSL source package is large and has not been uploaded successfully. We 
can download it from the OpenSSL official website)

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50511/openssl-1.1.1-build.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


Change by tongxiaoge :


--
keywords: +patch
Added file: https://bugs.python.org/file50510/openssl-1.1.1-fips.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50509/openssl.spec

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


Change by tongxiaoge :


Added file: https://bugs.python.org/file50508/Makefile.certificate

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


tongxiaoge  added the comment:

Other information:
```
(gdb) f 2
#2  SSL_CTX_new (meth=0xe222cc30) at ssl/ssl_lib.c:3046
warning: Source file is more recent than executable.
3046ret->session_timeout = meth->get_timeout();
(gdb) l
3041ret->max_proto_version = 0;
3042ret->mode = SSL_MODE_AUTO_RETRY;
3043ret->session_cache_mode = SSL_SESS_CACHE_SERVER;
3044ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT;
3045/* We take the system default. */
3046ret->session_timeout = meth->get_timeout();
3047ret->references = 1;
3048ret->lock = CRYPTO_THREAD_lock_new();
3049if (ret->lock == NULL) {
3050SSLerr(SSL_F_SSL_CTX_NEW, ERR_R_MALLOC_FAILURE);
```

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-12-23 Thread tongxiaoge


tongxiaoge  added the comment:

Today, I upgraded my version of Python3 to 3.9.9. When running test_ ssl,It has 
a segment error again. The version of OpenSSL I use is 1.1.1l, here is part of 
the stack information (the complete one is too long):

```
(gdb) bt
#0  0x9e563830 in raise () from /lib64/libpthread.so.0
#1  
#2  SSL_CTX_new (meth=0x9076cc30) at ssl/ssl_lib.c:3046
#3  0x90799f38 in _ssl__SSLContext_impl () from 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/build/debug/build/lib.linux-aarch64-3.9-pydebug/_ssl.cpython-39d-aarch64-linux-gnu.so
#4  0x9079a3ac in _ssl__SSLContext () from 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/build/debug/build/lib.linux-aarch64-3.9-pydebug/_ssl.cpython-39d-aarch64-linux-gnu.so
#5  0x9e76d034 in tp_new_wrapper (self=0x907c0510 
, args=0x8ff4db90, kwds=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:6247
#6  0x9e748ae8 in cfunction_call (func=0x907d60b0, args=, kwargs=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/methodobject.c:543
#7  0x9e6f18a8 in _PyObject_MakeTpCall 
(tstate=tstate@entry=0xaaadd8db33b0, callable=callable@entry=0x907d60b0, 
args=args@entry=0x8fcb45b0, nargs=nargs@entry=2, 
keywords=keywords@entry=0x0)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:191
#8  0x9e670fd8 in _PyObject_VectorcallTstate (kwnames=, 
nargsf=, args=, callable=, 
tstate=)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:116
#9  PyObject_Vectorcall (kwnames=, nargsf=, 
args=, callable=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#10 call_function (tstate=0xaaadd8db33b0, pp_stack=0xc5ebf240, 
oparg=, kwnames=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#11 0x9e67a7e8 in _PyEval_EvalFrameDefault (tstate=, 
f=, throwflag=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3487
#12 0x9e80c52c in _PyEval_EvalFrame (throwflag=0, f=0x8fcb4410, 
tstate=0x903e2050) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#13 _PyEval_EvalCode (tstate=0x903e2050, _co=0x908b3110, 
globals=, locals=locals@entry=0x0, args=, 
argcount=281473096927744, kwnames=0xaaadd8db33b0,
kwargs=0xc5ebf4a0, kwcount=281473343352832, kwstep=kwstep@entry=1, 
defs=0x903dd798, defcount=, kwdefs=0x0, closure=, name=, qualname=)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:4327
#14 0x9e6f13f0 in _PyFunction_Vectorcall (func=, 
stack=, nargsf=, kwnames=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:396
#15 0x9e6f1c5c in _PyObject_FastCallDictTstate 
(tstate=tstate@entry=0xaaadd8db33b0, callable=callable@entry=0x903e2050, 
args=args@entry=0xc5ebf4a0, nargsf=nargsf@entry=2,
kwargs=kwargs@entry=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:118
#16 0x9e6f2004 in _PyObject_Call_Prepend 
(tstate=tstate@entry=0xaaadd8db33b0, callable=callable@entry=0x903e2050, 
obj=obj@entry=0xaaadd8f8fe00, args=args@entry=0x8ff4ca00,
kwargs=kwargs@entry=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:489
#17 0x9e769960 in slot_tp_new (type=0xaaadd8f8fe00, 
args=0x8ff4ca00, kwds=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:6994
#18 0x9e76d438 in type_call (type=0xaaadd8f8fe00, args=0x8ff4ca00, 
kwds=0x0) at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/typeobject.c:1014
#19 0x9e6f18a8 in _PyObject_MakeTpCall 
(tstate=tstate@entry=0xaaadd8db33b0, callable=callable@entry=0xaaadd8f8fe00, 
args=args@entry=0x8fcf7f08, nargs=nargs@entry=1, 
keywords=keywords@entry=0x0)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:191
#20 0x9e670fd8 in _PyObject_VectorcallTstate (kwnames=, 
nargsf=, args=, callable=, 
tstate=)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:116
#21 PyObject_Vectorcall (kwnames=, nargsf=, 
args=, callable=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:127
#22 call_function (tstate=0xaaadd8db33b0, pp_stack=0xc5ebf730, 
oparg=, kwnames=0x0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:5075
#23 0x9e67a7e8 in _PyEval_EvalFrameDefault (tstate=, 
f=, throwflag=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Python/ceval.c:3487
#24 0x9e66f024 in _PyEval_EvalFrame (throwflag=0, f=0x8fcf7d70, 
tstate=0xaaadd8db33b0) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/internal/pycore_ceval.h:40
#25 function_code_fastcall (tstate=0xaaadd8db33b0, co=, 
args=, nargs=1, globals=) at 
/home/abuild/rpmbuild/BUILD/Python-3.9.9/Objects/call.c:330
#26 0x9e6f55f0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, 
args=0x8fcc6f48, callable=, tstate=)
at /home/abuild/rpmbuild/BUILD/Python-3.9.9/Include/cpython/abstract.h:118
#27 

[issue46115] Interrupting subprocess.popen in recursive calls by KeyboardInterrupt causes Fatal Python error.

2021-12-17 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Popen works when stdio fds are available. However, when interrupting popen in a 
recursive function call. The Python interpreter reports a Fatal Python error.

test.py

import subprocess
import os
import sys


def test_small_errpipe_write_fd():
new_stdout = os.dup(1)
try:
os.close(1)
subprocess.Popen([sys.executable, '-c', 
"print('AssertionError:0:CLOEXEC failure.')"]).wait()
finally:
os.dup2(new_stdout, 0)
os.dup2(new_stdout, 1)
test_small_errpipe_write_fd()

test_small_errpipe_write_fd()
===

Reported message:
-
xxm@xxm:~$ 'cpython-main/python' '/home/xxm/Desktop/test/test.py' 
^CFatal Python error: init_import_site: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/site.py", line 73, in 

import os
^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/os.py", line 29, in 

from _collections_abc import _check_methods
^^^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/_collections_abc.py", line 
1015, in 
class Sequence(Reversible, Collection):
^^^
  File "/home/xxm/Desktop/compilers/cpython-main/Lib/abc.py", line 106, in 
__new__
cls = super().__new__(mcls, name, bases, namespace, **kwargs)
  ^^^
KeyboardInterrupt
---

Reproduce step:
1. run test.py in the console
2. use "Ctrl C" to interrupt the program

If typing a "Ctrl C", the program does not stop and no error is reported. Just 
type "Ctrl C" constantly. Sometimes, it need 5 or 6 "Ctrl C" to reproduce this 
bug. 



verson of Python: Python 3.11.0a2+ (main, Nov 26 2021, 18:38:48) [GCC 7.5.0] on 
linux (it also crashes Python 3.6.15, 3.7.12,3.8.12)

--
components: Interpreter Core
messages: 408772
nosy: xxm
priority: normal
severity: normal
status: open
title: Interrupting subprocess.popen in recursive calls by KeyboardInterrupt 
causes Fatal Python error.
type: crash
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 
<https://bugs.python.org/issue46115>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2021-12-13 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 5.0 -> 6.0
pull_requests: +28310
pull_request: https://github.com/python/cpython/pull/30082

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25222] 3.5.0 regression - Fatal Python error: Cannot recover from stack overflow

2021-10-19 Thread Irit Katriel


Irit Katriel  added the comment:

There was work on recursion in recent versions and the Fatal Error is less 
likely now. We will not investigate recursion issues on 3.5, so I will close 
this and request that you create a new issue if you have problem with a current 
Python version.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37402] Fatal Python error: Cannot recover from stack overflow issues on Python 3.6 and 3.7

2021-10-19 Thread Irit Katriel


Irit Katriel  added the comment:

There has been work done on recursion handling in more recent python versions, 
so you should get clean RecursionErrors now rather than the fatal error.  
Please create a new issue if you have such problems on current versions (3.9+).

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39419] Core dump when trying to use workaround for custom warning category (Fatal Python error: init_sys_streams: can't initialize sys standard streams)

2021-10-17 Thread Irit Katriel


Irit Katriel  added the comment:

Can you reproduce this on 3.10 or 3.11?

OpenWrapper is deprecated and no longer defined in the io module from 3.10.

--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37013] Fatal Python error in socket.if_indextoname()

2021-10-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-09-22 Thread tongxiaoge


tongxiaoge  added the comment:

I installed OpenSSL version 1.1.1l and tested it again. The problem 
disappeared. It should be the reason why the OpenSSL version I used before is 
too low. The current issue is closed

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-09-16 Thread tongxiaoge


tongxiaoge  added the comment:

I'm sorry I haven't replied for a long time. I found that the OpenSSL version I 
use is 1.1.1f, which is probably caused by this. Today, I tried to upgrade 
Python 3 to 3.8.12, and the same problem occurred. I'll try again after 
upgrading the OpenSSL version tomorrow. If there are still problems, I'll give 
a reply at that time.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-08-09 Thread STINNER Victor


STINNER Victor  added the comment:

tongxiaoge: Without more information, we cannot help you. See Christian's 
questions.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-19 Thread శ్రీనివాస్ రెడ్డి తాటిపర్తి

Srinivas  Reddy Thatiparthy(శ్రీనివాస్ రెడ్డి తాటిపర్తి) 
 added the comment:

ran on 3.9.6 branch with OpenSSL 1.1.1k  25 Mar 2021. I see this warning in the 
console. Please also see the attached log for full details.


/Users/srini/workspace/consulting/cpython/Lib/test/support/__init__.py:3105: 
ResourceWarning: unclosed 
  del self.thread
ResourceWarning: Enable tracemalloc to get the object allocation traceback

--
nosy: +thatiparthy
Added file: https://bugs.python.org/file50159/log

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-11 Thread Christian Heimes


Christian Heimes  added the comment:

Python 3.9.5 and OpenSSL 1.1.1f are both outdated. Can you reproduce the 
problem with 3.9.6 and 1.1.1k?

Can you tel us more about your system (distribution, CPU arch, compiler) and 
provide a C stacktrace with debug symbols?

--
nosy:  -Guido.van.Rossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44598] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-11 Thread tongxiaoge

New submission from tongxiaoge :

I have reproduced this problem in the latest versions of Python 3.8.11 and 
3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. 
The failure log is as follows:
[  613s] 0:02:27 load avg: 4.66 Re-running failed tests in verbose mode
[  613s] 0:02:27 load avg: 4.66 Re-running test_ssl in verbose mode
[  613s] test_ssl: testing with 'OpenSSL 1.1.1f  31 Mar 2020' (1, 1, 1, 6, 15)
[  613s]   under 'Linux-5.4.6-x86_64-with-glibc2.2.5'
[  613s]   HAS_SNI = True
[  613s]   OP_ALL = 0x8054
[  613s]   OP_NO_TLSv1_1 = 0x1000
[  613s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok
[  613s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok
[  613s] test_check_hostname (test.test_ssl.ContextTests) ... ok
[  613s] test_ciphers (test.test_ssl.ContextTests) ... ok
[  613s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
[  613s] 
[  613s] Current thread 0x7ff433b90740 (most recent call first):
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 
483 in __new__
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in 
test_constructor
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in 
_callTestMethod
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in 
run
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in 
__call__
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in 
run
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2030 in _run_suite
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2152 in run_unittest
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in 
test_main
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 234 in _runtest_inner2
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 270 in _runtest_inner
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 153 in _runtest
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 193 in runtest
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
318 in rerun_failed_tests
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
694 in _main
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
637 in main
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
715 in main
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in 
_main
[  613s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in 

[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
87 in _run_code
[  613s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
194 in _run_module_as_main
[  613s] /var/tmp/rpm-tmp.lFeeM8: line 50: 15891 Segmentation fault  
WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug 
$(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils 
-x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio
[  613s] error: Bad exit status from /var/tmp/rpm-tmp.lFeeM8 (%check)

What is the reason for this? and is there a plan to fix it?

--
assignee: christian.heimes
components: SSL, Tests
messages: 397254
nosy: Guido.van.Rossum, christian.heimes, sxt1001, vstinner
priority: normal
severity: normal
status: open
title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue44598>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44568] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-11 Thread tongxiaoge


Change by tongxiaoge :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44568] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: Segmentation fault

2021-07-05 Thread tongxiaoge

New submission from tongxiaoge :

I have reproduced this problem in the latest versions of Python 3.8.10 and 
3.9.6. Python 3.8.5 does not have this problem, other versions are not tested. 
The failure log is as follows:
[  457s] 0:02:34 load avg: 9.29 Re-running test_ssl in verbose mode
[  457s] test_ssl: testing with 'OpenSSL 1.1.1f  31 Mar 2020' (1, 1, 1, 6, 15)
[  457s]   under 
'Linux-4.19.36-vhulk1907.1.0.h748.eulerosv2r8.aarch64-aarch64-with-glibc2.17'
[  457s]   HAS_SNI = True
[  457s]   OP_ALL = 0x8054
[  457s]   OP_NO_TLSv1_1 = 0x1000
[  457s] test__create_stdlib_context (test.test_ssl.ContextTests) ... ok
[  457s] test_cert_store_stats (test.test_ssl.ContextTests) ... ok
[  457s] test_check_hostname (test.test_ssl.ContextTests) ... ok
[  457s] test_ciphers (test.test_ssl.ContextTests) ... ok
[  457s] test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
[  457s] 
[  457s] Current thread 0x8e225010 (most recent call first):
[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/ssl.py", line 
483 in __new__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 1126 in 
test_constructor
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 650 in 
_callTestMethod
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 693 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/case.py", line 753 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 122 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/suite.py", line 84 in 
__call__
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/unittest/runner.py", line 176 in 
run
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2030 in _run_suite
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/support/__init__.py", line 
2152 in run_unittest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/test_ssl.py", line 4848 in 
test_main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 234 in _runtest_inner2
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 270 in _runtest_inner
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 153 in _runtest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/runtest.py", 
line 193 in runtest
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
318 in rerun_failed_tests
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
694 in _main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
637 in main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/libregrtest/main.py", line 
715 in main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 46 in 
_main
[  457s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/test/regrtest.py", line 50 in 

[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
87 in _run_code
[  457s]   File "/home/abuild/rpmbuild/BUILD/Python-3.8.11/Lib/runpy.py", line 
194 in _run_module_as_main
[  457s] /var/tmp/rpm-tmp.gGVNgB: line 50: 2329201 Segmentation fault  
(core dumped) WITHIN_PYTHON_RPM_BUILD= LD_LIBRARY_PATH=$(pwd)/build/debug 
$(pwd)/build/debug/python -m test.regrtest -wW --slowest -j0 -x test_distutils 
-x test_bdist_rpm -x test_gdb -x test_socket -x test_asyncio
[  457s] error: Bad exit status from /var/tmp/rpm-tmp.gGVNgB (%check)

--
components: Tests
messages: 397008
nosy: sxt1001
priority: normal
severity: normal
status: open
title: test_constructor (test.test_ssl.ContextTests) ... Fatal Python error: 
Segmentation fault
type: crash
versions: Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue44568>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2021-06-16 Thread Peter


Peter  added the comment:

We've migrated our python process off Solaris.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23786] test_unaligned_buffers (test.test_hash.HashEqualityTestCase) ... Fatal Python error: Bus error

2021-06-16 Thread Irit Katriel


Irit Katriel  added the comment:

Can this be close (as third party?) or is there anything left to do?

--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame"

2021-05-29 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I'm not sure *but* in the DestroyTests.test_one id1 and id3 were never 
explicitly destroyed. Can it be related?

--
nosy: +shreyanavigyan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame"

2021-05-10 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-37224 "[subinterpreters] test__xxsubinterpreters fails randomly" 
that I reported 2 years ago and is not fixed yet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44100] test__xxsubinterpreters: test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame"

2021-05-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python 
error: Py_EndInterpreter: thread still has a frame" -> test__xxsubinterpreters: 
test_one() fails in AMD64 Fedora Stable 3.x: "Fatal Python error: 
Py_EndInterpreter: thread still has a frame"

___
Python tracker 
<https://bugs.python.org/issue44100>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44100] test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame"

2021-05-10 Thread STINNER Victor


Change by STINNER Victor :


--
title: test_subinterpreters fails in AMD64 Fedora Stable 3.x -> 
test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: 
Py_EndInterpreter: thread still has a frame"

___
Python tracker 
<https://bugs.python.org/issue44100>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44100] test_subinterpreters fails in AMD64 Fedora Stable 3.x: "Fatal Python error: Py_EndInterpreter: thread still has a frame"

2021-05-10 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +nanjekyejoannah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-05-05 Thread Irit Katriel


Irit Katriel  added the comment:

This was fixed in 3.9+ and 3.8 is in security fix now, so closing.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon


Change by Mark Shannon :


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

> Pablo, are you OK closing this without a 3.8 backport?

I would be supportive, but we should check with Łukasz as he is the release 
manager of 3.8

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon


Mark Shannon  added the comment:

Pablo, are you OK closing this without a 3.8 backport?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Irit Katriel


Irit Katriel  added the comment:

There were additional merge conflicts when I tried to create a manual 3.8 
backport, more significant than the 3.9 ones IIRC.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2021-01-13 Thread Mark Shannon


Mark Shannon  added the comment:

Does this need backporting to 3.8, or is 3.9 sufficient?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28913] "Fatal Python error: Cannot recover from stack overflow." from RecursionError in Python 3.5

2020-11-24 Thread STINNER Victor


STINNER Victor  added the comment:

> This appears to happen in 3.5, and not in 3.6 so perhaps whatever fix was 
> applied to 3.6 can be backported to 3.5 so that it doesn't core dump?

I removed the stack usage for function calls in Python 3.6. See the "Stack 
consumption" section of:
https://vstinner.github.io/contrib-cpython-2017q1.html

> Hi Richard, 3.5 is no longer maintained. Does this issue exist in current (>= 
> 3.8) versions?

He wrote that 3.6 is not affected. 3.5 no longer accept bugfixes, so I close 
the issue as out of date.

--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28913] "Fatal Python error: Cannot recover from stack overflow." from RecursionError in Python 3.5

2020-11-24 Thread STINNER Victor


STINNER Victor  added the comment:

https://github.com/Naddiseo/python-core-dump reproducer no longer works on 
Python 3.10.

# in Python source code directory
git clone https://github.com/Naddiseo/python-core-dump
make
./python -m venv ENV
ENV/bin/python -m pip install -r python-core-dump/requirements.txt 
cd python-core-dump/
../ENV/bin/python manage.py migrate

Output:
---
/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/db/models/sql/query.py:11:
 DeprecationWarning: Using or importing the ABCs from 'collections' instead of 
from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop 
working
  from collections import Counter, Iterator, Mapping, OrderedDict
/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/core/paginator.py:101:
 DeprecationWarning: Using or importing the ABCs from 'collections' instead of 
from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop 
working
  class Page(collections.Sequence):
Traceback (most recent call last):
  File "/home/vstinner/python/master/python-core-dump/manage.py", line 22, in 

execute_from_command_line(sys.argv)
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/core/management/__init__.py",
 line 367, in execute_from_command_line
utility.execute()
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/core/management/__init__.py",
 line 341, in execute
django.setup()
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/__init__.py",
 line 27, in setup
apps.populate(settings.INSTALLED_APPS)
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/apps/registry.py",
 line 108, in populate
app_config.import_models(all_models)
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/apps/config.py",
 line 199, in import_models
self.models_module = import_module(models_module_name)
  File "/home/vstinner/python/master/Lib/importlib/__init__.py", line 126, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1037, in _gcd_import
  File "", line 1014, in _find_and_load
  File "", line 993, in _find_and_load_unlocked
  File "", line 687, in _load_unlocked
  File "", line 831, in exec_module
  File "", line 235, in _call_with_frames_removed
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/contrib/auth/models.py",
 line 4, in 
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File 
"/home/vstinner/python/master/ENV/lib/python3.10/site-packages/django/contrib/auth/base_user.py",
 line 52, in 
class AbstractBaseUser(models.Model):
RuntimeError: __class__ not set defining 'AbstractBaseUser' as . Was __classcell__ propagated 
to type.__new__?
---

--
nosy: +vstinner
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28913] "Fatal Python error: Cannot recover from stack overflow." from RecursionError in Python 3.5

2020-11-24 Thread Irit Katriel


Irit Katriel  added the comment:

Hi Richard, 3.5 is no longer maintained. Does this issue exist in current (>= 
3.8) versions?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Python Error

2020-11-24 Thread Mayukh Chakraborty via Python-list
 Thanks.
I updated the path and was able to launch python.exe for v3.8. I got rid of the 
other errors but now facing an error with 'pandas' although  it is installed ok 
and the path correctly updated.
C:\Users\mchak>pythonPython 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) 
[MSC v.1927 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or 
"license" for more information.>>> import pandas as pdTraceback (most recent 
call last):  File "", line 1, in   File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\__init__.py",
 line 22, in     from pandas.compat.numpy import (ModuleNotFoundError: 
No module named 'pandas.compat.numpy'>>>
- Mayukh


On Tuesday, November 24, 2020, 09:27:00 PM GMT, Barry 
 wrote:  
 
 Two observations.

Python.exe is not on your PATH. But that does not matter as you can use the py 
command instead

And nymph may not be available for python 3.9 yet. Check on pypi to see if 
there is a build for 3.9.

Maybe use 3.8 for the time being.
Barry

> On 24 Nov 2020, at 11:18, Mayukh Chakraborty via Python-list 
>  wrote:
> 
>  Thanks - I am able to launch 'py' from the command prompt and it gives me 
> the python versions installed in my machine from python.org website.
> However, when I am trying to execute a python program from command prompt, I 
> am getting the error below. I had reinstalled python packages (numpy, pandas) 
> but it didn't resolve the issue. Any help would be appreciated.
> Original error was: No module named 'numpy.core._multiarray_umath'
> 
> ---
> C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  
> File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
>  line 22, in     from . import multiarray  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py",
>  line 12, in     from . import overrides  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py",
>  line 7, in     from numpy.core._multiarray_umath import 
> (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):  File 
> "C:\Users\mchak\Documents\Python\ES.py", line 1, in     import scipy 
> as sp  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py",
>  line 61, in     from numpy import show_config as show_numpy_config  
> File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py",
>  line 140, in     from . import core  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
>  line 48, in     raise ImportError(msg)ImportError:
> IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
> Importing the numpy C-extensions failed. This error can happen formany 
> reasons, often due to issues with your setup or how NumPy wasinstalled.
> We have compiled some common reasons and troubleshooting tips at:
>    https://numpy.org/devdocs/user/troubleshooting-importerror.html
> Please note and check the following:
>  * The Python version is: Python3.9 from 
>"C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The 
>NumPy version is: "1.19.4"
> and make sure that they are the versions you expect.Please carefully study 
> the documentation linked above for further help.
> Original error was: No module named 'numpy.core._multiarray_umath'
> 
>>    On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem 
>> wrote:  
>> 
>> Barry Scott wrote:
>> 
>> If you have python from python.org installed you should be able to list all 
>> the version you have installed
>> with the command:
>> 
>>    py -0
> When was that '-0' feature added?
> I have Python 3.6 from Python.org and here a
> 'py.exe -0' gives:
>  Requested Python version (0) not installed
> 
> But using 'py.exe -0' from Python 3.9 correctly
> gives:
>  -3.6-32 *
>  -2.7-32
> 
> -- 
> --gv
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-24 Thread Barry
Two observations.

Python.exe is not on your PATH. But that does not matter as you can use the py 
command instead

And nymph may not be available for python 3.9 yet. Check on pypi to see if 
there is a build for 3.9.

Maybe use 3.8 for the time being.
Barry

> On 24 Nov 2020, at 11:18, Mayukh Chakraborty via Python-list 
>  wrote:
> 
>  Thanks - I am able to launch 'py' from the command prompt and it gives me 
> the python versions installed in my machine from python.org website.
> However, when I am trying to execute a python program from command prompt, I 
> am getting the error below. I had reinstalled python packages (numpy, pandas) 
> but it didn't resolve the issue. Any help would be appreciated.
> Original error was: No module named 'numpy.core._multiarray_umath'
> 
> ---
> C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  
> File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
>  line 22, in from . import multiarray  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py",
>  line 12, in from . import overrides  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py",
>  line 7, in from numpy.core._multiarray_umath import 
> (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):  File 
> "C:\Users\mchak\Documents\Python\ES.py", line 1, in import scipy 
> as sp  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py",
>  line 61, in from numpy import show_config as show_numpy_config  
> File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py",
>  line 140, in from . import core  File 
> "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
>  line 48, in raise ImportError(msg)ImportError:
> IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
> Importing the numpy C-extensions failed. This error can happen formany 
> reasons, often due to issues with your setup or how NumPy wasinstalled.
> We have compiled some common reasons and troubleshooting tips at:
> https://numpy.org/devdocs/user/troubleshooting-importerror.html
> Please note and check the following:
>   * The Python version is: Python3.9 from 
> "C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The 
> NumPy version is: "1.19.4"
> and make sure that they are the versions you expect.Please carefully study 
> the documentation linked above for further help.
> Original error was: No module named 'numpy.core._multiarray_umath'
> 
>>On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem 
>>  wrote:  
>> 
>> Barry Scott wrote:
>> 
>> If you have python from python.org installed you should be able to list all 
>> the version you have installed
>> with the command:
>> 
>> py -0
> When was that '-0' feature added?
> I have Python 3.6 from Python.org and here a
> 'py.exe -0' gives:
>   Requested Python version (0) not installed
> 
> But using 'py.exe -0' from Python 3.9 correctly
> gives:
>   -3.6-32 *
>   -2.7-32
> 
> -- 
> --gv
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-24 Thread Mayukh Chakraborty via Python-list
 Thanks - I am able to launch 'py' from the command prompt and it gives me the 
python versions installed in my machine from python.org website.
However, when I am trying to execute a python program from command prompt, I am 
getting the error below. I had reinstalled python packages (numpy, pandas) but 
it didn't resolve the issue. Any help would be appreciated.
Original error was: No module named 'numpy.core._multiarray_umath'

---
C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  
File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
 line 22, in     from . import multiarray  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py",
 line 12, in     from . import overrides  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py",
 line 7, in     from numpy.core._multiarray_umath import 
(ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):  File 
"C:\Users\mchak\Documents\Python\ES.py", line 1, in     import scipy as 
sp  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py",
 line 61, in     from numpy import show_config as show_numpy_config  
File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py",
 line 140, in     from . import core  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
 line 48, in     raise ImportError(msg)ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen formany reasons, 
often due to issues with your setup or how NumPy wasinstalled.
We have compiled some common reasons and troubleshooting tips at:
    https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
  * The Python version is: Python3.9 from 
"C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The NumPy 
version is: "1.19.4"
and make sure that they are the versions you expect.Please carefully study the 
documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'

On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem 
 wrote:  
 
 Barry Scott wrote:

> If you have python from python.org installed you should be able to list all 
> the version you have installed
> with the command:
> 
>    py -0
When was that '-0' feature added?
I have Python 3.6 from Python.org and here a
'py.exe -0' gives:
  Requested Python version (0) not installed

But using 'py.exe -0' from Python 3.9 correctly
gives:
  -3.6-32 *
  -2.7-32

-- 
--gv
-- 
https://mail.python.org/mailman/listinfo/python-list
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-23 Thread Gisle Vanem

Barry Scott wrote:


If you have python from python.org installed you should be able to list all the 
version you have installed
with the command:

   py -0

When was that '-0' feature added?
I have Python 3.6 from Python.org and here a
'py.exe -0' gives:
  Requested Python version (0) not installed

But using 'py.exe -0' from Python 3.9 correctly
gives:
  -3.6-32 *
  -2.7-32

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
 Hi,
I have solved the issue by updating the Environment variables, now I am able to 
launch 'py' from the command prompt. However, I can't launch 'python' from 
command prompt. I am also encountering an issue when I try to execute the 
'python' command from command prompt.
I had reinstalled the python packages (numpy, pandas, scipy etc) but I can't 
find a solution for this error.
---
C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  
File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
 line 22, in     from . import multiarray  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py",
 line 12, in     from . import overrides  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py",
 line 7, in     from numpy.core._multiarray_umath import 
(ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):  File 
"C:\Users\mchak\Documents\Python\ES.py", line 1, in     import scipy as 
sp  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py",
 line 61, in     from numpy import show_config as show_numpy_config  
File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py",
 line 140, in     from . import core  File 
"C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py",
 line 48, in     raise ImportError(msg)ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen formany reasons, 
often due to issues with your setup or how NumPy wasinstalled.
We have compiled some common reasons and troubleshooting tips at:
    https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
  * The Python version is: Python3.9 from 
"C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The NumPy 
version is: "1.19.4"
and make sure that they are the versions you expect.Please carefully study the 
documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'

Regards,MayukhOn Monday, November 23, 2020, 08:17:06 PM GMT, Mayukh 
Chakraborty via Python-list  wrote:  
 
  Hi Terry,
1. The command py doesn't work. It gives me the error below :
C:\Users\mchak>pyFatal Python error: init_sys_streams: can't initialize sys 
standard streamsPython runtime state: core initializedAttributeError: module 
'io' has no attribute 'open'
Current thread 0x8290 (most recent call first):

2. If I use py -0, I get two installed versions. However, if I try to uninstall 
from Control Panel, I see only 3.9 version
C:\Users\mchak>py -0Installed Pythons found by py Launcher for Windows -3.9-64 
* -3.8-64
3. I tried to uninstall v3.9 and reinstall but it didn't solve the issue.
Regards,Mayukh    On Monday, November 23, 2020, 06:34:43 PM GMT, Terry Reedy 
 wrote:  
 
 On 11/23/2020 9:10 AM, Mayukh Chakraborty via Python-list wrote:
> Hi,
> I had uninstalled and installed Python in Windows 10 but I am getting the 
> error below. Can you please help ?
> C:\Users\mchak>python
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
AttributeError: module 'io' has no attribute 'OpenWrapper'
Current thread 0x9d44 (most recent call first):

It is true that io has no OpenWrapper class.  The question is What is 
trying to use that?  What installer are you using?  I would 
(re)download the one from python.org.
-- 
Terry Jan Reedy

-- 
https://mail.python.org/mailman/listinfo/python-list
  
-- 
https://mail.python.org/mailman/listinfo/python-list
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
 Hi Terry,
1. The command py doesn't work. It gives me the error below :
C:\Users\mchak>pyFatal Python error: init_sys_streams: can't initialize sys 
standard streamsPython runtime state: core initializedAttributeError: module 
'io' has no attribute 'open'
Current thread 0x8290 (most recent call first):

2. If I use py -0, I get two installed versions. However, if I try to uninstall 
from Control Panel, I see only 3.9 version
C:\Users\mchak>py -0Installed Pythons found by py Launcher for Windows -3.9-64 
* -3.8-64
3. I tried to uninstall v3.9 and reinstall but it didn't solve the issue.
Regards,MayukhOn Monday, November 23, 2020, 06:34:43 PM GMT, Terry Reedy 
 wrote:  
 
 On 11/23/2020 9:10 AM, Mayukh Chakraborty via Python-list wrote:
> Hi,
> I had uninstalled and installed Python in Windows 10 but I am getting the 
> error below. Can you please help ?
> C:\Users\mchak>python
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
AttributeError: module 'io' has no attribute 'OpenWrapper'
Current thread 0x9d44 (most recent call first):

It is true that io has no OpenWrapper class.  The question is What is 
trying to use that?  What installer are you using?  I would 
(re)download the one from python.org.
-- 
Terry Jan Reedy

-- 
https://mail.python.org/mailman/listinfo/python-list
  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
 1. The command 'py' doesn't work. It gives me the error below :
C:\Users\mchak>pyFatal Python error: init_sys_streams: can't initialize sys 
standard streamsPython runtime state: core initializedAttributeError: module 
'io' has no attribute 'open'
Current thread 0x8290 (most recent call first):

2. If I use py -0, I get two installed versions. However, if I try to uninstall 
from Control Panel, I see only 3.9 version
C:\Users\mchak>py -0Installed Pythons found by py Launcher for Windows -3.9-64 
* -3.8-64
3. I tried to uninstall v3.9 and reinstall but it didn't solve the issue.
Regards,Mayukh
On Monday, November 23, 2020, 06:17:00 PM GMT, Barry Scott 
 wrote:  
 
 

> On 23 Nov 2020, at 14:10, Mayukh Chakraborty via Python-list 
>  wrote:
> 
> Hi,
> I had uninstalled and installed Python in Windows 10 but I am getting the 
> error below. Can you please help ?
> C:\Users\mchak>pythonFatal Python error: init_sys_streams: can't initialize 
> sys standard streamsPython runtime state: core initializedAttributeError: 
> module 'io' has no attribute 'OpenWrapper'
> Current thread 0x9d44 (most recent call first):
> Regards,Mayukh

Which version of python are you installing and where did you download it from?
Do you have more than one version of python installed?


Does the command:

  py

work?

If you have python from python.org installed you should be able to list all the 
version you have installed
with the command:

  py -0

That is zero not oh.

Barry




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


Re: Python Error

2020-11-23 Thread Terry Reedy

On 11/23/2020 9:10 AM, Mayukh Chakraborty via Python-list wrote:

Hi,
I had uninstalled and installed Python in Windows 10 but I am getting the error 
below. Can you please help ?
C:\Users\mchak>python

Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
AttributeError: module 'io' has no attribute 'OpenWrapper'
Current thread 0x9d44 (most recent call first):

It is true that io has no OpenWrapper class.  The question is What is 
trying to use that?   What installer are you using?  I would 
(re)download the one from python.org.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python Error

2020-11-23 Thread Barry Scott



> On 23 Nov 2020, at 14:10, Mayukh Chakraborty via Python-list 
>  wrote:
> 
> Hi,
> I had uninstalled and installed Python in Windows 10 but I am getting the 
> error below. Can you please help ?
> C:\Users\mchak>pythonFatal Python error: init_sys_streams: can't initialize 
> sys standard streamsPython runtime state: core initializedAttributeError: 
> module 'io' has no attribute 'OpenWrapper'
> Current thread 0x9d44 (most recent call first):
> Regards,Mayukh

Which version of python are you installing and where did you download it from?
Do you have more than one version of python installed?


Does the command:

   py

work?

If you have python from python.org installed you should be able to list all the 
version you have installed
with the command:

  py -0

That is zero not oh.

Barry




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

-- 
https://mail.python.org/mailman/listinfo/python-list


Python Error

2020-11-23 Thread Mayukh Chakraborty via Python-list
Hi,
I had uninstalled and installed Python in Windows 10 but I am getting the error 
below. Can you please help ?
C:\Users\mchak>pythonFatal Python error: init_sys_streams: can't initialize sys 
standard streamsPython runtime state: core initializedAttributeError: module 
'io' has no attribute 'OpenWrapper'
Current thread 0x9d44 (most recent call first):
Regards,Mayukh
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42438] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

2020-11-22 Thread Eryk Sun


Change by Eryk Sun :


--
stage: backport needed -> resolved

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42438] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

2020-11-22 Thread Eryk Sun


Eryk Sun  added the comment:

> I reinstalled python from 3.8.2 to 3.9

Going from 3.8 to 3.9 is not an in-place upgrade. You need to create a new 
virtual environment that references the base 3.9 installation.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> backport needed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42438] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

2020-11-22 Thread Vuyyuru Sai Nithish


New submission from Vuyyuru Sai Nithish :

Im using django on an virtual env, when im trying to use pandas it was giving 
me and error message(IDE: VScode) i.e, module error: pandas was not found. I 
reinstalled python from 3.8.2 to 3.9 and now in my virtual environment it was 
giving an error that Django is not installed, and when I checked django in 
virtual env this is displayed

(test) C:\Users\saini\Envs>django-admin --version
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = 'c:\users\saini\envs\test\scripts\python.exe'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'c:\\users\\saini\\envs\\test\\scripts\\python.exe'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.executable = 'c:\\users\\saini\\envs\\test\\scripts\\python.exe'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
'c:\\users\\saini\\envs\\test\\scripts\\python38.zip',
'.\\DLLs',
'.\\lib',
'c:\\users\\saini\\appdata\\local\\programs\\python\\python38',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x0790 (most recent call first):


--

___
Python tracker 
<https://bugs.python.org/issue42438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42438] Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

2020-11-22 Thread Vuyyuru Sai Nithish


Change by Vuyyuru Sai Nithish :


--
nosy: nithish
priority: normal
severity: normal
status: open
title: Fatal Python error: init_fs_encoding: failed to get the Python codec of 
the filesystem encoding
type: crash
versions: Python 3.9

___
Python tracker 
<https://bugs.python.org/issue42438>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   6   7   8   >