[issue41698] io.[Text]IOBase.seek doesn't take keyword parameter - revisited

2021-10-20 Thread Tomer Vromen


Tomer Vromen  added the comment:

Just wanted to add that I encountered this today, went to file a ticket, and 
found this one. I'm fine with either style of documentation.

--
nosy: +tomerv

___
Python tracker 

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



[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Eryk Sun


Eryk Sun  added the comment:

> # I thought this would have to be 16, i.e. a path length over 4096, PATH_MAX
> # but seemingly just crossing 1050 is enough to fail

If os.pathconf() and PC_PATH_MAX are supported, the maximum allowed length of 
an absolute path is os.pathconf('/', os.pathconf_names['PC_PATH_MAX']). I think 
it also depends on the mounted filesystems that the path traverses.

If os.chdir is in os.supports_fd, the context manager can use dirfd = 
os.open(os.getcwd(), os.O_RDONLY). Using an fd should also work around the 
deleted directory case, though POSIX doesn't specify whether fchdir() succeeds 
in this case. It does in Linux, and the resulting state is the same as deleting 
the current working directory.

In Windows, SetCurrentDirectoryW() resolves the full path. So the result from 
os.getcwd() should always work with os.chdir(). The context manager could 
prevent the original directory from getting deleted by opening it without 
delete sharing (e.g. via _winapi.CreateFile). Though it may be more reasonable 
to just let it fail to restore the original working directory.

--
nosy: +eryksun

___
Python tracker 

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



[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-10-20 Thread Martin


Martin  added the comment:

Thanks, Joe, this is a very good summary of all the problems.

Another idea to fix this could be an additional parameter "repr=repr" to 
StackSummary.extract. This way, the default behavior is not changed, but the 
user is allowed to supply their own repr (safe_repr for example).

--

___
Python tracker 

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



[issue30238] 2to3 doesn't detect or fix Exception indexing

2021-10-20 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

See the superseding issue; 2to3 is deprecated and headed towards deletion.

--

___
Python tracker 

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



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27393
pull_request: https://github.com/python/cpython/pull/29117

___
Python tracker 

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



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 7c4d96103c4e16161e9aed9a584c9857d0674099 by Ethan Furman in 
branch 'main':
bpo-44174: [Enum] add reference to name mangling (GH-29116)
https://github.com/python/cpython/commit/7c4d96103c4e16161e9aed9a584c9857d0674099


--

___
Python tracker 

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



[issue44174] Unclear meaning of _Private__names in enum docs.

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
keywords: +patch
pull_requests: +27392
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29116

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-10-20 Thread Damien George


Damien George  added the comment:

It looks like this change introduced a subtle, and maybe intended (?), 
behavioural change.

Consider (from MicroPython's test suite):

def f():
n = 0 
while True:
n = yield n + 1 
print(n)

g = f()
try:
g.send(1)
except TypeError:
print("caught")

print(g.send(None))
print(g.send(100))
print(g.send(200))

This used to work prior to commit b37181e69209746adc2119c471599a1ea5faa6c8.  
But after that commit it fails on the print(g.send(None)) because the generator 
is now stopped.

--
nosy: +dpgeorge

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 2a9ab75af32b1ee9f210ae2a0718990687d0f79d by Ethan Furman in 
branch '3.10':
bpo-44559: [Enum] restore fixes lost in 3.9 reversion (GH-29114)
https://github.com/python/cpython/commit/2a9ab75af32b1ee9f210ae2a0718990687d0f79d


--

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:

I'm confused -- your initial report talks about pickling fields, but your tests 
are pickling the entire class... what am I missing?

--

___
Python tracker 

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



[issue30238] 2to3 doesn't detect or fix Exception indexing

2021-10-20 Thread Daniel Lenski


Daniel Lenski  added the comment:

Why was this closed?

As I wrote in a previous comment, this situation can be automatically 
identified and addressed via static analysis in the vastly-predominant case, 
where the Exception object is assigned via an `exception ... as exc:` clause.

--

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-20 Thread Brett Cannon


Brett Cannon  added the comment:

Status is now:

- math/cmath conflict with a build rule in Makefile.pre.in
- _dbm needs more logic/comments (at least on macOS)
- nis needs more logic/comments (at least on macOS)

And the following modules are completely missing from the file:
- _bz2
- _ctypes
- _decimal
- _multiprocessing
- _posixshmem
- _scproxy
- _sqlite3
- _uuid

--
stage: patch review -> 

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-20 Thread miss-islington


miss-islington  added the comment:


New changeset dd86f63b551c8c255c6d8082c02f35608d294db9 by Brett Cannon in 
branch 'main':
bpo-45548: add some missing entries to `Modules/Setup` (GH-29115)
https://github.com/python/cpython/commit/dd86f63b551c8c255c6d8082c02f35608d294db9


--
nosy: +miss-islington

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric V. Smith


Eric V. Smith  added the comment:

I get an error with 3.8.10, but not on the main branch (3.11). I don't have 
other versions handy to test.

Removing 3.6, as it's no longer getting bug fixes, and this doesn't look like a 
security issue.

--
nosy: +eric.smith
versions:  -Python 3.6

___
Python tracker 

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



[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

> Yes, precisely. Besides being an unreachable long abs path, it might have 
> been deleted since last visited. I’m working on a few more odd test cases.

Ah, the deleted case.  Sounds like LBYL wouldn’t work in that case then. :(

--

___
Python tracker 

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



[issue33277] Deprecate __loader__, __package__, and __cached__ on modules

2021-10-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Oct 20, 2021, at 08:28, Eric Snow  wrote:
> 
> The only catch I see is where the module's code sets one of the attrs.  Would 
> the proxy (or import machinery) pick those up, or maybe for some of them emit 
> a warning or fail?
> 
> We could also skip the proxy and add the properties to ModuleType directly, 
> no?

My initial idea was to proxy from the ModuleType to the ModuleSpec and I 
started down that path, but hacking in C is much more painful than 
experimenting in Python, so that’s why I did my WIP branch (i.e. just to play 
with the feasibility of it).

Thus I had planned to keep the actual attribute values in the ModuleSpec and 
essentially implement a getattro and setattro in the ModuleType that proxied 
sets and gets to the ModuleSpec.

--

___
Python tracker 

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



[issue33277] Deprecate __loader__, __package__, and __cached__ on modules

2021-10-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Oct 20, 2021, at 08:18, Eric Snow  wrote:

> The spec identifies how a module should be loaded (or how it was loaded and 
> should be reloaded).  We should be careful to preserve that identify and not 
> invite uses to modify the spec after (or while) the module is loaded.  PEP 
> 451 talks about the difference a little, but I'm pretty sure it came up in 
> more detail in discussions about the PEP at that time.

It’s frankly not good enough to capture the *intent* of these attributes in a 
PEP.  We need to be clear in the documentation about their purpose and we need 
to be clear about when to use or set either the module attribute or the spec 
attribute.  The current situation is ambiguous and possibly misleading.  But 
maybe it’s “just” a documentation issue?

--

___
Python tracker 

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



[issue33277] Deprecate __loader__, __package__, and __cached__ on modules

2021-10-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Oct 20, 2021, at 11:31, Brett Cannon  wrote:
> 
>> +1 on a proxy (with read-only attrs) for everything but __name__, __file__, 
>> and __path__ (which can all be different than the spec).
> 
> I'm -1 on a proxy as that doesn't simplify the situation. Having (nearly) 
> duplicate attributes is confusing and I have yet to see it benefit anyone.

If we don’t implement a proxy to enforce equivalence, then we shouldn’t say as 
such in the documentation.  And we should be much clearer about what the 
purpose of the spec is versus the module attributes.

--

___
Python tracker 

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



[issue45542] Using multiple comparison operators can cause performance issues

2021-10-20 Thread Tim Peters


Tim Peters  added the comment:

I think Dennis's example is fatal: from section 6.10 ("Comparisons"):

"""
Comparisons can be chained arbitrarily, e.g., `x < y <= z` is equivalent to `x 
< y and y <= z`, except that y is evaluated only once (but in both cases z is 
not evaluated at all when x < y is found to be false).
"""

So doing LOAD_FAST twice on x (in `1 < x < 3`) is prohibited by the language 
definition. Doesn't matter to this whether it's plain `x` or `f(x)` where `f()` 
is some arbitrary function: the object the middle comparand signifies is fixed 
at whatever it was when the the first comparison is evaluated.

--
nosy: +tim.peters

___
Python tracker 

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



[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Jeremy

Jeremy  added the comment:

Yes, precisely. Besides being an unreachable long abs path, it might have been 
deleted since last visited. I’m working on a few more odd test cases.

--

___
Python tracker 

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



[issue45540] module.__package__ and module.__spec__.parent have different semantics

2021-10-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Oct 20, 2021, at 11:38, Eric Snow  wrote:
> 
> Regardless, I expect the primary reason __package__ is writable is
> because modules have never had any read-only attrs.

So historical accident mostly.

> The more important question now is, when is __package__ ever modified?
> I can think of 2 cases:
> 
> 1. legacy (pre-451) importers set it when they load the module
> 2. someone wants to customize the import system without writing an importer
> 
> With the latter, specifically they are trying to change how the module
> is reloaded or submodules are imported.  In that case there should
> probably be an explicit way to do so without having to hack the import
> machinery.
> 
> My only concern with any support/encouragement for modifying the spec
> after import is it results in less confidence about how the module was
> imported originally.

I guess a question to answer then is whether we philosophically want the module 
attributes to be equivalent to the spec attributes.  And by equivalent, I mean 
enforced to be exactly so, and thus a proxy.  To me, the duplication is a wart 
that we should migrate away from so there’s only one place for these 
attributes, and that should be the spec.

Here is the mapping we currently describe in the docs:

mod.__name__ === __spec__.name
mod.__package__ === __spec__.parent
mod.__loader__ === __spec__.loader
mod.__file__ === __spec__.origin
mod.__path__ === __spec__.submodule_search_locations
mod.__cached__ === __spec__.cached

But right now, they don’t have to stay in sync, and I don’t think it’s 
reasonable to put the onus on the user to keep them in sync, because it’s 
unclear what code uses which attribute.  Okay, so you can just set them both to 
be safe, but then you can’t do that with __spec__.parent/__package__

This is what leads me to think that having a proxy to keep them in sync and 
relaxing the read-only restriction is the path forward, even if writing 
__package__ doesn’t make sense.  It also seems like the easier way to keep 
backward compatibility, rather than enforcing read-only on __package__ to match 
__spec__.parent.

So the question is less about whether this is useful than whether it will break 
things if they write to it.

--

___
Python tracker 

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



[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

Does this mean that CWD could be in a directory that you couldn't chdir() back 
into?

--
nosy: +barry

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-20 Thread Brett Cannon


Change by Brett Cannon :


--
keywords: +patch
pull_requests: +27391
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29115

___
Python tracker 

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



[issue23902] let exception react to being raised or the setting of magic properties (like __cause__) within Python

2021-10-20 Thread Irit Katriel


Irit Katriel  added the comment:

> It seems sufficient to call a magic method on the exception immediately after 
> these the traceback/cause/context parameters have been set while it is being 
> raised


What should happen if this callback raises an exception?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43678] TypeError: get() got an unexpected keyword argument 'vars'

2021-10-20 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
type:  -> behavior

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-20 Thread Brett Cannon


New submission from Brett Cannon :

`Modules/Setup` is currently incomplete/broken. Some things are completely 
missing from it, while others won't work if you uncomment them in the file.

When trying to compile a completely static CPython interpreter I ran into the 
following issues:

- _weakref is listed twice
- _testcapi can't be statically compiled
- math/cmath conflict with a build rule in Makefile.pre.in
- _dbm needs more logic/comments (at least on macOS)
- nis needs more logic/comments (at least on macOS)

And the following modules are completely missing from the file:
- _ctypes
- _decimal
- _lsprof
- _lzma
- _multiprocessing
- _opcode
- _posixshmem
- _queue
- _scproxy
- _sqlite3
- _testbuffer
- _testipmortmultiple
- _testmultiphase
- _uuid
- xxsubinterpreters
- xxtestfuzz
- ossaudiodev
- xxlimited
- xxlimited_35

--
assignee: brett.cannon
components: Build
messages: 404548
nosy: brett.cannon
priority: low
severity: normal
status: open
title: Update Modules/Setup
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



[issue43678] TypeError: get() got an unexpected keyword argument 'vars'

2021-10-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume something like this:
>>> {}.get(vars=1)
Traceback (most recent call last):
  File "", line 1, in 
{}.get(vars=1)
TypeError: get() takes no keyword arguments  # 3.8+

Report is 3.7.

--
nosy: +terry.reedy
resolution: rejected -> not a bug

___
Python tracker 

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



[issue45530] Improve listobject.c's unsafe_tuple_compare()

2021-10-20 Thread Tim Peters


Tim Peters  added the comment:

It's rare that an optimization is a _pure_ win. Some cases win, others lose. 
There's almost never "a proof" of net gain ending with "QED".

Of course it's dead easy to construct examples where "many duplicates in the 
first tuple position" rules, and even easy to construct realistic examples.

But, as you already said in the SO report, in those cases it's a better idea to 
do multiple single-key sorts instead of a single multiple-keys-in-a-tuple sort. 
The base sorting algorithm can exploit duplicates in a single-key sort - 
indeed, the more duplicates there are, the more benefit it can get.

The sorting HOWTO could do a service by discussing this for CPython's sorting 
algorithm - it's not obvious, and can have major effects.

In the meantime, I'm only aiming to speed tuple keys for cases where they're 
well-suited to begin with: the first tuple elements _are_ mostly distinct. 
Giving up a significant win for the relative handful of people who know how to 
exploit the algorithm is not worth it, to me, to avoid making suboptimal uses 
even less optimal.

I'm more a pragmatist than a Utopian :-;

Extending the idea to positions beyond the first is dubious on those grounds: 
if the first tuple positions in fact often match, then the optimization has 
already backfired. Time to admit defeat then, not double down on failed 
arrogance ;-)

One idea I'm playing with: keep track of how often, during a tuple-key sort, a 
compare _is_ resolved by the first elements. Then adjust 
`unsafe_tuple_compare()` to switch to "the other" approach when "the current" 
approach isn't working out.

--

___
Python tracker 

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



[issue40051] Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)

2021-10-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

As the title suggested, this is a generic help(module) issue that involves 
several library modules, including idlelib.  It just happened to be reported 
for 2to3.  For example, the generated text for 
  import idlelib; help(idlelib)
includes
  MODULE REFERENCE
https://docs.python.org/3.11/library/idlelib.html
It should be .../idle.html.

The holdup is that I was not then willing to unilaterally decide which of the 3 
possible solutions I listed should be pursued.  Maybe just 3, maybe a mix of 1 
and 3.

--
components:  -Documentation
nosy:  -zach.ware
stage: needs patch -> test needed
title: Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?) -> Give 
proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)
versions:  -Python 3.10, Python 3.9

___
Python tracker 

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



[issue33347] zlibmodule undefined reference

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue27491] Errors when building with UNICODE character set

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue8508] 2to3 fixer for gettext's .ugettext

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: pending -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue39747] test_os debug assertion failure

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau


Eric Cousineau  added the comment:

Thinking on it some more, I the current `Enum` metaclass doesn't distinguish 
between nested class and normal field, so it wraps it, thus why `pickle` gets 
confused.

Perhaps it's possible to recognize this case - the class w/ `__qualname__` can 
be checked to see if it's nested.

If so, then options are (a) skip wrapping the field, (b) failing fast, or (c) 
"no fix"?

--

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
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



[issue45547] Modernize the importlib loaders

2021-10-20 Thread Filipe Laíns

Change by Filipe Laíns :


--
title: Modenize the importlib loaders -> Modernize the importlib loaders

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Vadim Pushtaev


Change by Vadim Pushtaev :


--
nosy: +Vadim Pushtaev
nosy_count: 7.0 -> 8.0
pull_requests: +27390
pull_request: https://github.com/python/cpython/pull/24244

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Ashley Whetter


Change by Ashley Whetter :


--
nosy: +AWhetter
nosy_count: 6.0 -> 7.0
pull_requests: +27389
pull_request: https://github.com/python/cpython/pull/21296

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
pull_requests: +27388
pull_request: https://github.com/python/cpython/pull/15249

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
nosy: +phsilva
nosy_count: 5.0 -> 6.0
pull_requests: +27387
pull_request: https://github.com/python/cpython/pull/18654

___
Python tracker 

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



[issue40051] Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)

2021-10-20 Thread Zachary Ware


Zachary Ware  added the comment:

This one got caught up in the purge of 2to3 issues, but it's about more than 
just 2to3.  Reopening.

--
components: +Documentation, Library (Lib) -2to3 (2.x to 3.x conversion tool)
nosy: +zach.ware
resolution: wont fix -> 
stage: resolved -> needs patch
status: closed -> open
superseder: Close 2to3 issues and list them here -> 
title: Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?) -> 
Dead link in help(idlelib/turtledemo/tkinter.sub/test_*/?)
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
pull_requests: +27386
pull_request: https://github.com/python/cpython/pull/14835

___
Python tracker 

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



[issue44559] Enum: revert to 3.9

2021-10-20 Thread Ethan Furman


Change by Ethan Furman :


--
pull_requests: +27385
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29114

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau


Eric Cousineau  added the comment:

Ah, forgot to include error message:

```



E
...
_pickle.PicklingError: Can't pickle : it's not the same object as 
__main__.DoesNotWork.NestedValue2
```

--

___
Python tracker 

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



[issue40051] Dead link in help(lib2to3/idlelib/turtledemo/tkinter.sub/test_*/?)

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
components: +2to3 (2.x to 3.x conversion tool) -Documentation, Library (Lib)
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45547] Modenize the importlib loaders

2021-10-20 Thread Filipe Laíns

New submission from Filipe Laíns :

ResourceLoader[1] is deprecated in favor of ResourceReader, which itself is 
surpassed by TraversableResources.

Would it make sense to replace ResourceLoader usages with ResourceReader in the 
importlib loaders?
And perhaps, would it make sense to replace them with the files()/Traversable 
protocol instead?

IMO this could simplify the code a bit, but that's subjective I guess, and 
better re-use the bytecode caching mechanism in SourceLoader, by providing an 
equivalent based on files()/Traversable instead.

This could also help push to add support for non filesystem based loaders in 
other parts of the code, like py_compile, which currently only supports 
operations on the filesystem.

Is this something we are interested in -- modernizing the importlib loaders 
with, arguably, better abstractions -- or do we want to keep the old protocols 
around?

[1] 
https://docs.python.org/3/library/importlib.html#importlib.abc.ResourceLoader

--
messages: 404540
nosy: FFY00, barry, brett.cannon, eric.snow, jaraco, ncoghlan
priority: normal
severity: normal
status: open
title: Modenize the importlib loaders

___
Python tracker 

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



[issue36481] telnetlib process_rawq() callback

2021-10-20 Thread Gökhan Öztürk

Change by Gökhan Öztürk :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue42517] Enum: do not convert private names into members

2021-10-20 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 9733c9651afad84ab2f010e9e68b7c03976ea9f3 by Ethan Furman in 
branch '3.9':
[3.9] bpo-42517: [ENUM] update docs for changes coming in 3.11 (GH-29113)
https://github.com/python/cpython/commit/9733c9651afad84ab2f010e9e68b7c03976ea9f3


--

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-10-20 Thread Eric Cousineau


New submission from Eric Cousineau :

I seem cannot pickle enum values from an enum class w/ a nested frozen 
dataclass.

I can pickle a field from a normal class w/ a nested frozen dataclass, and I 
can pickle a field from an enum with a top-level frozen dataclass - perhaps 
it's some interplay with `__qualname__` and `enum.py`?.

See attached file for sample test.
I checked on 3.6.9, 3.9.7, and 3.10.0.

Looked around, couldn't easily find existing issue for this.

--
components: Library (Lib)
files: enum_test.py
messages: 404539
nosy: Eric Cousineau
priority: normal
severity: normal
status: open
title: Unable to pickle enum with nested frozen dataclass?
type: behavior
versions: Python 3.10, Python 3.6, Python 3.9
Added file: https://bugs.python.org/file50378/enum_test.py

___
Python tracker 

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



[issue37709] CSVReader ignores dialect.lineterminator

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue10954] csv.reader/writer to raise exception if mode is binary or newline is not ''

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue15317] Source installation sets incorrect permissions for Grammar3.2.3.final.0.pickle

2021-10-20 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

workaround: don't run make as root.  run configure & make in a user account and 
only run your final make install as root after that.  (sudo make install or 
whatnot)

2to3 and lib2to3 are deprecated so this won't be getting fixed (though it's 
more of a Makefile issue)

--
nosy: +gregory.p.smith
resolution:  -> wont fix
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue12771] 2to3 -d adds extra whitespace

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: test needed -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Martin DeMello


Change by Martin DeMello :


--
nosy: +martindemello
nosy_count: 4.0 -> 5.0
pull_requests: +27384
pull_request: https://github.com/python/cpython/pull/10618

___
Python tracker 

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



[issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue17393] stdlib import mistaken for local by import_fixer

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Romuald Brunet


Change by Romuald Brunet :


--
nosy: +Romuald
nosy_count: 3.0 -> 4.0
pull_requests: +27383
pull_request: https://github.com/python/cpython/pull/16826

___
Python tracker 

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



[issue39154] "utf8" not always a synonym for "utf-8" in lib2to3

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: test needed -> 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



[issue6899] Base.replace breaks tree

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue43678] TypeError: get() got an unexpected keyword argument 'vars'

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> rejected
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



[issue8029] bug in 2to3 dealing with "print FOO, " followed by "sys.stdout.write('')"

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue2350] 'exceptions' import fixer

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue36313] error: [Errno 13] Permission denied: '/usr/local/lib/python3.7/lib2to3/Grammar3.7.2.final.0.pickle'

2021-10-20 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Source installation sets incorrect permissions for 
Grammar3.2.3.final.0.pickle

___
Python tracker 

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



[issue45542] Using multiple comparison operators can cause performance issues

2021-10-20 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The PR changes behavior slightly:

def f():
class A:
def __lt__(self, other):
nonlocal x
x += 100
return True
a = A()
x = 1
print(a < x < 10)
x = 1
print(a < x and x < 10)

### Before ###
>>> f()
True
False

### After ###
>>> f()
False
False


So strictly speaking, this would be backwards-incompatible. But morally, I am 
not totally sure.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue11056] 2to3 fails for inner __metaclass__ class definition

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue12942] Shebang line fixer for 2to3

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: test needed -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue12613] itertools fixer fails

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45543] IDLE shell Windows EOL

2021-10-20 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The current behavior is documented in Help => IDLE Help "User output in Shell".

--
resolution:  -> not a bug
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



[issue18477] fix_import (2to3 fixer) is not case-sensitive

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: test needed -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue13272] 2to3 fix_renames doesn't rename string.lowercase/uppercase/letters

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue37654] 2to3 no-ops on embeddable distribution

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Aldwin Pollefeyt


Change by Aldwin Pollefeyt :


--
nosy: +aldwinaldwin
nosy_count: 2.0 -> 3.0
pull_requests: +27382
pull_request: https://github.com/python/cpython/pull/15268

___
Python tracker 

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



[issue5664] 2to3 wont convert Cookie.Cookie properly

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue19510] lib2to3.fixes.fix_import gets confused if implicit relative imports and absolute imports are on the same line

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue38681] 2to3 Conversion Result using BlankLine() can be Syntactically Incorrect

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45544] Close 2to3 issues and list them here

2021-10-20 Thread Samuel Tatasurya


Change by Samuel Tatasurya :


--
keywords: +patch
nosy: +samtatasurya
nosy_count: 1.0 -> 2.0
pull_requests: +27381
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17096

___
Python tracker 

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



[issue39290] lib2to3.fixes.fix_import: support imports_as_name in traverse_imports

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue39670] 2to3 fix_apply tries to fix user-defined apply function calls

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue39683] 2to3 fix_exitfunc suggests duplicated import of atexit module

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue40547] 2to3 raise can silently remove code from old 2.4 string exceptions

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue38032] lib2to3 doesn't parse Python 3 identifiers containing non-spacing marks

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue45545] chdir __exit__ is not safe

2021-10-20 Thread Jeremy


New submission from Jeremy :

The way that contextlib.chdir currently restores the old working directory, an 
exception is raised if the program was already close to or beyond a system's 
PATH_MAX. The context manager has no issue crafting the path in __enter__ 
because os.getcwd() can return a path that is longer than PATH_MAX, but when 
used in __exit__ os.chdir() cannot use a path that long.

I think an __exit__ should be as cautious as possible to not raise as the 
exception can occur far away from where the context manager was created. Its 
also doesn't reflect the programmer actually using the context manager 
incorrectly as they might not have any control or care where the process was 
started, yet if it happened to already be at a deep path when launched, any use 
of chdir anywhere would cause exceptions.

I have tested this on macOS 11.13 using APFS but I am sure it would also fail 
on other macs and Linuxes. I don't know about Windows. Note I originally 
created this test as a patch to Lib/tests/test_contextlib.py but libregrtest 
uses os.getcwd() in its runner and that disrupts the traceback and 
misidentifies the cause of failure. Test file:

```python
import os
import shutil
from contextlib import chdir


def test_long_path():
# NAME_MAX of 255
long_filename = "_".join(["testdir"]*32)
long_path_end = startingwd = os.getcwd()
try:
# I thought this would have to be 16, i.e. a path length over 4096, 
PATH_MAX
# but seemingly just crossing 1050 is enough to fail
for _ in range(4):
os.mkdir(long_filename)
os.chdir(long_filename)
long_path_end = os.path.join(long_path_end, long_filename)
os.mkdir(long_filename)
long_path_end = os.path.join(long_path_end, long_filename)
with chdir(long_filename):
#self.assertEqual(os.getcwd(), long_path_end)
assert os.getcwd() == long_path_end
print("passed")
finally:
shutil.rmtree(os.path.join(startingwd, long_filename), 
ignore_errors=True)


test_long_path()
```

And output:
```
$ ./python.exe ./test_chdir.py
passed
Traceback (most recent call last):
  File "/Users/ucodery/git/cpython/./test_chdir.py", line 27, in 
test_long_path()

  File "/Users/ucodery/git/cpython/./test_chdir.py", line 19, in test_long_path
with chdir(long_filename):
^^
  File "/Users/ucodery/git/cpython/Lib/contextlib.py", line 781, in __exit__
os.chdir(self._old_cwd.pop())
^
OSError: [Errno 63] File name too long: 
'/Users/ucodery/git/cpython/testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir/testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir/testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir/testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_te
 
stdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir_testdir'
```

--
files: test_chdir.py
messages: 404534
nosy: ucodery
priority: normal
severity: normal
status: open
title: chdir __exit__ is not safe
type: behavior
versions: Python 3.11
Added file: https://bugs.python.org/file50377/test_chdir.py

___
Python tracker 

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



[issue40697] add fissix as a lib2to3 alternative

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue41185] lib2to3 generation of pickle files is racy

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue12611] 2to3 crashes when converting doctest using reduce()

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue30238] 2to3 doesn't detect or fix Exception indexing

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
stage: test needed -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue44259] lib2to3 does not accept "exec" as name

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue41110] 2to3 reports some files as both not changing and having been modified

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue31143] lib2to3 requires source files for fixes

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue29141] error in 2to3

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue30099] Lib2to3 fails with unreadable pickle file

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue33991] lib2to3 should parse f-strings

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue33338] [lib2to3] Synchronize token.py and tokenize.py with the standard library

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue35708] lib2to3 failed to convert as refactor's fixes not search.pyc files

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue35417] Double parenthesis in print function running 2to3 in already correct call

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue9621] Graphviz output for 2to3 fixer patterns

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue13253] 2to3 fix_renames renames sys.maxint only in imports

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



[issue27855] 2to3: Wrong code output w/ has_key without trailing space

2021-10-20 Thread Irit Katriel


Change by Irit Katriel :


--
status: open -> closed
superseder:  -> Close 2to3 issues and list them here

___
Python tracker 

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



  1   2   3   4   >