Comments (11)
Interesting, looks like a Windows file locking issue? I'll have to dust off my Windows machine and give it a closer look. I bet it affects all versions of Windows, but just in case, is this Windows 7 or?
from boltons.
Yes it' s Windows 7...
from boltons.
Hey MrLeeh, give it another shot, seems to work great for me on Windows 7 (and Unix).
from boltons.
That is strange. For me it is still not working. Actually I discovered the buck when using the pip-tools library which uses the AtomicSaver.
from boltons.
Interesting. Does that mean you're using the pip installed boltons or are you working off the git trunk, or easiest probably, just downloading fileutils.py and importing it?
from boltons.
Currently I' m using the pip install boltons (0.6.5)
from boltons.
Ah, yes, the PyPI version hasn't been updated yet. To test the fix just run pip install -e git+https://github.com/mahmoud/boltons.git#egg=boltons
and try the fileutils code in question. Or, if you'd like, I can roll out 0.6.6 and you can test that (I did test on Windows 7 earlier today ;) )
from boltons.
Thanks for the link. Now I don' t get this error anymore. But another one:
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from boltons.fileutils import AtomicSaver
>>> with AtomicSaver('foo.txt') as f:
... f.write('whatever')
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: 'str' does not support the buffer interface
Am I doing something wrong by passing just the String to the write function?
from boltons.
Ah, Python 3. You need to encode that string to bytes before writing. f.write('mystring'.encode('utf8'))
OR f.write(b'mystring')
.
from boltons.
Ah, great. That works nice now. I didn' t think about byte encoding. Thank you very much for your help here π
from boltons.
no problem, enjoy!
from boltons.
Related Issues (20)
- Convert list of dict items to list of string items
- `ParsedException.from_string(text).to_string() == text` property violated due to anchors
- `boltons.ecoutils` `23.0.0` breaks `pdb` interactive prompt in `pytest` debug sessions HOT 4
- Non-empty `dictutils.OMD` cannot be loaded from `pickle` HOT 1
- RFC: Make boltons Python 3.7+ only. HOT 8
- Support in-place union for `dictutils.OrderedMultiDict` HOT 1
- [Feature request] Parametrize the delimiter to make glom use any kind of Path delimiter, not just `.` HOT 1
- wraps loses keywords
- chunked filter HOT 3
- tracking some ideas HOT 3
- LRU .values() and dict return old entries HOT 3
- call _orig_default identity
- Names in `boltons.strutils.__all__` with no definitions
- Missing git tags for 23.1.0 & 23.1.1 releases HOT 1
- iterutils.get_path has undocumented path as string parameter HOT 1
- 23.1.1: pytest (8.1.0) fail HOT 3
- Build fails with Python 3.13 HOT 6
- research should accept remap args HOT 3
- Python 3.12 warning: Use of naΓ―ve datetimes is deprecated HOT 1
- Type hints HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boltons.