惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - Eric Lee

20230707-编程语言的变量覆盖 20230328-Epic Game更改修改更换安装目录 20230204 - 解决 Delphi 10.4 IDE 提示 socket error 10038 Access violation coreide270.bpl rtl270.bpl 20221112 - Find Device closed unexpectedly 问题解决 20220328 - BUG的出处 20220317 - 获取 .Net 版本的方法 20211015 - 解决华为 Matebook CPU 频率被锁在 0.39 GHz 的卡顿问题 20201118 - 解决CentOS7的RPMDB错误 rpmdb: BDB0113 Thread/process failed Thread died in Berkeley DB library 20201107 - 拯救 Discuz6 20201024 - 如何删除FF新鲜事 20201020 - 现代浏览器中表单自动完成功能带来的麻烦 20200331 - Zsh 下 使用 you-get 或 youtube-dl 时提示 no matches found 20200330 - Jetbrains IDE 提示 Unknown Module Type 的解决办法 20200320 - 解决 you-get 提示 urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)> 20200319 - 解决 macOS 上 zsh 提示 command not found 的问题 20200310 - 在macOS上删除LaunchPad中的顽固的带问号图标 20200221 - 记录云服务器中 cna12.dll 木马的解决 20190926 - macOS 下查看进程路径 20190925 - 使 macOS 的 rm 命令删除到回收站的不完美办法
20230126 - TurboGears 提示 builtins.NameError Session is not defined
Eric Lee · 2023-01-26 · via 博客园 - Eric Lee

问题现象:TurboGears 常规操作,运行 gearbox 服务后报错:

builtins.NameError
'Session' is not defined

解决办法:卸载最新版 SQLAlchemy 1.4 ,重新安装 SQLAlchemy 1.3。

重现步骤:

  1. 随便 quickstart 一个项目
  2. 运行 gearbox serve --reload 
  3. 打开 http://127.0.0.1:8080,点 Login,输入 bootstrap 中的用户名 manager 和密码 managepass
  4. 登录成功后,点击 Groups 或 Users 等表,页面出错:
...
C:\Python311\Lib\site-packages\sprox\providerselector.py 代码 101 行
...
if isinstance(hint, (Session, ScopedSession)):
            session = hint
...

分析过程:

  1. 事实:TurboGears 2.4.3 documentation 很成熟,Github 上没有相关 issue,Google 中缺少类似搜索;推理:很大概率是我自己的环境问题;
  2. 用 PyCharm 打开出错的代码 providerselector.py 101 行,Ctrl 点击 Session 跳转,查看前后端源代码,Session 报错的原因,怀疑可能与数据库 autocommit 有关。
  3. 尝试重新安装旧版本数据库组件依赖 SQLAlchemy 1.3,发现问题解决。