[Python-announce] svcs: A Flexible Service Locator

2023-09-06 Thread Hynek Schlawack
Greetings,

I’m very happy to announce that the first stable version 23.20.0 of my svcs 
(read: services) package is up on PyPI: https://pypi.org/project/svcs/

I have spent the past months trial-and-erroring, talking to everybody who 
wouldn't run away, and writing docs. So many docs.

I’ve put that effort into it because I find it life-changing for writing web 
applications and I REALLY want y’all understand WHY.

When talking to people, two patterns repeated themselves:

1. The average company has 3.5 half-baked implementations of svcs.
2. People either get very excited or very indifferent.

The pattern it implements is called a service locator, but in most cases it’s 
just a convenient abstraction for plucking runtime-dependencies (correctly: 
SERVICES) from request objects + lifecycle features like instantiation/cleanups 
+ introspection + better testability.

While implementing it, I've also noticed how incredibly muddy and overloaded 
the vernacular around these topics is (c.f. “services”), so I've spent at least 
as much time writing a glossary as I've spent writing code: 
https://svcs.hynek.me/en/latest/glossary.html

It comes with integration for AIOHTTP, FastAPI, Flask, Pyramid, and Starlette 
and it’s very easy to integrate with others.

As you’d expect from a modern Python package, it has (optional) first-class 
support for static typing as well as asyncio.

It’s been a very long time since I got this excited about a project of mine, 
but that excitement comes with anxiety and endless obsessing to the point that 
my friends started ghosting me which I take for the signal that it's time.

So if this has piqued your interest, here are more details: 
https://svcs.hynek.me/en/latest/why.html
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] attrs 23.1.0

2023-04-16 Thread Hynek Schlawack
I’m happy to announce a new release of attrs!

attrs is the direct ancestor of – and the inspiration for – dataclasses in the 
standard library and remains the more powerful toolkit for creating regular 
classes without getting bogged down with writing repetitive boilerplate code: 




(alternatively, see  for a 
richer-formatted version of the following)


Backwards-incompatible Changes

-   Python 3.6 has been dropped and packaging switched to static package data 
using Hatch. #993

Deprecations

-   The support for zope-interface via the attrs.validators.provides validator 
is now deprecated and will be removed in, or after, April 2024.

The presence of a C-based package in our developement dependencies has 
caused headaches and we're not under the impression it's used a lot.

Let us know if you're using it and we might publish it as a separate 
package. #1120

Changes

-   attrs.filters.exclude() and attrs.filters.include() now support the passing 
of attribute names as strings. #1068

-   attrs.has() and attrs.fields() now handle generic classes correctly. #1079

-   Fix frozen exception classes when raised within e.g. 
contextlib.contextmanager, which mutates their __traceback__ attributes. #1081

-   @frozen now works with type checkers that implement PEP-681 (ex. pyright). 
#1084

-   Restored ability to unpickle instances pickled before 22.2.0. #1085

-   attrs.asdict()'s and attrs.astuple()'s type stubs now accept the 
attrs.AttrsInstance protocol. #1090

-   Fix slots class cellvar updating closure in CPython 3.8+ even when __code__ 
introspection is unavailable. #1092

-   attrs.resolve_types() can now pass include_extras to 
typing.get_type_hints() on Python 3.9+, and does so by default. #1099

-   Added instructions for pull request workflow to CONTRIBUTING.md. #1105

-   Added type parameter to attrs.field() function for use with 
attrs.make_class().

Please note that type checkers ignore type metadata passed into 
make_class(), but it can be useful if you're wrapping attrs. #1107

-   It is now possible for attrs.evolve() (and attr.evolve()) to change fields 
named inst if the instance is passed as a positional argument.

Passing the instance using the inst keyword argument is now deprecated and 
will be removed in, or after, April 2024. #1117

-   attrs.validators.optional() now also accepts a tuple of validators (in 
addition to lists of validators). #1122

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] structlog 23.1.0

2023-04-06 Thread Hynek Schlawack
I’m happy to announce a new release of structlog!

With more than 7 million downloads per month, structlog is the best solution 
for production-ready structured logging in Python. It doesn’t just allow you to 
log key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intrigued 
but not convinced!

My heartfelt thanks go to my generous GitHub sponsors 
 and companies subscribing to structlog on 
Tidelift .

That's the support that made me maintain structlog for almost a decade with no 
end in sight! <3



(alternatively, see  for a 
richer-formatted version of the following)


Highlights

This release brings the hybrid approach to sync / async logging to structlog's 
standard library integration. You don't have to configure anything anymore, 
simply prepend the method name with an a and await it: await logger.ainfo("this 
is async!"). structlog.stdlib.AsyncBoundLogger will probably be deprecated in 
the future.

This release also brings support for FORCE_COLOR and NO_COLOR to structlog's 
default configuration. structlog was originally not meant to be used without 
configuration, but times have changed and we're breaking new ground!

Added

-   structlog.stdlib.BoundLogger now has, analogously to our native logger, a 
full set of async log methods prefixed with an a: await log.ainfo("event!") #502

-   The default configuration now respects the presence of FORCE_COLOR 
(regardless of its value, unless an empty string). This disables all heuristics 
whether it makes sense to use colors. #503

-   The default configuration now respects the presence of NO_COLOR (regardless 
of its value, unless an empty string). This disables all heuristics whether it 
makes sense to use colors and overrides FORCE_COLOR. #504

Fixed

-   ConsoleRenderer now reuses the _figure_out_exc_info to process the exc_info 
argument like ExceptionRenderer does. This prevents crashes if the actual 
Exception is passed for the exc_info argument instead of a tuple or True. #482

-   FilteringBoundLogger.aexception() now extracts the exception info using 
sys.exc_info() before passing control to the asyncio executor (where original 
exception info is no longer available). #488

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] attrs 22.3.0

2022-12-21 Thread Hynek Schlawack
I’m happy to announce a new release of attrs!

attrs is the direct ancestor of – and the inspiration for – dataclasses in the 
standard library and remains the more powerful toolkit for creating regular 
classes without getting bogged down with writing repetitive boilerplate code: 




It's been a lot busier than the changelog indicates, but a lot of the work 
happened under the hood (like some impressive performance improvements). But 
we've got still one big new feature that's are worthy the holidays:

Fields now have an alias argument that allows you to set the field's name in 
the generated __init__ method. This is especially useful for those who aren't 
fans of attrs's behavior of stripping underscores from private attribute names.

Special Thanks

This release would not be possible without my generous sponsors! Thank you to 
all of you making sustainable maintenance possible! If you would like to join 
them, go to https://github.com/sponsors/hynek and check out the sweet perks!

Above and Beyond

Variomedia AG (@variomedia), Tidelift (@tidelift), Sentry (@getsentry), 
HiredScore (@HiredScore), FilePreviews (@filepreviews), and Daniel Fortunov 
(@asqui).

Maintenance Sustainers

@rzijp, Adam Hill (@adamghill), Dan Groshev (@si14), Tamir Bahar (@tmr232), Adi 
Roiban (@adiroiban), Magnus Watn (@magnuswatn), David Cramer (@dcramer), Moving 
Content AG (@moving-content), Stein Magnus Jodal (@jodal), Iwan Aucamp 
(@aucampia), ProteinQure (@ProteinQure), Jesse Snyder (@jessesnyder), Rivo Laks 
(@rivol), Thomas Ballinger (@thomasballinger), @medecau, Ionel Cristian Mărieș 
(@ionelmc), The Westervelt Company (@westerveltco), Philippe Galvan 
(@PhilippeGalvan), Birk Jernström (@birkjernstrom), Jannis Leidel (@jezdez), 
Tim Schilling (@tim-schilling), Chris Withers (@cjw296), and Christopher Dignam 
(@chdsbd).

Not to forget 2 more amazing humans who chose to be generous but anonymous!

Full Changelog

Backwards-incompatible Changes

-   Python 3.5 is not supported anymore. #988

Deprecations

-   Python 3.6 is now deprecated and support will be removed in the next 
release. #1017

Changes

-   attrs.field() now supports an alias option for explicit __init__ argument 
names.

Get __init__ signatures matching any taste, peculiar or plain! The PEP 681 
compatible alias option can be use to override private attribute name mangling, 
or add other arbitrary field argument name overrides. #950

-   attrs.NOTHING is now an enum value, making it possible to use with e.g. 
typing.Literal. #983

-   Added missing re-import of attr.AttrsInstance to the attrs namespace. #987

-   Fix slight performance regression in classes with custom __setattr__ and 
speedup even more. #991

-   Class-creation performance improvements by switching performance-sensitive 
templating operations to f-strings.

You can expect an improvement of about 5% -- even for very simple classes. 
#995

-   attrs.has() is now a TypeGuard for AttrsInstance. That means that type 
checkers know a class is an instance of an attrs class if you check it using 
attrs.has() (or attr.has()) first. #997

-   Made attrs.AttrsInstance stub available at runtime and fixed type errors 
related to the usage of attrs.AttrsInstance in Pyright. #999

-   On Python 3.10 and later, call abc.update_abstractmethods() on dict classes 
after creation. This improves the detection of abstractness. #1001

-   attrs's pickling methods now use dicts instead of tuples. That is safer and 
more robust across different versions of a class. #1009

-   Added attrs.validators.not_(wrapped_validator) to logically invert 
wrapped_validator by accepting only values where wrapped_validator rejects the 
value with a ValueError or TypeError (by default, exception types 
configurable). #1010

-   The type stubs for attrs.cmp_using() now have default values. #1027

-   To conform with PEP 681, attr.s() and attrs.define() now accept unsafe_hash 
in addition to hash. #1065

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] structlog 22.2.0

2022-11-19 Thread Hynek Schlawack
I’m happy to announce a new release of structlog!

With more than 4 million downloads per month, structlog is the best solution 
for production-ready structured logging in Python. It doesn’t just allow you to 
log key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intrigued 
but not convinced!

---

This is another (too) big release, but before I go into new features, allow me 
to beg you to check out structlog's documentation: .

I've spent easily half of the time on bringing is up to date, restructuring, 
and adding usage recipes. Not new in this release, but did you know that the 
standard library chapter has flowcharts that give you as visual explanations of 
how the various methods work? This is usually the biggest sticking point when 
starting to use structlog.

Feature-wise the big thing is that structlog's internal (and extremely fast) 
loggers (the one created using structlog.make_filtering_bound_logger() got two 
new features that people have asked for forever:

1.  String interpolation: log.info("hello %s!", "world") works now!
2.  Async! Each logging method has an async version: await log.ainfo("hello 
%s!", "world") is the same thing as above, but async.

Special Thanks

This release would not be possible without my generous sponsors! Thank you to 
all of you making sustainable maintenance possible! If you would like to join 
them, go to https://github.com/sponsors/hynek and check out the sweet perks!

Above and Beyond

Variomedia AG (@variomedia), Tidelift (@tidelift), Sentry (@getsentry), 
HiredScore (@HiredScore), FilePreviews (@filepreviews), and Daniel Fortunov 
(@asqui).

Maintenance Sustainers

@rzijp, Adam Hill (@adamghill), Dan Groshev (@si14), Tamir Bahar (@tmr232), Adi 
Roiban (@adiroiban), Magnus Watn (@magnuswatn), David Cramer (@dcramer), Moving 
Content AG (@moving-content), Stein Magnus Jodal (@jodal), Iwan Aucamp 
(@aucampia), ProteinQure (@ProteinQure), Jesse Snyder (@jessesnyder), Rivo Laks 
(@rivol), Thomas Ballinger (@thomasballinger), @medecau, Ionel Cristian Mărieș 
(@ionelmc), The Westervelt Company (@westerveltco), Philippe Galvan 
(@PhilippeGalvan), Birk Jernström (@birkjernstrom), Jannis Leidel (@jezdez), 
Tim Schilling (@tim-schilling), Chris Withers (@cjw296), and Christopher Dignam 
(@chdsbd).

Not to forget 2 more amazing humans who chose to be generous but anonymous!

Full Changelog

Deprecated

-   Accessing package metadata as attributes on the structlog module is 
deprecated (e.g. structlog.__version__). Please use importlib.metadata instead 
(for Python 3.7: the importlib-metadata PyPI package).
-   The structlog.types module is now deprecated in favor of the 
structlog.typing module. It seems like the Python typing community is settling 
on this name.

Added

-   FilteringBoundLogger (used by default) now allows for string interpolation 
using positional arguments:

>>> log.info("Hello %s! The answer is %d.", "World", 42, x=1)
2022-10-07 10:04.31 [info ] Hello World! The answer is 42. x=1

#454

-   FilteringBoundLogger now also has support for asyncio-based logging. 
Instead of a wrapper class like structlog.stdlib.AsyncBoundLogger, async 
equivalents have been added for all logging methods. So instead of 
log.info("hello") you can also write await log.ainfo("hello") in async 
functions and methods.

This seems like the better approach and if it's liked by the community, 
structlog.stdlib.BoundLogger will get those methods too. #457

Changed

-   The documentation has been heavily overhauled. Have a look if you haven't 
lately! Especially the graphs in the standard library chapter have proven 
valuable to many.
-   The build backend has been switched to Hatch.

Fixed

-   The timestamps in the default configuration now use the correct separator 
(:) for seconds.

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] attrs 22.1.0

2022-07-28 Thread Hynek Schlawack
I’m happy to announce a new release of attrs!

attrs is the direct ancestor of – and the inspiration for – dataclasses in the 
standard library and remains the more powerful toolkit for creating regular 
classes without getting bogged down with writing repetitive boilerplate code: 


My heartfelt thanks go to:

- My generous GitHub sponsors ,
- companies subscribing to attrs on Tidelift 
,
- and people who buy me coffees on !

❤️ That's the support that made me maintain attrs since 2015 with no end in 
sight! ❤️



(alternatively, see  for a 
richer-formatted version of the following)

Highlights

The main features of this release are:

-   The departure of Python 2.7 (enjoy your retirement!),
-   and the arrival of Python 3.11.

We had loftier goals feature-wise, but didn't want to block others embracing 
Python 3.11.

Full Changelog

Backwards-incompatible Changes

-   Python 2.7 is not supported anymore.

Dealing with Python 2.7 tooling has become too difficult for a 
volunteer-run project.

We have supported Python 2 more than 2 years after it was officially 
discontinued and feel that we have paid our dues. All version up to 21.4.0 from 
December 2021 remain fully functional, of course. #936

-   The deprecated cmp attribute of attrs.Attribute has been removed. This does 
not affect the cmp argument to attr.s that can be used as a shortcut to set eq 
and order at the same time. #939

Changes

-   Instantiation of frozen slotted classes is now faster. #898
-   If an eq key is defined, it is also used before hashing the attribute. #909
-   Added attrs.validators.min_len(). #916
-   attrs.validators.deep_iterable()'s member_validator argument now also 
accepts a list of validators and wraps them in an attrs.validators.and_(). #925
-   Added missing type stub re-imports for attrs.converters and attrs.filters. 
#931
-   Added missing stub for attr(s).cmp_using(). #949
-   attrs.validators._in()'s ValueError is not missing the attribute, expected 
options, and the value it got anymore. #951
-   Python 3.11 is now officially supported. #969

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] structlog 22.1.0

2022-07-20 Thread Hynek Schlawack
I’m happy to announce a new release of structlog!

With more than 4 million downloads per month, structlog is the most popular 
solution for structured logging in Python. It doesn’t just allow you to log 
key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intrigued 
but not convinced!

My heartfelt thanks go to:

- My generous GitHub sponsors ,
- companies subscribing to structlog on Tidelift 
,
- and people who buy me coffees on !

That's the support that made me maintain structlog for almost a decade with no 
end in sight! <3



(alternatively, see  
for a richer-formatted version of the following)

Highlights

This is a (too) big release, so it has many highlights!

Firstly, rendering exceptions in machine-readable logs (usually JSON) got a big 
upgrade: thanks to structlog.processors.dict_tracebacks you can now have fully 
structured exceptions in your logs!

To ease getting started with structlog, we're now shipping 
structlog.stdlib.recreate_defaults() that recreates structlog's default 
behavior, but on top of standard library's logging. The output looks the same, 
but it runs through logging's machinery and integrates itself easier. The 
default configuration now also merges your contextvars-based context, so enjoy 
structlog.contextvars.bind_contextvars() without configuring anything!

Another request wish that kept coming up is naming the message key differently 
than event. We're aware that nowadays keys like msg are more common, but 
structlog pre-dates the software that introduced and popularized it. To allow 
for more consistency across your platforms, structlog now ships 
structlog.processors.EventRenamer that allows you to rename the default event 
key to something else and additionally also allows you to rename another key to 
event.

Full Changelog

Removed

-   Python 3.6 is not supported anymore.
-   Pickling is now only possible with protocol version 3 and newer.

Deprecated

-   The entire structlog.threadlocal module is deprecated. Please use the 
primitives from structlog.contextvars instead.

If you're using the modern APIs (bind_threadlocal() / merge_threadlocal()) 
it's enough to replace them 1:1 with their contextvars counterparts. The old 
approach around wrap_dict() has been discouraged for a while.

Currently there are no concrete plans to remove the module, but no patches 
against it will be accepted from now on. #409

Added

-   structlog.processors.StackInfoRenderer now has an additional_ignores 
parameter that allows you to filter out your own logging layer. #396
-   Added structlog.WriteLogger, a faster – but more low-level – alternative to 
structlog.PrintLogger. It works the way PrintLogger used to work in previous 
versions. #403 #404
-   structlog.make_filtering_bound_logger()-returned loggers now also have a 
log() method to match the structlog.stdlib.BoundLogger signature closer. #413
-   Added structured logging of tracebacks via the structlog.tracebacks module, 
and most notably the structlog.tracebacks.ExceptionDictTransformer which can be 
used with the new structlog.processors.ExceptionRenderer to render JSON 
tracebacks. #407
-   structlog.stdlib.recreate_defaults(log_level=logging.NOTSET) that recreates 
structlog's defaults on top of standard library's logging. It optionally also 
configures logging to log to standard out at the passed log level. #428
-   structlog.processors.EventRenamer allows you to rename the hitherto 
hard-coded event dict key event to something else. Optionally, you can rename 
another key to event at the same time, too. So adding EventRenamer(to="msg", 
replace_by="_event") to your processor pipeline will rename the standard event 
key to msg and then rename the _event key to event. This allows you to use the 
event key in your own log files and to have consistent log message keys across 
languages.
-   structlog.dev.ConsoleRenderer(event_key="event") now allows to customize 
the name of the key that is used for the log message.

Changed

-   structlog.make_filtering_bound_logger() now returns a method with the same 
signature for all log levels, whether they are active or not. This ensures that 
invalid calls to inactive log levels are caught immediately and don't explode 
once the log level changes. #401
-   structlog.PrintLogger – that is used by default – now uses print() for 
printing, making it a better citizen for interactive terminal applications. #399
-   structlog.testing.capture_logs now works for already initialized bound 
loggers. #408
-   structlog.processors.format_exc_info() is no longer a function, but an 
instance of structlog.processors.ExceptionRenderer. Its behavior has 

[issue46382] dataclass(slots=True) does not account for slots in base classes

2022-01-17 Thread Hynek Schlawack


Hynek Schlawack  added the comment:

>>> @attrs.define
... class C(Base):
...   a: int
...   b: int
...
>>> C.__slots__
('b', '__weakref__')

We've got a test specifically for this use case: 
https://github.com/python-attrs/attrs/blob/5f36ba9b89d4d196f80147d4f2961fb2f97ae2e5/tests/test_slots.py#L309-L334

--

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



[issue46404] 3.11a4: a small attrs regression

2022-01-16 Thread Hynek Schlawack


Change by Hynek Schlawack :


--
nosy: +hynek

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



[Python-announce] attrs 21.3.0

2021-12-27 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce the release of attrs 21.3.0: 


attrs is the direct ancestor of – and the inspiration for – dataclasses in the 
standard library and remains the more powerful toolkit for creating regular 
classes without getting bogged down with writing identical boilerplate again 
and again: 

Heartfelt thanks go to my generous sponsors 
, companies subscribing on Tidelift 
, and people who bought me a 
coffee on ! Support like that makes me work on 
FOSS on a Saturday afternoon! <3



This is a big release in the history of attrs and finishes an arc that took way 
too long and also delayed this very overdue release. But it's done: import 
attrs that has been talked about for years[1], but fell victim to “just this 
one more thing” has finally landed.

From now on, modern attrs code looks like this:

from attrs import define

@define
class HelloWorld:
modern: bool = True

The define/field APIs have been around for over a year and were very popular, 
now the rest of the package followed suit. I'm very excited that attrs remains 
relevant and keeps evolving over now more than half a decade. If you're curious 
about some of the background, the docs now contain a short explanation and 
history lesson. As long as our users keep pushing us, we will keep pushing 
forward class generation in Python!

Big thanks to my GitHub Sponsors, Tidelift subscribers, and Ko-fi buyers that 
help me mustering the motivation for such long-running project!



Since the release took so long, there's more highlights than we can enumerate 
here, we'd just like to point out a breaking change in the new APIs: converters 
now run on setting attributes by default. If this is causing problems to you, 
you can disable that behavior by setting @define(on_setattr=[]).

Full Changelog

Backward-incompatible Changes

-   When using @define, converters are now run by default when setting an 
attribute on an instance -- additionally to validators. I.e. the new default is 
on_setattr=[attrs.setters.convert, attrs.setters.validate].

This is unfortunately a breaking change, but it was an oversight, 
impossible to raise a DeprecationWarning about, and it's better to fix it now 
while the APIs are very fresh with few users. #835, #886

-   import attrs has finally landed! As of this release, you can finally import 
attrs using its proper name.

Not all names from the attr namespace have been transferred; most notably 
attr.s and attr.ib are missing. See attrs.define and attrs.field if you haven't 
seen our next-generation APIs yet. A more elaborate explanation can be found On 
The Core API Names

This feature is at least for one release provisional. We don't plan on 
changing anything, but such a big change is unlikely to go perfectly on the 
first strike.

The API docs have been mostly updated, but it will be an ongoing effort to 
change everything to the new APIs. Please note that we have not moved -- or 
even removed -- anything from attr!

Please do report any bugs or documentation inconsistencies! #887

Changes

-   attr.asdict(retain_collection_types=False) (default) dumps collection-esque 
keys as tuples. #646, #888
-   __match_args__ are now generated to support Python 3.10's Structural 
Pattern Matching. This can be controlled by the match_args argument to the 
class decorators on Python 3.10 and later. On older versions, it is never added 
and the argument is ignored. #815
-   If the class-level on_setattr is set to attrs.setters.validate (default in 
@define and @mutable) but no field defines a validator, pretend that it's not 
set. #817
-   The generated __repr__ is significantly faster on Pythons with f-strings. 
#819
-   Attributes transformed via field_transformer are wrapped with AttrsClass 
again. #824
-   Generated source code is now cached more efficiently for identical classes. 
#828
-   Added attrs.converters.to_bool(). #830
-   attrs.resolve_types() now resolves types of subclasses after the parents 
are resolved. #842 #843
-   Added new validators: lt(val) (< val), le(va) (≤ val), ge(val) (≥ val), 
gt(val) (> val), and maxlen(n). #845
-   attrs classes are now fully compatible with cloudpickle (no need to disable 
repr anymore). #857
-   Added new context manager attrs.validators.disabled() and functions 
attrs.validators.(set|get)_disabled(). They deprecate 
attrs.(set|get)_run_validators(). All functions are interoperable and modify 
the same internal state. They are not – and never were – thread-safe, though. 
#859
-   attrs.validators.matches_re() now accepts pre-compiled regular expressions 
in addition to pattern strings. 

[Python-announce] argon2-cffi 21.2.0

2021-12-08 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce the release of argon2-cffi 21.2.0!

With more than 13 million downloads per month, argon2-cffi is the most popular 
package for using the competition-winning Argon2 password hash in Python.

If you want more details on Argon2 and why it matters, check out my blog post 
Storing Passwords in a Highly Parallelized World 
.

Heartfelt thanks go to my generous GitHub sponsors 
, companies subscribing on Tidelift 
 (currently nobody :( – 
tell your boss!), and people who bought me a coffee on 
https://ko-fi.com/the_hynek!

Support like that makes me work on FOSS on a Sunday afternoon, so please 
consider supporting me too: ! <3

RELEASE HIGHLIGHTS

- Pre-compiled wheels for most relevant platforms (yes, including ARM!)
- Full type hints.
- Adjusted defaults to RFC 9106 and support to pre-configured profiles.

Full release notes: https://github.com/hynek/argon2-cffi/releases/tag/21.2.0

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce] structlog 21.3.0

2021-11-20 Thread Hynek Schlawack
I’m happy to announce the release of structlog 21.3.0!

With more than 2.5 million downloads per month, structlog is the most popular 
solution for structured logging in Python. It doesn’t just allow you to log 
key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intrigued 
but not convinced!

Heartfelt thanks go to my generous GitHub sponsors 
, companies subscribing on Tidelift 
 (currently nobody :( – 
tell your boss!), and people who bought me a coffee on 
!

Support like that makes me work on FOSS on a Saturday afternoon, so please 
consider supporting me  too! <3

RELEASE HIGHLIGHTS:

The main reason for this comparatively timely release is that aiohttp 3.8's new 
behavior of starting new loops within aiohttp.web.run_app() led to breakage in 
apps that use structlog.stdlib.AsyncBoundLogger.

The one big new feature though is the support for much more powerful processor 
chains within structlog.stdlib.ProcessorFormatter. This took me way too long to 
get right, but I'm excited to share it with you.

This is also the first release without a setup.py. Invoking it was never tested 
and never supported, so now it's gone. Please use standard packaging tools like 
PyPA's build  or flit 
 directly if you want to package 
structlog yourself.

Full changelog:

Backward-incompatible changes:

-   structlog switched its packaging to flit. Users shouldn't notice a 
difference, but (re-)packagers might.

Deprecations:

none

Changes:

-   structlog.dev.ConsoleRenderer now has sort_keys boolean parameter that 
allows to disable the sorting of keys on output. #358

-   structlog.processors.TimeStamper now works well with FreezeGun even when it 
gets applied before the loggers are configured. #364

-   structlog.stdlib.AsyncBoundLogger now determines the running loop when 
logging, not on instantiation. That has a minor performance impact, but makes 
it more robust when loops change (e.g. aiohttp.web.run_app()), or you want to 
use sync_bl before a loop has started.

-   structlog.stdlib.ProcessorFormatter now has a processors argument that 
allows to define a processor chain to run over all log entries.

Before running the chain, two additional keys are added to the event 
dictionary: _record and _from_structlog. With them it's possible to extract 
information from logging.LogRecords and differentiate between structlog and 
logging log entries while processing them.

The old processor (singular) parameter is now deprecated, but no plans 
exist to remove it. #365

___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-12 Thread Hynek Schlawack


Change by Hynek Schlawack :


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

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



[issue45792] contextvars.Token has wrong module name in Sphinx's objects.inv

2021-11-11 Thread Hynek Schlawack


New submission from Hynek Schlawack :

Doc/library/contextvars.rst defines a module using `.. module:: contextvars` 
which means that all defined symbols are automatically part of the contextvars 
module.

The docs added in https://github.com/python/cpython/pull/5685 however 
explicitly use `.. class:: contextvars.Token` instead of just `.. class:: 
Token` which means that the recorded intersphinx symbol is 
`contextvars.contextvars.Token`. I have noticed this because sphinx couldn't 
find `contextvars.Token` in structlog's docs.

AFAICT, this only affects contextvars.Token.

--
assignee: hynek
components: Documentation
messages: 406192
nosy: hynek, yselivanov
priority: low
severity: normal
stage: needs patch
status: open
title: contextvars.Token has wrong module name in Sphinx's objects.inv
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

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



[Python-announce] structlog 21.2.0

2021-10-12 Thread Hynek Schlawack
I’m happy to announce the release of structlog 21.2.0!

With almost a million downloads per month, structlog is the most popular 
solution for structured logging in Python. It doesn’t just allow you to log 
key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intrigued 
but not convinced!

Heartfelt thanks go to my generous GitHub sponsors 
, companies subscribing on Tidelift 
 (currently nobody :( – 
tell your boss!), and people who bought me a coffee on 
!

Support like that makes me work on FOSS on a Saturday afternoon, so please 
consider supporting me  too! <3

RELEASE HIGHLIGHTS:

• Support for for beautiful (and helpful!) exceptions by integrating 
ConsoleRenderer with rich or better-exceptions.
• Helpers to access thread-local and context-local context.
• Deeper contextvars support.

Full changes: https://github.com/hynek/structlog/releases/tag/21.2.0
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[Python-announce]argon2-cffi 21.1.0

2021-08-30 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce the release of argon2-cffi 21.1.0!

With more than 13 million downloads per month, argon2-cffi is the most popular 
package for using the competition-winning Argon2 password hash in Python.

If you want more details on Argon2 and why it matters, check out my blog post 
"Storing Passwords in a Highly Parallelized World" 
.

Heartfelt thanks go to my generous GitHub sponsors 
, companies subscribing on Tidelift 
 (currently nobody :( – 
tell your boss!), and people who bought me a coffee on 
!

Support like that makes me work on FOSS on a Sunday afternoon, so please 
consider supporting me  too! <3

The highlights of this release are:

- abi3-wheels for all platforms. This means that argon2-cffi is ready for 
Python 3.10!
- Good bye Python 2.

---

All Changes:


Vendoring Argon2 @ 62358ba (20190702)

Backward-incompatible changes:

Microsoft stopped providing the necessary SDKs to ship Python 2.7 wheels and 
currenly the downloads amount to 0.09%. Therefore we have decided that Python 
2.7 is not supported anymore.

Deprecations:

none

Changes:

There are indeed no changes whatsoever to the code of argon2-cffi. The Argon2 
project also hasn't tagged a new release since July 2019. There also don't seem 
to be any important pending fixes.

This release is mainly about improving the way binary wheels are built (abi3 on 
all platforms).
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


attrs 21.1.0

2021-05-06 Thread Hynek Schlawack
Hi everyone,

I am extremely excited to announce the release of attrs 21.1.0.

attrs is the direct ancestor of – and the inspiration for – dataclasses in the 
standard library and remains the more powerful option for creating regular 
classes without getting bogged down with writing identical boilerplate again 
and again: https://www.attrs.org/

(for a richer version of this e-mail, check out 
)

Heartfelt thanks go to my generous GitHub sponsors, companies subscribing to 
attrs on Tidelift, and people who bought me a coffee on Ko-fi! Support like 
that makes me work on FOSS on a Saturday afternoon – especially when a release 
drags itself like this one! <3

While this release took a bit longer than I wished for, it comes with many 
exciting changes. The highlights alone are longer than a usual changelog:

-   The next-generation APIs (@attr.define, @attr.mutable, @attr.frozen, 
@attr.field) are deemed stable now. The old ones aren't going anywhere, but I 
encourage you to check the new ones out – they're much nicer!

-   pyright and pylance support: Eric Traut of Microsoft was kind enough to 
involve me in their work on the dataclass_transforms spec.

As a result, Microsoft's type checker pyright will work with this attrs 
release, and so will their Python language server pylance which should be 
exciting to VS Code users.

Currently it only supports a subset of attrs's features, but it's the most 
important ones and more will most likely follow. Some of the limitations are 
documented in our documentation on type annotations.

-   Customization of field comparison. This is something especially NumPy users 
have been asking for for a long time: you can now fully customize how a field 
is compared. We also ship a helper to avoid boilerplate code. So if you'd like 
to have an object with a NumPy array that compares correctly, this is the way:

import attr
import numpy

@attr.define
class C:
an_array = attr.field(eq=attr.cmp_using(eq=numpy.array_equal))

Check out the new documentation on comparison for details.

-   To make it more ergonomic, I've decided to un-deprecate the cmp argument 
again, so you can customize eq and order in one go. Sorry about the trouble! 
The cmp attribute remains deprecated.

-   New powerful __init__ helpers:

1.  If attrs deduces you don't want it to write a __init__ for you, it will 
create an __attrs_init__ instead that you can call from your custom __init__.
2.  If attrs finds a __attrs_pre_init__, it will call it without any 
arguments before doing any initializations. This is really only useful if you 
want to run super().__init__(), but that's a use-case people have asked for for 
years!

See Hooking Yourself Into Initialization for details.

-   In preparation for the (rescinded) plan to make from __future__ import 
annotations the default in Python 3.10, attr.resolve_types() can now also be 
used to resolve types inside of field_transformers.

A Look Ahead

For the next release we've got even bigger plans! By stabilizing the 
next-generation APIs we can finally go the last step, I've been talking for 
years (yeah, sorry): import attrs.

attrs's playful APIs (@attr.s, @attr.ib) lost a bit of their charm as the scope 
of the package grew – especially after the introduction of type annotations.

While the old APIs aren't going anywhere, in the next feature release there 
will be additionally an attrs package that you can use as an alternative to 
attr. No more attr.Factory!

The new package gives us the opportunity to rethink the defaults of some 
functions. So if you have any pet peeves, please air them on #487.

Full Changelog

Deprecations

-   The long-awaited, much-talked-about, little-delivered import attrs is 
finally upon us!

Since the NG APIs have now been proclaimed stable, the next release of 
attrs will allow you to actually import attrs. We're taking this opportunity to 
replace some defaults in our APIs that made sense in 2015, but don't in 2021.

So please, if you have any pet peeves about defaults in attrs's APIs, now 
is the time to air your grievances in #487! We're not gonna get such a chance 
for a second time, without breaking our backward-compatibility guarantees, or 
long deprecation cycles. Therefore, speak now or forever hold you peace! #487

-   The cmp argument to attr.s() and attr.ib() has been undeprecated It will 
continue to be supported as syntactic sugar to set eq and order in one go.

I'm terribly sorry for the hassle around this argument! The reason we're 
bringing it back is it's usefulness regarding customization of 
equality/ordering.

The cmp attribute and argument on attr.Attribute remains deprecated and 
will be removed later this year. #773

Changes

-   It's now possible to customize the behavior of eq and order by passing in a 
callable. #435, #627

-   The instant favorite 

structlog 20.2.0

2021-01-05 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce the release of structlog 20.2.0! As the version 
indicates, I’ve published it in 2020, but I wanted to wait with the 
announcement until y’all are back to sober from celebrating the end of a hell 
of a year!

With more than half a million downloads per month, structlog is the most 
popular solution for structured logging in Python. It doesn’t just allow you to 
log key-value pairs in a structured manner, it also makes it EASIER and FASTER. 
Check out  if you’re intruiged 
but not convinced!

Heartfelt thanks go to my generous GitHub sponsors 
, companies subscribing on Tidelift 
 (currently nobody :( – 
tell your boss!), and people who bought me a coffee on 
!

Additional SPECIAL thanks to Sentry  who were incredibly 
generous and included structlog in their FOSS financing round 
! If you ever miss 
errors in production, check them out – I’ve been cheerleading for them since 
2015!

Support like that makes me work on FOSS on a Saturday afternoon, so please 
consider supporting me  too! <3

*

20.2.0 took a long time to brew, but it’s a HUGE release. The main features of 
this release are:

- Full type hints coverage for all public and private APIs.
- Non-blocking asyncio logger for standard library integration. Yes, your 
logging won’t block your asyncio applications anymore!
- New high-performance logger that is independent from the standard library but 
has the same log levels. Here’re some microbenchmarks: 
 (graphs follow in 
replies).
- Prettier docs; courtesy of furo .
- Python 3.6+ only.

*

All Changes:


Backward-incompatible changes:

-   Python 2.7 and 3.5 aren't supported anymore. The package meta data should 
ensure that you keep getting 20.1.0 on those versions. #244

-   structlog is now fully type-annotated. This won't break your applications, 
but if you use Mypy, it will most likely break your CI.

Check out the new chapter on typing for details.

Deprecations:

-   Accessing the _context attribute of a bound logger is now deprecated. 
Please use the new structlog.get_context().

Changes:

-   structlog has now type hints for all of its APIs! Since structlog is highly 
dynamic and configurable, this led to a few concessions like a specialized 
structlog.stdlib.get_logger() whose only difference to structlog.get_logger() 
is that it has the correct type hints.

We consider them provisional for the time being – i.e. the backward 
compatibility does not apply to them in its full strength until we feel we got 
it right. Please feel free to provide feedback! #223, #282

-   Added structlog.make_filtering_logger that can be used like 
configure(wrapper_class=make_filtering_bound_logger(logging.INFO)). It creates 
a highly optimized bound logger whose inactive methods only consist of a return 
None. This is now also the default logger.

-   As a complement, structlog.stdlib.add_log_level() can now additionally be 
imported as structlog.processors.add_log_level since it just adds the method 
name to the event dict.

-   structlog.processors.add_log_level() is now part of the default 
configuration.

-   structlog.stdlib.ProcessorFormatter no longer uses exceptions for control 
flow, allowing foreign_pre_chain processors to use sys.exc_info() to access the 
real exception.

-   Added structlog.BytesLogger to avoid unnecessary encoding round trips. 
Concretely this is useful with orjson which returns bytes. #271

-   The final processor now also may return bytes that are passed untouched to 
the wrapped logger.

-   structlog.get_context() allows you to retrieve the original context of a 
bound logger. #266,

-   structlog.PrintLogger now supports copy.deepcopy(). #268

-   Added structlog.testing.CapturingLogger for more unit testing goodness.

-   Added structlog.stdlib.AsyncBoundLogger that executes logging calls in a 
thread executor and therefore doesn't block. #245
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue42600] Cancelling tasks waiting for asyncio.Conditions crashes w/ RuntimeError: Lock is not acquired.

2020-12-08 Thread Hynek Schlawack


New submission from Hynek Schlawack :

This is something I've been procrastinating on for almost a year and working 
around it using my own version of asyncio.Condition because I wasn't sure how 
to describe it. So here's my best take:

Consider the following code:

```
import asyncio


async def tf(con):
async with con:
await asyncio.wait_for(con.wait(), 60)


async def f(loop):
con = asyncio.Condition()

t = loop.create_task(tf(con))

await asyncio.sleep(1)
t.cancel()

async with con:
con.notify_all()

await t


loop = asyncio.get_event_loop()
loop.run_until_complete(f(loop))
```

(I'm using old-school APIs because I wanted to verify whether it was a 
regression. I ran into the bug with new-style APIs: 
https://gist.github.com/hynek/387f44672722171c901b8422320e8f9b)

`await t` will crash with:


```
Traceback (most recent call last):
  File "/Users/hynek/t.py", line 6, in tf
await asyncio.wait_for(con.wait(), 60)
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/tasks.py", line 
466, in wait_for
await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hynek/t.py", line 24, in 
loop.run_until_complete(f(loop))
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/base_events.py",
 line 642, in run_until_complete
return future.result()
  File "/Users/hynek/t.py", line 20, in f
await t
  File "/Users/hynek/t.py", line 6, in tf
await asyncio.wait_for(con.wait(), 60)
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/locks.py", line 
20, in __aexit__
self.release()
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/locks.py", line 
146, in release
raise RuntimeError('Lock is not acquired.')
RuntimeError: Lock is not acquired.

```

If you replace wait_for with a simple await, it works and raises an 
asyncio.exceptions.CancelledError:

```
Traceback (most recent call last):
  File "/Users/hynek/t.py", line 6, in tf
await con.wait()
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/locks.py", line 
290, in wait
await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hynek/t.py", line 20, in f
await t
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hynek/t.py", line 24, in 
loop.run_until_complete(f(loop))
  File 
"/Users/hynek/.asdf/installs/python/3.9.0/lib/python3.9/asyncio/base_events.py",
 line 642, in run_until_complete
return future.result()
asyncio.exceptions.CancelledError
```

I have verified, that this has been broken at least since 3.5.10. The current 
3.10.0a3 is affected too.

--
components: asyncio
messages: 382732
nosy: asvetlov, hynek, lukasz.langa, yselivanov
priority: normal
severity: normal
status: open
title: Cancelling tasks waiting for asyncio.Conditions crashes w/ RuntimeError: 
Lock is not acquired.
versions: Python 3.10, Python 3.8, Python 3.9

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



[issue42014] shutil.rmtree calls onerror with different function than failed

2020-11-11 Thread Hynek Schlawack


Change by Hynek Schlawack :


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

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



attrs 20.2.0

2020-09-08 Thread Hynek Schlawack
Hi everyone,

I’m happy to (somewhat belatedly) announce the release of attrs 20.2.0.

attrs is the direct ancestor of dataclasses in the standard library and remains 
the most powerful option for creating regular classes without getting bogged 
down with writing identical boilerplate again and again: https://www.attrs.org/

Heartfelt thanks to my generous sponsors , 
companies subscribing on Tidelift 
, and people who bought me a 
coffee on ! Support like that makes me merge PRs 
and release software on a Saturday afternoon! <3

---

This release fixes a bunch of bugs in the new APIs and a few regressions that 
were introduced in the HUGE 20.1.0 release (if you’ve missed it, check out the 
announcement here: 
):

Backward-incompatible Changes

-   attr.define(), attr.frozen(), attr.mutable(), and attr.field()
remain provisional.

This release fixes a bunch of bugs and ergonomics but they remain
mostly unchanged.

If you wish to use them together with mypy, you can simply drop this
plugin into your project.

Feel free to provide feedback to them in the linked issue #668.

We will release the attrs namespace once we have the feeling that
the APIs have properly settled. #668

Changes

-   attr.define() et al now correct detect __eq__ and __ne__. #671

-   attr.define() et al's hybrid behavior now also works correctly when
arguments are passed. #675

-   It's possible to define custom __setattr__ methods on slotted
classes again. #681

-   In 20.1.0 we introduced the inherited attribute on the
attr.Attribute class to differentiate attributes that have been
inherited and those that have been defined directly on the class.

It has shown to be problematic to involve that attribute when
comparing instances of attr.Attribute though, because when
sub-classing, attributes from base classes are suddenly not equal to
themselves in a super class.

Therefore the inherited attribute will now be ignored when hashing
and comparing instances of attr.Attribute. #684

-   zope.interface is now a "soft dependency" when running the test
suite; if zope.interface is not installed when running the test
suite, the interface-related tests will be automatically skipped.
#685

-   The ergonomics of creating frozen classes using @define(frozen=True)
and sub-classing frozen classes has been improved: you don't have to
set on_setattr=None anymore. #687

The full changelog can be found at 
.

Cheers,
—h
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


attrs 20.1.0 released!

2020-08-20 Thread Hynek Schlawack
I’m thrilled to finally present attrs 20.1.0 with the following changes:

- bug fixes
- performance improvements

JUST KIDDING!

This release is HUGE and I'm stoked we can finally get it to you! It’s the 
result of more than a year of development and not only does it come with many 
great features that users desired for a long time, it also lays the foundation 
for the future evolution of this package.



The final push has only been possible thanks to attrs’s Tidelift subscribers 
(https://tidelift.com/funding/github/pypi/attrs) and my generous GitHub 
Sponsors (https://github.com/sponsors/hynek). If you want to speed up the 
development for the forthcoming 20.2.0 release (You do! There’s a lot of great 
stuff coming up!), please consider supporting my work by either sponsoring me, 
or convincing your boss to subscribe to my projects on Tidelift 
(https://tidelift.com).


Hooks on Setting Attributes

You could always use validators for when a class is instantiated and you could 
always make classes immutable.

Now you can also freeze specific attributes and validate attribute values on 
assignment using the new on_setattr argument.

It takes a callable and runs it whenever the user tries to assign a new value 
to the attribute.

See #660 (https://github.com/python-attrs/attrs/pull/660).


Automatic Detection of Own Methods

If you want to write your own dunder method – say __init__ – you have to 
remember to tell attrs to not generate an own version (e.g.  
@attr.s(init=False)) otherwise it will happily overwrite it.

Not anymore! If you pass @attr.s(auto_detect=True), attrs will look for your 
own methods automatically – but only in the current class. In other words: 
inherited methods don’t count. It’s still a bit of hassle to set it to True, 
but that will be remedied in the future (see below).

See #607 (https://github.com/python-attrs/attrs/pull/607).


Attribute Collection and the MRO

attrs’s collection of attributes was slightly wrong in very specific situations 
involving multiple inheritance (editor’s note: don’t use multiple inheritance). 
Most people won't notice, but some do 
(https://github.com/python-attrs/attrs/issues/428) we like to do things the 
right way.

See #635 (https://github.com/python-attrs/attrs/pull/635).


The Road Ahead

attrs started out in February 2015. The Python landscape was very different 
back then and lots of things changed since. We also got some things subtly 
wrong that need to be fixed by passing arguments. And finally the cute attr.s 
and attr.ib function names didn't age as attrs gained more and more features 
over the years.

Therefore, we intend to add a new attrs namespace in 20.2.0 later this year, 
allowing you to import attrs.

But there’s more than an extra “s” planned. We want to free people from having 
to pass all kinds of arguments to get the “good behavior” of attrs and 
therefore we want to introduce new APIs that have better defaults. Thanks to 
the new namespace, we don’t have to break backward compatibility and the old 
APIs aren’t going anywhere: in fact, the new ones build on them.



To get the new APIs just right, we’ve added them to attrs 20.1.0 provisionally 
for you to test and give us with feedback.

The APIs are attr.define() which is supposed to become the default way to 
decorate classes in the future, attr.frozen() that’s the same thing as 
attr.define(frozen=True) and finally attr.mutable() that is an alias for 
define() and was wished for by immutability fans.

There’s also a new alias for attr.ib() called attr.field() since that seems to 
be the nomenclature the Python community has agreed on. It carries no changes 
except that it’s keyword-only.


To give you a taste, this is an example for a class defined using the new APIs:

import attr

@attr.define
class C:
x: int
y: str = attr.field(default="foo")

def __repr__(self) -> str:
return "attrs will not overwrite this method."

If everything goes according to plan, in 20.2.0 you’ll be able to substitute 
attr with attrs.

N.B. All these APIs require at least Python 3.6. While attrs will be Python 
2-compatible as long as we can (https://www.attrs.org/en/stable/python-2.html), 
the new APIs are not.



Check out the API documentation for provisional APIs 
(https://www.attrs.org/en/stable/api.html#provisional-apis) and please use 
issue #668 (https://github.com/python-attrs/attrs/issues/668) for feedback! 
Relevant discussions happened in #408 
(https://github.com/python-attrs/attrs/issues/408), #487 
(https://github.com/python-attrs/attrs/issues/487), and finally #666 
(https://github.com/python-attrs/attrs/pull/666) (yep).


Full Changelog

The full (looong) changelog with many more features and fixes can be found at 
.
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to 

attrs 19.2.0 released

2019-10-01 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce attrs 19.2.0!

If you haven’t heard of attrs: it’s the package that inspired dataclasses, 
works on Python 2.7, 3.4 and later, and has over 17 million PyPI downloads per 
month.

Highlights:

– cmp is now split into eq and order (like in dataclasses).  Using cmp in attrs 
19.2 and later will raise a warning until at least June 2021 and will then be 
removed.
– The repr of single attributes now can be customized.
– Added attr.__version_info__ that behaves like sys.version_info and allows 
write code that supports multiple attrs versions.

Full changelog for this release (also available at 
 with nicer markup and working 
links):


BACKWARD-INCOMPATIBLE CHANGES

-   Removed deprecated Attribute attribute convert per scheduled removal
on 2019/1. This planned deprecation is tracked in issue #307. #504

-   __lt__, __le__, __gt__, and __ge__ do not consider subclasses
comparable anymore.

This has been deprecated since 18.2.0 and was raising a
DeprecationWarning for over a year. #570


DEPRECATIONS

-   The cmp argument to attr.s() and attr.ib() is now deprecated.

Please use eq to add equality methods (__eq__ and __ne__) and order
to add ordering methods (__lt__, __le__, __gt__, and __ge__) instead
– just like with dataclasses.

Both are effectively True by default but it's enough to set eq=False
to disable both at once. Passing eq=False, order=True explicitly
will raise a ValueError though.

Since this is arguably a deeper backward-compatibility break, it
will have an extended deprecation period until 2021-06-01. After
that day, the cmp argument will be removed.

attr.Attribute also isn't orderable anymore. #574


CHANGES

-   Updated attr.validators.__all__ to include new validators added in
#425. #517
-   Slotted classes now use a pure Python mechanism to rewrite the
__class__ cell when rebuilding the class, so super() works even on
environments where ctypes is not installed. #522
-   When collecting attributes using @attr.s(auto_attribs=True),
attributes with a default of None are now deleted too. #523, #556
-   Fixed attr.validators.deep_iterable() and
attr.validators.deep_mapping() type stubs. #533
-   attr.validators.is_callable() validator now raises an exception
attr.exceptions.NotCallableError, a subclass of TypeError, informing
the received value. #536
-   @attr.s(auto_exc=True) now generates classes that are hashable by
ID, as the documentation always claimed it would. #543, #563
-   Added attr.validators.matches_re() that checks string attributes
whether they match a regular expression. #552
-   Keyword-only attributes (kw_only=True) and attributes that are
excluded from the attrs's __init__ (init=False) now can appear
before mandatory attributes. #559
-   The fake filename for generated methods is now more stable. It won't
change when you restart the process. #560
-   The value passed to @attr.ib(repr=…) can now be either a boolean (as
before) or a callable. That callable must return a string and is
then used for formatting the attribute by the generated __repr__()
method. #568
-   Added attr.__version_info__ that can be used to reliably check the
version of attrs and write forward- and backward-compatible code.
Please check out the section on deprecated APIs on how to use it.
#580
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue33734] asyncio/ssl: Fix AttributeError, increase default handshake timeout

2018-06-01 Thread Hynek Schlawack


Hynek Schlawack  added the comment:

> Previous timeout was effectively infinite.

Oi, well then 60s are an improvement indeed. :)

--

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



[issue33734] asyncio/ssl: Fix AttributeError, increase default handshake timeout

2018-06-01 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

For some context: 10s seems to be more common than I liked to believe (seems 
like Go's http client uses it by default too).

Nevertheless I ran into the 10s after updating uvloop and stopped being able to 
connect to a server in India. Therefore I'd consider 10s at least a regression 
that should be fixed.

What was the effective timeout before? Depending on the old value, 60s could be 
excessive for clients and might lead to self-DoS on the client side…

P.S. I tried to reply on my phone and now I fully support Mariatta’s proposal 
of moving to GitHub issues.

--

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



[issue31997] SSL lib does not handle trailing dot (period) in hostname or certificate

2017-11-11 Thread Hynek Schlawack

Change by Hynek Schlawack <h...@ox.cx>:


--
nosy: +hynek

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-11-11 Thread Hynek Schlawack

Change by Hynek Schlawack <h...@ox.cx>:


--
nosy: +hynek

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



attrs 17.3.0 released!

2017-11-09 Thread Hynek Schlawack
Hi everyone,

I’m very excited to announce the 17.3.0 release of attrs 
<http://www.attrs.org/>, the package that will make you love writing classes 
again!

A lot has happened under the hood but the main feature we’d like to point out 
is first-class support for types including PEP 526-style class variable 
annotations:

```pycon
>>> @attr.s
... class C:
... x = attr.ib(type=int)
... y: int = attr.ib()
>>> attr.fields(C).x.type

>>> attr.fields(C).y.type

```

And if you’re OK with annotating *all* attributes, you can drop the `attr.ib()` 
completely with the new `auto_attribs` option.  Anything that is assigned to 
the attributes and isn’t an `attr.ib` is used as a default value:

```pycon
>>> import typing
>>> @attr.s(auto_attribs=True)
... class AutoC:
... cls_var: typing.ClassVar[int] = 5  # this one is ignored
... l: typing.List[int] = attr.Factory(list)
... x: int = 1
... bar: typing.Any = None
>>> AutoC()
AutoC(l=[], x=1, bar=None)
```

Please note:

- This feature works with Python 3.6 and later only.
- The type information is currently *not* used by attrs itself, but it allows 
you to write advanced validators and serializers.

Check out the changelog for all changes: 
<http://www.attrs.org/en/stable/changelog.html>
Get it from PyPI: <https://pypi.org/project/attrs/>

For the attrs team,
Hynek Schlawack
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


attrs 17.1.0

2017-05-16 Thread Hynek Schlawack
Hi everyone,

fresh for PyCon US 2017, the attrs team is relieved to present you the 
much-delayed attrs 17.1.0!

Full changes: http://www.attrs.org/en/stable/changelog.html

***

First the bad news: until 17.1.0, attrs’ logic regarding when to create a 
__hash__ method was in conflict with Python’s specification.  If you use 
instances as dict keys or put them into sets, you have to either make them 
frozen explicitly by passing `frozen=True` or implicitly by pinky-swearing to 
not mutate them and force the creation of __hash__  using `hash=True`.

*Please* double check before upgrading!

We’re honestly sorry but didn’t see any better way to handle this.  But mind 
you: hashing mutable objects is a bug so the breakage you’ll encounter may very 
well be the surfacing of latent, sneaky bugs.

***

Now the good news!

This release took very long (we promise improvement!) which led to the 
accumulation of a lot of great new features.  A few highlights:


# Decorators for validators

>>> @attr.s
... class C(object):
... x = attr.ib()
... @x.validator
... def check(self, attribute, value):
... if value > 42:
... raise ValueError("y must be smaller or equal to 42")
>>> C(42)
C(x=42)
>>> C(43)
Traceback (most recent call last):
...
ValueError: x must be smaller or equal to 42


# Decorators for defaults & self in factories

One of the most requested features: you can base the default of an attribute on 
a preceding attribute:

>>> @attr.s
... class C(object):
... x = attr.ib(default=1)
... y = attr.ib(default=attr.Factory(lambda self: self.x + 1, 
takes_self=True))
... z = attr.ib()
... @z.default
... def name_does_not_matter(self):
... return self.x + 1
>>> C()
C(x=1, y=2, z=3)


# New Validators: in_() & and_()

in_() allows to check whether a value is part of an enum or any container:

>>> import enum
>>> class State(enum.Enum):
... ON = "on"
... OFF = "off"
>>> @attr.s
... class C(object):
... state = attr.ib(validator=attr.validators.in_(State))
... val = attr.ib(validator=attr.validators.in_([1, 2, 3]))
>>> C(State.ON, 1)
C(state=, val=1)
>>> C("on", 1)
Traceback (most recent call last):
...
ValueError: 'state' must be in  (got 'on')
>>> C(State.ON, 4)
Traceback (most recent call last):
...
ValueError: 'val' must be in [1, 2, 3] (got 4)

and_() allows you to compose multiple validators to one.  As syntactic sugar, 
you can also just pass a list to `validator=`.  Therefore the following lines 
are equivalent:

x = attr.ib(validator=attr.validators.and_(v1, v2, v3))
x = attr.ib(validator=[v1, v2, v3])


For the attrs team
Hynek


signature.asc
Description: Message signed with OpenPGP
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


structlog 17.1.0

2017-04-24 Thread Hynek Schlawack
Hi everyone,

I’m happy to announce structlog 17.1.0 has been released to PyPI: 


The main features of this release are massive improvements in standard 
library's logging integration. Have a look at the updated standard library 
chapter on how to use them! Special thanks go to Fabian Büchler, Gilbert 
Gilb's, Iva Kaneva, insolite, and sky-code, that made them possible.

Check out the full changelog at 


***

If you haven’t heard of structlog: it makes logging in Python less painful and 
more powerful by adding structure to your log entries.

It’s up to you whether you want structlog to take care about the output of your 
log entries or whether you prefer to forward them to an existing logging system 
like the standard library’s logging module. No monkey patching involved in 
either case.

Got to  to read more!
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


attrs 16.3.0

2016-11-26 Thread Hynek Schlawack
Dear fellow Pythonistas,

I’m very happy to announce attrs 16.3.0, the Python library the makes you love 
writing classes again!  If you need a refresher why you should use attrs, have 
a look at “The One Python Library Everyone Needs” 
 written by no one less 
than Glyph himself.

It’s still 100% free of magic but 100% full of convenience!

This version comes with two major new features I’d like to point out:


1. Attribute Metadata


There is a much nicer way to extend attrs now by using attribute metadata.  If 
you’re thinking Golang’s struct tags, it’s close!

However instead of exposing them to the users, it’s much nicer to *wrap* attrs 
and use metadata to bring the declarative approach to new areas.

For example this code will automatically load its configuration from env 
variables (as per 12Factor App: ):

```
@app_config(prefix="APP", vault_prefix="WHOIS_{env}")
class WhoisConfig:
@app_config
class Prometheus:
address = env_var(default="127.0.0.1")
port = env_var(default="0")
consul_token = env_var_from_vault()

env = env_var()
prometheus = env_var_group(Prometheus)


if __name__ == '__main__':
ac = environ_to_app_config(WhoisConfig)

print(ac)
```

Running it gives you:

```
$ env APP_ENV=dev APP_PROMETHEUS_PORT=7000 
SECRET_WHOIS_DEV_APP_PROMETHEUS_CONSUL_TOKEN=abc python app.py
WhoisConfig(env='dev', prometheus=Prometheus(address='127.0.0.1', port='7000', 
consul_token='abc'))
```

(If you’re interested in the implementation of app_config, env_var, 
env_var_from_vault, env_var_group, and environ_to_app_config, have a look at 
 – it’s 87 LoC 
including empty lines.  I may or may not release a PyPI package one day)


2. Post Initialization Hooks


This is an often requested feature (just look at all those enthusiastic 
bikeshed painters:  ) and allows you 
to define code that runs after the generated __init__ method.

This should make life easier when subclassing third party classes or if you 
want to derive attributes from others.


Full Changelog
===

-   Attributes now can have user-defined metadata which greatly improves 
attrs's extensibility. #96
-   Allow for a __attrs_post_init__ method that -- if defined -- will get 
called at the end of the attrs-generated __init__ method. #111
-   Add @attr.s(str=True) that will optionally create a __str__ method that is 
identical to __repr__. This is mainly useful with Exceptions and other classes 
that rely on a useful __str__ implementation but overwrite the default one 
through a poor own one. Default Python class behavior is to use __repr__ as 
__str__ anyways.

If you tried using attrs with Exceptions and were puzzled by the 
tracebacks: this option is for you.
-   Don't overwrite __name__ with __qualname__ for attr.s(slots=True) classes. 
#99


Links


PyPI: 
Documentation: 
GitHub: 

Cheers,
Hynek
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue27589] asyncio doc: issue in as_completed() doc

2016-11-08 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Such an idiom is IMHO not the main usefulness of this function tho.

As an (untested) example, something like

async def f(n):
   await asyncio.sleep(n)
   return n

for f in asyncio.as_completed([f(3), f(2), f(1)]):
print(await f)


will print:

1
2
3

That’s *super* useful if you’re coordinating multiple independent external 
systems and need to process their results as soon as they arrive (and not once 
they’re *all* done).

Maybe it always worked by accident for me but it’s my understanding, that that 
is what this function is for (and I haven’t found another way to achieve it).

That’s why it would be nice if there’d be authoritative docs on what it’s 
supposed to do. :)

--

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



attrs 16.1.0

2016-09-01 Thread Hynek Schlawack
I’m happy to announce that attrs 16.1.0 hit PyPI: 
https://pypi.org/project/attrs/

attrs is the Python package that will bring back the joy of writing classes by 
relieving you from the drudgery of implementing object protocols (aka dunder 
methods).

Its main goal is to help you to write concise and correct software without 
slowing down your code.

Leading Python Though Lords™ have called it “The One Python Library Everyone 
Needs”: https://glyph.twistedmatrix.com/2016/08/attrs.html (subtitle: “Use 
attrs. Use it. Use it for everything.”)

The main change is the option of having frozen (i.e. immutable) classes which 
allows for value types in Python.

See the full changes at https://attrs.readthedocs.io/en/stable/changelog.html 
and never again violate the single responsibility principle just because 
implementing __init__ et al is a painful drag!

Cheers,
Hynek Schlawack
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue27850] Remove 3DES from cipher list (sweet32 CVE-2016-2183)

2016-08-24 Thread Hynek Schlawack

Hynek Schlawack added the comment:

JFTR the main compatibility impact on the browser side is the loss of IE8 on 
WinXP whose last stable release is qua Wikipedia from “February 22, 2011; 5 
years ago”.

--
nosy: +hynek

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



[issue27589] asyncio doc: issue in as_completed() doc

2016-08-01 Thread Hynek Schlawack

Hynek Schlawack added the comment:

More explicitly:

The doc sells the function short.  If you have a bunch of futures and want to 
know as soon as one of them is ready: this is the function for you.

The only hint that this is the actual behavior comes from the *name* of the 
function; not the documentation.

--
nosy: +hynek

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



[ANN] prometheus_async: asyncio/Twisted-aware Python Prometheus instrumentation

2016-05-20 Thread Hynek Schlawack
Dear fellow friends of asynchronous software,

maybe some of you have already bumped into the Prometheus monitoring system 
 and liked it like I do (in any case, I’d like to invite 
you to my PyCon US talk on that topic: 
!)

And while it’s great that Python is a first class citizen due to the official 
Python client library , asyncio 
and Twisted sadly aren’t!

That’s why I’ve just released prometheus_async: 
https://prometheus-async.readthedocs.io/

First and foremost it wraps the metrics from the official client (you don’t 
want *me* to do math!) and makes them work properly on coroutines and Deferreds 
(and makes them well-behaved decorators too but that’s a topic for another 
day…).

Additionally, it adds a few goodies:

- Metric-exposure via aiohttp that ist much more flexible than what comes with 
the stdlib-based official solution.
- …that can also be started in a separate thread.  That means you can use them 
in regular, *synchronous* Python 3 applications as well (I instrument all my 
Pyramid apps like that).
- Integration with service discovery.  Listen on port 0 and leave registration 
to Consul Agent (integration is pluggable, just implement two methods)!

Sadly the goodies are asyncio-only so far.  Partly because the official client 
has some Twisted Web support merged but not released yet.  Contributions are 
very welcome!

Cheers,
Hynek
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


pyOpenSSL 16.0.0 released

2016-03-19 Thread Hynek Schlawack
On behalf of PyCA – the Python Cryptography Authority – I’m anxious to announce 
that after almost a year since the 0.15.1 release of pyOpenSSL we’ve released 
the brand new 16.0.0.

A few organizational notes:

1. The pyopenssl-users mailing list and #pyopenssl IRC channel are deprecated.  
Please use cryptography-dev 
<https://mail.python.org/pipermail/cryptography-dev/> and #cryptography-dev on 
Freenode where you’re much more likely to get help.
2. The version scheme switched to CalVer because a 0.x version for a 15 years 
old project is rather odd and calling it 1.0 although we don’t expect a 2.0 to 
ever happen didn’t make any sense.  pyOpenSSL is a long-running project with 
strict backward-compatibility requirements and is hence better served with a 
calendar-based version scheme.
3. Please note that some of us will be doing a TLS/HTTPS workshop at PyCon US 
2016 so if you always wanted to learn about these things first hand, make sure 
to sign up: <https://us.pycon.org/2016/schedule/presentation/1786/>.  We've 
opted to receive no compensation and asked the organizers to send them to 
PyLadies instead.  So you’ll be doing good while learning something!

***

Release details:

While the list of changes looks short, a lot internal work happened:

72 files changed, 15511 insertions(+), 15063 deletions(-)

We’ve done our best to not break any existing applications; including by making 
the urllib3 and Twisted test suites part of our CI.

The full changelog can be found at 
<https://pyopenssl.readthedocs.org/en/stable/changelog.html>.

This is the first release under full stewardship of PyCA. We have made many 
changes to make local development more pleasing. The test suite now passes both 
on Linux and OS X with OpenSSL 0.9.8, 1.0.1, and 1.0.2. It has been moved to 
py.test, all CI test runs are part of tox and the source code has been made 
fully flake8 compliant.

We hope to have lowered the barrier for contributions significantly but are 
open to hear about any remaining frustrations.


Backward-incompatible changes:

• Python 3.2 support has been dropped. It never had significant real world 
usage and has been dropped by our main dependency cryptography. Affected users 
should upgrade to Python 3.3 or later.


Deprecations:

• The support for EGD has been removed. The only affected function 
OpenSSL.rand.egd() now uses os.urandom() to seed the internal PRNG instead. 
Please see pyca/cryptography#1636 for more background information on this 
decision. In accordance with our backward compatibility policy 
OpenSSL.rand.egd() will be removed no sooner than a year from the release of 
16.0.0.
Please note that you should use urandom for all your secure random number needs.
• Python 2.6 support has been deprecated. Our main dependency 
cryptography deprecated 2.6 in version 0.9 (2015-05-14) with no time table for 
actually dropping it. pyOpenSSL will drop Python 2.6 support once cryptography 
does.


Changes:

• Fixed OpenSSL.SSL.Context.set_session_id, OpenSSL.SSL.Connection.renegotiate, 
OpenSSL.SSL.Connection.renegotiate_pending, and 
OpenSSL.SSL.Context.load_client_ca. They were lacking an implementation since 
0.14. #422
• Fixed segmentation fault when using keys larger than 4096-bit to sign data. 
#428
• Fixed AttributeError when OpenSSL.SSL.Connection.get_app_data() was called 
before setting any app data. #304
• Added OpenSSL.crypto.dump_publickey() to dump OpenSSL.crypto.PKey objects 
that represent public keys, and OpenSSL.crypto.load_publickey() to load such 
objects from serialized representations. #382
• Added OpenSSL.crypto.dump_crl() to dump a certificate revocation list out to 
a string buffer. #368
• Added OpenSSL.SSL.Connection.get_state_string() using the OpenSSL binding 
state_string_long. #358
• Added support for the socket.MSG_PEEK flag to OpenSSL.SSL.Connection.recv() 
and OpenSSL.SSL.Connection.recv_into(). #294
• Added OpenSSL.SSL.Connection.get_protocol_version() and 
OpenSSL.SSL.Connection.get_protocol_version_name(). #244
• Switched to utf8string mask by default. OpenSSL formerly defaulted to a 
T61String if there were UTF-8 characters present. This was changed to default 
to UTF8String in the config around 2005, but the actual code didn't change it 
until late last year. This will default us to the setting that actually works. 
To revert this you can call 
OpenSSL.crypto._lib.ASN1_STRING_set_default_mask_asc(b"default"). #234

***

For PyCA,
Hynek Schlawack


signature.asc
Description: Message signed with OpenPGP using GPGMail
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Re: [ANN] pyOpenSSL 0.15*.1*

2015-04-14 Thread Hynek Schlawack

Hello again,

since releasing software is so much fun, 0.15.1 is out on PyPI too.

It fixes a small regression that shouldn’t affect you in practice but 
breaks the Twisted test suite.


See https://github.com/pyca/pyopenssl/pull/225 for details.

Brown baggily yours,
—h

On 14 Apr 2015, at 12:54, Hynek Schlawack wrote:


Greetings fellow Pythoneers,

I'm happy to announce that pyOpenSSL 0.15 is now available.

pyOpenSSL is a set of Python bindings for OpenSSL.  It includes some 
low-level cryptography APIs but is primarily focused on providing an 
API for using the TLS protocol from Python.


Check out the PyPI page (https://pypi.python.org/pypi/pyOpenSSL) for 
downloads.


***

This is the last release under the stewardship of Jean-Paul Calderone 
and the maintainership is now taken over by the Python Cryptography 
Authority (PyCA) which has been developing the C-bindings for 
pyOpenSSL for a while (aka cryptography).


We’d like to thank him for his great work over the past years and 
hope to be able to keep moving the project into a direction that will 
make him only slightly sad.


***

The highlights of this release include:

- Support to ECDHE,
- NPN and ALPN support,
- …many bug fixes!

It’s worth pointing out that OpenSSL functions generally work on 
*byte strings* because they mirror OpenSSL APIs and OpenSSL is not 
Unicode-aware.  Passing Unicode strings tends to accidentally work due 
do implicit decodes on Python 2 but they emit a DeprecationWarning 
now.  Please note that DeprecationWarnings are silenced by default on 
Python 2.7.


See the ChangeLog at 
https://github.com/pyca/pyopenssl/blob/0.15/ChangeLog for more 
details!


On behalf of PyCA,
Hynek Schlawack
--
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/

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

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


[ANN] pyOpenSSL 0.15

2015-04-14 Thread Hynek Schlawack

Greetings fellow Pythoneers,

I'm happy to announce that pyOpenSSL 0.15 is now available.

pyOpenSSL is a set of Python bindings for OpenSSL.  It includes some 
low-level cryptography APIs but is primarily focused on providing an API 
for using the TLS protocol from Python.


Check out the PyPI page (https://pypi.python.org/pypi/pyOpenSSL) for 
downloads.


***

This is the last release under the stewardship of Jean-Paul Calderone 
and the maintainership is now taken over by the Python Cryptography 
Authority (PyCA) which has been developing the C-bindings for pyOpenSSL 
for a while (aka cryptography).


We’d like to thank him for his great work over the past years and hope 
to be able to keep moving the project into a direction that will make 
him only slightly sad.


***

The highlights of this release include:

- Support to ECDHE,
- NPN and ALPN support,
- …many bug fixes!

It’s worth pointing out that OpenSSL functions generally work on *byte 
strings* because they mirror OpenSSL APIs and OpenSSL is not 
Unicode-aware.  Passing Unicode strings tends to accidentally work due 
do implicit decodes on Python 2 but they emit a DeprecationWarning now.  
Please note that DeprecationWarnings are silenced by default on Python 
2.7.


See the ChangeLog at 
https://github.com/pyca/pyopenssl/blob/0.15/ChangeLog for more 
details!


On behalf of PyCA,
Hynek Schlawack
--
https://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


[issue21859] Add Python implementation of FileIO

2015-03-23 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy:  -hynek

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



[issue1610654] cgi.py multipart/form-data

2014-07-08 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I would have long ago if I had any domain knowlege on this topic, but alas….

--

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



[issue20207] Disable SSLv2 in Python 2.x

2014-01-09 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I’m +1 too since supporting it serves no other purpose then enabling downgrade 
attacks. Shipping a client with SSL 2 on is nothing short a security bug.

--
nosy: +hynek

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



[issue18959] Create a Superseded modules section in standard library ToC

2013-09-07 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

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



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-17 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Well that's the point: it's extremely handy but simple.  I wish Raymond would 
pronounce on this.  I can keep using the PyPI version for all I care, so I'm 
not going fight for it.  But with one exception there seems to be an agreement 
that it would be a very fine thing to have.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-11 Thread Hynek Schlawack

Hynek Schlawack added the comment:

So I wanted to provide a first patch to move the discussion on and realized 
that itertools appears currently to be completely inside of 
`Modules/itertoolsmodule.c`. :-/

Any volunteers? :)

--
assignee: hynek - 
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.first_true (return first true item in iterable)

2013-08-05 Thread Hynek Schlawack

Hynek Schlawack added the comment:

 +1 on the name 'first_true'.  Does exactly what it says on the tin.

I fully agree.

***

I assume what's missing now is a permission from Raymond to mess with his turf?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack

New submission from Hynek Schlawack:

Let met try to get you sold on adding the “first” function I released on PyPI 
roughly a year ago:

https://github.com/hynek/first

It’s a very nice complement to functions like `any()` or itertools. I consists 
effectively of 9 lines of code but it proved extremely handy in production.

***

It returns the first true value from an iterable or a default:

 first([0, None, False, [], (), 42])
42

 first([0, None, False, [], ()], default=42)
42

Additionally it also allows for a key function:

 first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)
4

***

First happens to be especially useful together with the re module:

import re

from first import first


re1 = re.compile('b(.*)')
re2 = re.compile('a(.*)')

m = first(regexp.match('abc') for regexp in [re1, re2])
if not m:
   print('no match!')
elif m.re is re1:
   print('re1', m.group(1))
elif m.re is re2:
   print('re2', m.group(1))


All the knee-jerk alternatives to it have some shortcomings:

next(itertools.ifilter(None, (regexp.match('abc') for regexp in [re1, re2])), 
None)
next((regexp.match('abc') for regexp in [re1, re2] if regexp.match('abc')), 
None)

None of them is Pythonic and the second one even has to call match() twice, 
which is *not* a cheap method to call.

Here the first version for comparison again:

first(regexp.match('abc') for regexp in [re1, re2])

It doesn’t even exhaust the iterator if not necessary.

***

I don’t cling to neither the name or the exact function signature (although it 
got polished with the help of several people, two of them core developers).  I 
also don’t really care whether it gets added along of any() or put into 
itertools.  I just know that I and several other people would appreciate to 
have such a handy function in the stdlib – I even got an e-mail from OpenStack 
folks asking when it will be added because they would like to use it and 
there’s even a debian package by now: 
http://packages.debian.org/unstable/python-first

There’s also this question on StackOverflow: 
http://stackoverflow.com/questions/1077307/why-is-there-no-firstiterable-built-in-function-in-python
 which is nice but doesn’t fix the subtleties like when there is no true value 
etc which makes it useless for production code and one has to write boilerplate 
code every single time.

It was even one of five Python packages Lukasz Langa deemed worthy to be 
highlighted in his PyCon 2013 lightning talk: 
http://youtu.be/1vui-LupKJI?t=20m40s

FWIW, SQL has a similar function called COALESCE ( 
https://en.wikipedia.org/wiki/Null_(SQL)#COALESCE ) which only handles NULL 
though.

***

I’ll happily respond to any questions or concerns that may arise and supply a 
patch as soon as we agree on a place to add it.

--
assignee: hynek
components: Library (Lib)
messages: 194338
nosy: hynek, lukasz.langa, ncoghlan, rhettinger
priority: normal
severity: normal
status: open
title: Add a “first” function to the stdlib
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

`filter()` exhausts the full iterator which is potentially very expensive – 
like in conduction with regular expressions.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add a “first” function to the stdlib

2013-08-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Ah ok sorry. Anyhow, it’s just a very common idiom that should be easy and 
readable.

As said, I’m not married to any names at all and would happily add a 
compatibility package to PyPI with the new names/parameters.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add a “first”-like function to the stdlib

2013-08-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Martin, I don’t find the loop easier to read because you have to *remember* the 
`break` otherwise “weird stuff happens”.

Coalesce seems common enough, I would +1 on that too.

--
title: Add a “first” function to the stdlib - Add a “first”-like function to 
the stdlib

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.coalesce

2013-08-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

 def coalesce(iterable, default=None, pred=None):
return next(filter(pred, iterable), default)
 
 Are you sure you want add this one-line function to the itertools module 
 rather then to recipes?

Well, for many – including me – it would mean to have this one-line function in 
every other project or a PyPI dependency.  I’m certain there are other short 
but useful functions in the stdlib.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18652] Add itertools.coalesce

2013-08-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

 But why you want to have a separate function instead of just use two builtins?

This question has been answered twice now, once from Nick – please refer above.

It's a clunky and error-prone solution to a common problem. Maybe you can't 
emphasize because it's not a common problem to you but that doesn't make it 
less useful.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18652
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek
versions: +Python 3.4 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18108
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17538] Document XML Vulnerabilties

2013-03-25 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I feel like there should be a warning in Doc/library/xml.rst too.

Is there any actual reason why we don’t ship defusedxml with Python and add an 
easy way to monkeypatch so there’s as little passive barriers as possible to 
use XML “safely”?

I’m sorry I didn’t speak up on when this was discussed on the ML but I found 
the discussion…depressing.

--
assignee:  - docs@python
components: +Documentation -Library (Lib), XML
nosy: +docs@python, hynek
type:  - security
versions: +Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17538
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11063] uuid.py module import has heavy side effects

2013-02-24 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Jyrki, roundup doesn’t seem to recognize you patch so we can’t review it in 
Rietveld. Could you re-try, maybe using hg?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11063
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2013-02-13 Thread Hynek Schlawack

Hynek Schlawack added the comment:

While I agree that it’s a problem, I’m a bit uneasy about changing that back to 
2.7. I’m pretty sure this would break numerous programs.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17180
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2013-02-13 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Yeah, I’m thinking about backup scripts etc.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17180
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17180] shutil copy* unsafe on POSIX - they preserve setuid/setgit bits

2013-02-13 Thread Hynek Schlawack

Hynek Schlawack added the comment:

SGTM. I’d like an explicit warning on the security implications in the docs 
though.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17180
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17153] tarfile extract fails when Unicode in pathname

2013-02-08 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17153
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17076] shutil.copytree failing on xattr-less filesystems (like NFS)

2013-02-05 Thread Hynek Schlawack

Hynek Schlawack added the comment:

The buildbots look happy, thank you for spotting  the patch Thomas!

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17076
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17121] SSH upload for distutils

2013-02-04 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I would strongly prefer to back port certificate validation instead. Is there 
anything *practical* that makes it hard/impossible?

If we want to keep features stable, we can add it privately so it’s only usable 
by distutils. The susceptibility to (easy!) MITM attacks can be counted as a 
security bug and this seems the most practical resolve.

--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17121
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17076] shutil.copytree failing on xattr-less filesystems (like NFS)

2013-02-04 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17076
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17076] shutil.copytree failing on xattr-less filesystems (like NFS)

2013-01-29 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Could you add regression tests to your patch please?

--
assignee:  - hynek
priority: high - normal
type: crash - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17076
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17006] Warn users about hashing secrets?

2013-01-21 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I think since we ship cryptographic functions, we should take responsibility 
and warn against the most common mistakes people do.

--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17006
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15881] multiprocessing 'NoneType' object is not callable

2013-01-20 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15881
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6975] symlinks incorrectly resolved on POSIX platforms

2013-01-10 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
title: symlinks incorrectly resolved on Linux - symlinks incorrectly resolved 
on POSIX platforms

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6975] symlinks incorrectly resolved on Linux

2013-01-09 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I will review this first thing tomorrow.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6975
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16591] RUNSHARED wrong for OSX no framework

2012-12-31 Thread Hynek Schlawack

Hynek Schlawack added the comment:

bikeshed$(pwd)/bikeshed

--
stage:  - patch review
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16591] RUNSHARED wrong for OSX no framework

2012-12-31 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I’m fine with that. My focus was fixing the ticket metadata. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16591
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16815] Is all OK!!

2012-12-29 Thread Hynek Schlawack

New submission from Hynek Schlawack:

Glad to hear.

--
nosy: +hynek
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16815
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Thanks Serhiy!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15840] Ambiguity with regard to the effect of accessing a closed IOBase instance

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I agree that standardize behavior here would be useful. But it sounds like a 
candidate for 3.4. Unifying/changing it for existing releases appears rather 
hairy to me?

--
assignee: docs@python - 
type:  - behavior
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15594] test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: [Errno 22] Invalid argument

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Any news? Wouldn’t Apple give us a license for our buildbots like MSFT does?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15594
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14870] Descriptions of os.utime() and os.utimensat() use wrong notation

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Turns out, Larry fixed these two while working on #14626.

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14870
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7325] tempfile.mkdtemp() does not return absolute pathname when relative dir is specified

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

I think we should resolve this one line change.

Jessica’s patch looks just fine, so I tend to apply it.  However, I’d like to 
document the current behavior in 2.7, 3.2, 3.3 and 3.4.

Am I missing anything?

--
nosy: +hynek
versions: +Python 2.7, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7325
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1610654] cgi.py multipart/form-data

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

It would be great if someone could port this patch to Python 3.4 and verify its 
effectiveness.

--
keywords: +easy -patch
stage: test needed - needs patch
versions: +Python 3.4 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1610654
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11063] uuid.py module import has heavy side effects

2012-12-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

The patch hasn’t incorporated Antoine’s comments AFAICT.

Also I don’t see this fit for back porting to bug fix releases. Correct me if 
I’m wrong.

--
nosy: +hynek
stage: patch review - needs patch
versions: +Python 3.4 -Python 2.7, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11063
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15450] Allow dircmp.subdirs to behave well under subclassing

2012-12-27 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15450
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-22 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Serhiy, are you going to update your patches? I can implement the feedback of 
our Q4 Community Service Award awardee too in case you’re busy.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16706] Get rid of os.error. Use OSError instead

2012-12-18 Thread Hynek Schlawack

Hynek Schlawack added the comment:

 I think deprecation makes not big value.
 We should continue aliases support and there are no place to raise warning.
 What we can do — mention deprecation in the doc.

That’s what I meant. I saw it in shutil code, were confused, looked it up, 
wondered why it exists. I would like to get rid of it.

Do you have any concrete plans or should I just wade through shutil and make it 
pretty for 3.4?

 The reason to get rid of other OSError aliases to make cleaner code 
 (especially considering situations like `except (os.error, IOError):` and use 
 best practices in stdlib.

Sure.

 I think the later is very important because stdlib is first class example of 
 coding style for many users.

I hope not. :-/

 After stdlib we can cleanup C code to that unification and use concrete 
 exception classes instead of errno checking (#16705).

Awesome.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16706
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16706] Get rid of os.error. Use OSError instead

2012-12-17 Thread Hynek Schlawack

New submission from Hynek Schlawack:

Ah yeah I support this endeavor, I fixed a few instances in rmtree while 
working on it. It’s just confusing.

JFTR, is there any rationale/reason to do it? Last time I checked it wasn’t 
deprecated.

--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16706
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16695] Clarify fnmatch glob docs about the handling of leading .s

2012-12-16 Thread Hynek Schlawack

New submission from Hynek Schlawack:

See issue16664.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 177584
nosy: Sebastian.Kreft, docs@python, hynek, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Clarify fnmatch  glob docs about the handling of leading .s
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16695
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16664] Test Glob: files starting with .

2012-12-16 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Patch LGTM and will be applied, I have opened issue16695 for the related update 
of the docs.

BTW how did you create the patch? The bugtracker/Rietveld didn't recognize it 
for review and applying it took some effort too.

--
title: [PATCH] Test Glob: files starting with . - Test Glob: files starting 
with .
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16618] Different glob() results for strings and bytes

2012-12-16 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16618
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16664] Test Glob: files starting with .

2012-12-16 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Thank you for your patch and welcome to CPython core development!

Presuming you want to submit more patches in future, please take the time to 
sign a Python contributor agreement: http://www.python.org/psf/contrib/ . 
You'll get a pretty star next to your name in the bug tracker in return. ;)

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16664
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15872] shutil.rmtree(..., ignore_errors=True) doesn't ignore all errors

2012-12-10 Thread Hynek Schlawack

Hynek Schlawack added the comment:

“I wish I were wrangling inconsistent Windows buildbots.”

Nobody. Ever. *sigh*

It appears they are appeased now, so finally closing. Thanks for the patches 
everyone!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15872
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15001] segmentation fault with del sys.modules['__main__']

2012-11-07 Thread Hynek Schlawack

Hynek Schlawack added the comment:

This should be fixed now, thanks to all who helped!

--
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15001
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5411] Add xz support to shutil

2012-11-02 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Éric, what’s your take on this approach (not code)? We have time enough till 
3.4 but it seems this doesn't really move forward. Any thoughts how to get this 
moving? Unfortunately I'm not invested enough in this to make a educated 
decision.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5411
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16381] Introduce option to force the interpreter to exit upon MemoryErrors

2012-11-02 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16381
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14794] slice.indices raises OverflowError

2012-11-02 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14794
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15001] segmentation fault with del sys.module['__main__']

2012-11-02 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Fun fact, on 2.7  3.2 I get infinite loops @ 100% CPU. 3.3  default crash.

Unless someone yells, I'll polish this up and commit next week.

--
stage:  - commit review
versions: +Python 3.4 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15001
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15148] shutil.which() docstring could be clearer

2012-11-02 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Any reason why this is still open?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15148
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15104] Unclear language in __main__ description

2012-11-02 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy:  -hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15104
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15490] Correct __sizeof__ support for StringIO

2012-11-02 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy:  -hynek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15490
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16099] robotparser doesn't support request rate and crawl delay parameters

2012-11-02 Thread Hynek Schlawack

Changes by Hynek Schlawack h...@ox.cx:


--
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16099
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1492704] distinct error type if shutil.copyfile() fails because of src and dst are the same file

2012-10-29 Thread Hynek Schlawack

Hynek Schlawack added the comment:

You're welcome. :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1492704
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16307] multiprocess.pool.map_async callables not working

2012-10-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

LGTM.

Presuming you want to submit more patches in future, please take the time to 
sign a Python contributor agreement: http://www.python.org/psf/contrib/ . 
You'll get a pretty star next to your name in the bug tracker in return. ;)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16307
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16307] multiprocess.pool.map_async callables not working

2012-10-27 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Applied. Thank you for your contribution!

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16307
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16313] Support xz compression in shutil module

2012-10-26 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Isn’t this a dupe of #5411?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16313
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16307] multiprocess.pool.map_async callables not working

2012-10-26 Thread Hynek Schlawack

Hynek Schlawack added the comment:

Thanks for taking the time! I remember my frustrations when trying to grok how 
the mp test suite works. :)

A small nit-pick first: you have a lot of extra white space in your patches. 
Just run 'make patchcheck' first, that should warn you about that.

Not sure, but the tests look rather complex to me. I’d humbly propose the the 
simplified test attached, which also ensures that error_callback get only 
called on errors and callback on success.

Opinions?

--
Added file: http://bugs.python.org/file27724/map-async-fix-with-tests.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16307
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   3   4   5   >